diff --git a/gamutrf/grscan.py b/gamutrf/grscan.py index bf8cd97c..63c3d9ed 100644 --- a/gamutrf/grscan.py +++ b/gamutrf/grscan.py @@ -73,9 +73,7 @@ def __init__( self.wavelearner = wavelearner self.iqtlabs = iqtlabs self.samp_rate = samp_rate - self.retune_pre_fft = blocks.stream_to_vector( - gr.sizeof_gr_complex, fft_batch_size * nfft - ) + self.retune_pre_fft = None ################################################## # Blocks @@ -335,6 +333,20 @@ def get_fft_blocks( tuning_ranges, pretune, ): + fft_block = None + fft_roll = False + if self.wavelearner: + fft_block = self.wavelearner.fft(int(fft_batch_size * nfft), (nfft), True) + fft_roll = True + elif vkfft: + fft_block = self.iqtlabs.vkfft(int(fft_batch_size * nfft), nfft, True) + else: + fft_batch_size = 1 + + fft_blocks = [] + if dc_block_len: + fft_blocks.append(grfilter.dc_blocker_cc(dc_block_len, dc_block_long)) + if pretune: self.retune_pre_fft = self.iqtlabs.retune_pre_fft( nfft, @@ -347,16 +359,11 @@ def get_fft_blocks( skip_tune_step, tuning_ranges, ) - fft_blocks = [] - if dc_block_len: - fft_blocks.append(grfilter.dc_blocker_cc(dc_block_len, dc_block_long)) - fft_block = None - fft_roll = False - if self.wavelearner: - fft_block = self.wavelearner.fft(int(fft_batch_size * nfft), (nfft), True) - fft_roll = True - elif vkfft: - fft_block = self.iqtlabs.vkfft(int(fft_batch_size * nfft), nfft, True) + else: + self.retune_pre_fft = blocks.stream_to_vector( + gr.sizeof_gr_complex, fft_batch_size * nfft + ) + if fft_block: fft_blocks.extend( self.get_offload_fft_block( diff --git a/tests/test_grscan.py b/tests/test_grscan.py index a102dccd..83e30c47 100644 --- a/tests/test_grscan.py +++ b/tests/test_grscan.py @@ -107,7 +107,7 @@ def run_grscan_smoke(self, pretune, wavelearner, write_samples): rotate_secs=900, db_clamp_floor=-1e6, pretune=pretune, - fft_batch_size=1, + fft_batch_size=256, ) tb.start() time.sleep(3)