diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-12-21 15:11:39 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-12-21 21:19:13 -0500 |
commit | 55d3e4a47958be287648a2021f7e92d81086b2d9 (patch) | |
tree | ae0195c457f2cf2734376679cc88c2d728040680 /gr-fft/python | |
parent | fa781237f341a74a243a9fb930daee7e62c3a682 (diff) |
blocks: removes blocks moved to gr-blocks from gnuradio-core.
Also fixes up some other missing moves.
Diffstat (limited to 'gr-fft/python')
-rw-r--r-- | gr-fft/python/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gr-fft/python/logpwrfft.py | 18 | ||||
-rwxr-xr-x | gr-fft/python/qa_fft.py | 13 |
3 files changed, 18 insertions, 15 deletions
diff --git a/gr-fft/python/CMakeLists.txt b/gr-fft/python/CMakeLists.txt index c259035c33..b437b88a84 100644 --- a/gr-fft/python/CMakeLists.txt +++ b/gr-fft/python/CMakeLists.txt @@ -36,6 +36,8 @@ if(ENABLE_TESTING) list(APPEND GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gr-fft/python ${CMAKE_BINARY_DIR}/gr-fft/swig + ${CMAKE_BINARY_DIR}/gr-blocks/python + ${CMAKE_BINARY_DIR}/gr-blocks/swig ) list(APPEND GR_TEST_TARGET_DEPS gnuradio-fft) diff --git a/gr-fft/python/logpwrfft.py b/gr-fft/python/logpwrfft.py index f48b60518f..18ccb356d0 100644 --- a/gr-fft/python/logpwrfft.py +++ b/gr-fft/python/logpwrfft.py @@ -20,7 +20,7 @@ # from gnuradio import gr, window -from gnuradio.blks2 import stream_to_vector_decimator +from gnuradio import blocks import sys, math import fft_swig as fft @@ -54,10 +54,10 @@ class _logpwrfft_base(gr.hier_block2): gr.io_signature(1, 1, self._item_size), # Input signature gr.io_signature(1, 1, gr.sizeof_float*fft_size)) # Output signature - self._sd = stream_to_vector_decimator(item_size=self._item_size, - sample_rate=sample_rate, - vec_rate=frame_rate, - vec_len=fft_size) + self._sd = blocks.stream_to_vector_decimator(item_size=self._item_size, + sample_rate=sample_rate, + vec_rate=frame_rate, + vec_len=fft_size) if win is None: win = window.blackmanharris fft_window = win(fft_size) @@ -66,10 +66,10 @@ class _logpwrfft_base(gr.hier_block2): c2magsq = gr.complex_to_mag_squared(fft_size) self._avg = filter.single_pole_iir_filter_ff(1.0, fft_size) - self._log = gr.nlog10_ff(10, fft_size, - -20*math.log10(fft_size) # Adjust for number of bins - -10*math.log10(window_power/fft_size) # Adjust for windowing loss - -20*math.log10(ref_scale/2)) # Adjust for reference scale + self._log = blocks.nlog10_ff(10, fft_size, + -20*math.log10(fft_size) # Adjust for number of bins + -10*math.log10(window_power/fft_size) # Adjust for windowing loss + -20*math.log10(ref_scale/2)) # Adjust for reference scale self.connect(self, self._sd, fft, c2magsq, self._avg, self._log, self) self._average = average diff --git a/gr-fft/python/qa_fft.py b/gr-fft/python/qa_fft.py index 1c45ac1484..0a66a2c1fc 100755 --- a/gr-fft/python/qa_fft.py +++ b/gr-fft/python/qa_fft.py @@ -21,6 +21,7 @@ from gnuradio import gr, gr_unittest import fft_swig as fft +import blocks_swig as blocks import sys import random @@ -87,9 +88,9 @@ class test_fft(gr_unittest.TestCase): (1646.539306640625-1694.1956787109375j)) src = gr.vector_source_c(src_data) - s2v = gr.stream_to_vector(gr.sizeof_gr_complex, fft_size) + s2v = blocks.stream_to_vector(gr.sizeof_gr_complex, fft_size) op = fft.fft_vcc(fft_size, True, [], False) - v2s = gr.vector_to_stream(gr.sizeof_gr_complex, fft_size) + v2s = blocks.vector_to_stream(gr.sizeof_gr_complex, fft_size) dst = gr.vector_sink_c() tb.connect(src, s2v, op, v2s, dst) tb.run() @@ -141,9 +142,9 @@ class test_fft(gr_unittest.TestCase): expected_result = tuple([complex(primes[2*i], primes[2*i+1]) for i in range(fft_size)]) src = gr.vector_source_c(src_data) - s2v = gr.stream_to_vector(gr.sizeof_gr_complex, fft_size) + s2v = blocks.stream_to_vector(gr.sizeof_gr_complex, fft_size) op = fft.fft_vcc(fft_size, False, [], False) - v2s = gr.vector_to_stream(gr.sizeof_gr_complex, fft_size) + v2s = blocks.vector_to_stream(gr.sizeof_gr_complex, fft_size) dst = gr.vector_sink_c() tb.connect(src, s2v, op, v2s, dst) tb.run() @@ -199,9 +200,9 @@ class test_fft(gr_unittest.TestCase): nthreads = 2 src = gr.vector_source_c(src_data) - s2v = gr.stream_to_vector(gr.sizeof_gr_complex, fft_size) + s2v = blocks.stream_to_vector(gr.sizeof_gr_complex, fft_size) op = fft.fft_vcc(fft_size, False, [], False, nthreads) - v2s = gr.vector_to_stream(gr.sizeof_gr_complex, fft_size) + v2s = blocks.vector_to_stream(gr.sizeof_gr_complex, fft_size) dst = gr.vector_sink_c() tb.connect(src, s2v, op, v2s, dst) tb.run() |