diff options
author | Marcus Müller <marcus@hostalia.de> | 2018-08-31 23:02:22 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-08-31 23:02:22 +0200 |
commit | 254fe5e89403d4de1fa6663d09efdf946996aff3 (patch) | |
tree | 62877d7ac7fdedf6c397c51e22ac6f97eba97ddf /gr-blocks/python/blocks/qa_vco.py | |
parent | 896d1c9da31963ecf5b0d90942c2af51ca998a69 (diff) | |
parent | 5ad935c3a3dd46ce2860b13e2b774e4841784616 (diff) |
Merge remote-tracking branch 'origin/next' into merge_next
Diffstat (limited to 'gr-blocks/python/blocks/qa_vco.py')
-rw-r--r-- | gr-blocks/python/blocks/qa_vco.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gr-blocks/python/blocks/qa_vco.py b/gr-blocks/python/blocks/qa_vco.py index fdd1eb1001..a67fe36d62 100644 --- a/gr-blocks/python/blocks/qa_vco.py +++ b/gr-blocks/python/blocks/qa_vco.py @@ -20,18 +20,20 @@ # Boston, MA 02110-1301, USA. # +from __future__ import division + from gnuradio import gr, gr_unittest, blocks import math def sig_source_f(samp_rate, freq, amp, N): - t = map(lambda x: float(x)/samp_rate, xrange(N)) - y = map(lambda x: amp*math.cos(2.*math.pi*freq*x), t) + t = [float(x) / samp_rate for x in range(N)] + y = [amp*math.cos(2.*math.pi*freq*x) for x in t] return y def sig_source_c(samp_rate, freq, amp, N): - t = map(lambda x: float(x)/samp_rate, xrange(N)) - y = map(lambda x: math.cos(2.*math.pi*freq*x) + \ - 1j*math.sin(2.*math.pi*freq*x), t) + t = [float(x) / samp_rate for x in range(N)] + y = [math.cos(2.*math.pi*freq*x) + \ + 1j*math.sin(2.*math.pi*freq*x) for x in t] return y class test_vco(gr_unittest.TestCase): @@ -49,7 +51,7 @@ class test_vco(gr_unittest.TestCase): sig_source_f(1, 0.25, 1, 200) src = blocks.vector_source_f(src_data) - op = blocks.vco_f(1, math.pi/2.0, 1) + op = blocks.vco_f(1, math.pi / 2.0, 1) dst = blocks.vector_sink_f() self.tb.connect(src, op, dst) @@ -66,7 +68,7 @@ class test_vco(gr_unittest.TestCase): sig_source_c(1, 0.25, 1, 200) src = blocks.vector_source_f(src_data) - op = blocks.vco_c(1, math.pi/2.0, 1) + op = blocks.vco_c(1, math.pi / 2.0, 1) dst = blocks.vector_sink_c() self.tb.connect(src, op, dst) |