diff --git a/grc/iqtlabs_retune_fft.block.yml b/grc/iqtlabs_retune_fft.block.yml index edd415b2..0e6f79f2 100644 --- a/grc/iqtlabs_retune_fft.block.yml +++ b/grc/iqtlabs_retune_fft.block.yml @@ -32,6 +32,7 @@ documentation: |- (generally "rx_freq" for Soapy or UHD sources). nfft: number of FFT points. samp_rate: sample rate. + tune_jitter_hz: if > 0, jitter tune interval. freq_start: frequency to start scan at in Hz (overridden by tuning_ranges). freq_end: frequency to end scan at in Hz (overridden by tuning_ranges). tune_step_hz: increment frequency by this value each retuning step. @@ -70,18 +71,21 @@ documentation: |- templates: imports: from gnuradio import iqtlabs make: > - iqtlabs.retune_fft(${tag}, ${nfft}, ${samp_rate}, ${freq_start}, - ${freq_end}, ${tune_step_hz}, ${tune_step_fft}, ${skip_tune_step_fft}, - ${fft_min}, ${fft_max}, ${sdir}, ${write_step_fft}, ${bucket_range}, - ${tuning_ranges}, ${description}, ${rotate_secs}, ${pre_fft}, ${tag_now}, - ${low_power_hold_down), ${slew_rx_time}, ${peak_fft_range}) + iqtlabs.retune_fft( + ${tag}, ${nfft}, ${samp_rate}, ${tune_jitter_hz}, + ${freq_start}, ${freq_end}, ${tune_step_hz}, ${tune_step_fft}, + ${skip_tune_step_fft}, ${fft_min}, ${fft_max}, ${sdir}, ${write_step_fft}, + ${bucket_range}, ${tuning_ranges}, ${description}, ${rotate_secs}, + ${pre_fft}, ${tag_now}, ${low_power_hold_down), ${slew_rx_time}, + ${peak_fft_range}) cpp_templates: includes: ['#include '] declarations: 'gr::iqtlabs::retune_fft::sptr ${id};' make: > - this->${id} = gr::iqtlabs::retune_fft::make(${tag}, ${nfft}, - ${samp_rate}, ${freq_start}, ${freq_end}, ${tune_step_hz}, ${tune_step_fft}, + this->${id} = gr::iqtlabs::retune_fft::make( + ${tag}, ${nfft}, ${samp_rate}, ${tune_jitter_hz}, + ${freq_start}, ${freq_end}, ${tune_step_hz}, ${tune_step_fft}, ${skip_tune_step_fft}, ${fft_min}, ${fft_max}, ${sdir}, ${write_step_fft}, ${bucket_range}, ${tuning_ranges}, ${description}, ${rotate_secs}, ${pre_fft}, ${tag_now}, ${low_power_hold_down), ${slew_rx_time}, @@ -103,6 +107,8 @@ parameters: dtype: int - id: samp_rate dtype: int + - id: tune_jitter_hz + dtype: int - id: freq_start dtype: raw - id: freq_end diff --git a/grc/iqtlabs_retune_pre_fft.block.yml b/grc/iqtlabs_retune_pre_fft.block.yml index 628b9abb..5a0c6909 100644 --- a/grc/iqtlabs_retune_pre_fft.block.yml +++ b/grc/iqtlabs_retune_pre_fft.block.yml @@ -17,6 +17,7 @@ documentation: |- parameters: nfft: number of FFT points. samp_rate: sample rate. + tune_jitter_hz: if > 0, jitter tune interval. fft_batch_size: number of vectors to batch. tag: expected PMT tag containing center frequency (generally "rx_freq" for Soapy or UHD sources). @@ -40,20 +41,20 @@ templates: imports: from gnuradio import iqtlabs make: > iqtlabs.retune_pre_fft( - ${nfft}, ${samp_rate}, ${fft_batch_size}, ${tag}, ${freq_start}, - ${freq_end}, ${tune_step_hz}, ${tune_step_fft}, ${skip_tune_step_fft}, - ${tuning_ranges}, ${tag_now}, ${low_power_hold_down}, - ${slew_rx_time}) + ${nfft}, ${samp_rate}, ${tune_jitter_hz} ${fft_batch_size}, ${tag}, + ${freq_start}, ${freq_end}, ${tune_step_hz}, ${tune_step_fft}, + ${skip_tune_step_fft}, ${tuning_ranges}, ${tag_now}, + ${low_power_hold_down}, ${slew_rx_time}) cpp_templates: includes: ['#include '] declarations: 'gr::iqtlabs::retune_pre_fft::sptr ${id};' make: > this->${id} = gr::iqtlabs::retune_pre_fft::make( - ${nfft}, ${samp_rate}, ${fft_batch_size}, ${tag}, {freq_start}, - ${freq_end}, ${tune_step_hz}, ${tune_step_fft}, ${skip_tune_step_fft}, - ${tuning_ranges}, ${tag_now}, ${low_power_hold_down}, - ${slew_rx_time}); + ${nfft}, ${samp_rate}, ${tune_jitter_hz}, ${fft_batch_size}, ${tag}, + {freq_start}, ${freq_end}, ${tune_step_hz}, ${tune_step_fft}, + ${skip_tune_step_fft}, ${tuning_ranges}, ${tag_now}, + ${low_power_hold_down}, ${slew_rx_time}); link: ['libgnuradio-iqtlabs.so'] parameters: @@ -61,6 +62,8 @@ parameters: dtype: int - id: samp_rate dtype: int + - id: tune_jitter_hz + dtype: int - id: fft_batch_size dtype: int - id: tag diff --git a/include/gnuradio/iqtlabs/retune_fft.h b/include/gnuradio/iqtlabs/retune_fft.h index d14521bf..f719a94c 100644 --- a/include/gnuradio/iqtlabs/retune_fft.h +++ b/include/gnuradio/iqtlabs/retune_fft.h @@ -229,11 +229,12 @@ class IQTLABS_API retune_fft : virtual public gr::block { * creating new instances. */ static sptr make(const std::string &tag, size_t nfft, uint64_t samp_rate, - uint64_t freq_start, uint64_t freq_end, - uint64_t tune_step_hz, uint64_t tune_step_fft, - uint64_t skip_tune_step_fft, double fft_min, double fft_max, - const std::string &sdir, uint64_t write_step_fft, - double bucket_range, const std::string &tuning_ranges, + uint64_t tune_jitter_hz, uint64_t freq_start, + uint64_t freq_end, uint64_t tune_step_hz, + uint64_t tune_step_fft, uint64_t skip_tune_step_fft, + double fft_min, double fft_max, const std::string &sdir, + uint64_t write_step_fft, double bucket_range, + const std::string &tuning_ranges, const std::string &description, uint64_t rotate_secs, bool pre_fft, bool tag_now, bool low_power_hold_down, bool slew_rx_time, size_t peak_fft_range); diff --git a/include/gnuradio/iqtlabs/retune_pre_fft.h b/include/gnuradio/iqtlabs/retune_pre_fft.h index e1b1d587..34c4bfe9 100644 --- a/include/gnuradio/iqtlabs/retune_pre_fft.h +++ b/include/gnuradio/iqtlabs/retune_pre_fft.h @@ -229,10 +229,11 @@ class IQTLABS_API retune_pre_fft : virtual public gr::block { * creating new instances. */ - static sptr make(size_t nfft, uint64_t samp_rate, size_t fft_batch_size, - const std::string &tag, uint64_t freq_start, - uint64_t freq_end, uint64_t tune_step_hz, - uint64_t tune_step_fft, uint64_t skip_tune_step_fft, + static sptr make(size_t nfft, uint64_t samp_rate, uint64_t tune_jitter_hz, + size_t fft_batch_size, const std::string &tag, + uint64_t freq_start, uint64_t freq_end, + uint64_t tune_step_hz, uint64_t tune_step_fft, + uint64_t skip_tune_step_fft, const std::string &tuning_ranges, bool tag_now, bool low_power_hold_down, bool slew_rx_time); }; diff --git a/lib/retune_fft_impl.cc b/lib/retune_fft_impl.cc index 520b472c..cb72cfa2 100644 --- a/lib/retune_fft_impl.cc +++ b/lib/retune_fft_impl.cc @@ -219,32 +219,31 @@ const pmt::pmt_t JSON_KEY = pmt::mp("json"); const boost::iostreams::zstd_params zstd_params = boost::iostreams::zstd_params(boost::iostreams::zstd::default_compression); -retune_fft::sptr -retune_fft::make(const std::string &tag, size_t nfft, uint64_t samp_rate, - uint64_t freq_start, uint64_t freq_end, uint64_t tune_step_hz, - uint64_t tune_step_fft, uint64_t skip_tune_step_fft, - double fft_min, double fft_max, const std::string &sdir, - uint64_t write_step_fft, double bucket_range, - const std::string &tuning_ranges, - const std::string &description, uint64_t rotate_secs, - bool pre_fft, bool tag_now, bool low_power_hold_down, - bool slew_rx_time, size_t peak_fft_range) { +retune_fft::sptr retune_fft::make( + const std::string &tag, size_t nfft, uint64_t samp_rate, + uint64_t tune_jitter_hz, uint64_t freq_start, uint64_t freq_end, + uint64_t tune_step_hz, uint64_t tune_step_fft, uint64_t skip_tune_step_fft, + double fft_min, double fft_max, const std::string &sdir, + uint64_t write_step_fft, double bucket_range, + const std::string &tuning_ranges, const std::string &description, + uint64_t rotate_secs, bool pre_fft, bool tag_now, bool low_power_hold_down, + bool slew_rx_time, size_t peak_fft_range) { return gnuradio::make_block_sptr( - tag, nfft, samp_rate, freq_start, freq_end, tune_step_hz, tune_step_fft, - skip_tune_step_fft, fft_min, fft_max, sdir, write_step_fft, bucket_range, - tuning_ranges, description, rotate_secs, pre_fft, tag_now, + tag, nfft, samp_rate, tune_jitter_hz, freq_start, freq_end, tune_step_hz, + tune_step_fft, skip_tune_step_fft, fft_min, fft_max, sdir, write_step_fft, + bucket_range, tuning_ranges, description, rotate_secs, pre_fft, tag_now, low_power_hold_down, slew_rx_time, peak_fft_range); } retune_fft_impl::retune_fft_impl( const std::string &tag, size_t nfft, uint64_t samp_rate, - uint64_t freq_start, uint64_t freq_end, uint64_t tune_step_hz, - uint64_t tune_step_fft, uint64_t skip_tune_step_fft, double fft_min, - double fft_max, const std::string &sdir, uint64_t write_step_fft, - double bucket_range, const std::string &tuning_ranges, - const std::string &description, uint64_t rotate_secs, bool pre_fft, - bool tag_now, bool low_power_hold_down, bool slew_rx_time, - size_t peak_fft_range) + uint64_t tune_jitter_hz, uint64_t freq_start, uint64_t freq_end, + uint64_t tune_step_hz, uint64_t tune_step_fft, uint64_t skip_tune_step_fft, + double fft_min, double fft_max, const std::string &sdir, + uint64_t write_step_fft, double bucket_range, + const std::string &tuning_ranges, const std::string &description, + uint64_t rotate_secs, bool pre_fft, bool tag_now, bool low_power_hold_down, + bool slew_rx_time, size_t peak_fft_range) : gr::block("retune_fft", gr::io_signature::make(1 /* min inputs */, 1 /* max inputs */, nfft * sizeof(input_type)), @@ -252,9 +251,9 @@ retune_fft_impl::retune_fft_impl( 2 /* min outputs */, 2 /* max outputs */, std::vector{(int)sizeof(output_type), (int)(nfft * sizeof(input_type))})), - retuner_impl(samp_rate, freq_start, freq_end, tune_step_hz, tune_step_fft, - skip_tune_step_fft, tuning_ranges, tag_now, - low_power_hold_down, slew_rx_time), + retuner_impl(samp_rate, tune_jitter_hz, freq_start, freq_end, + tune_step_hz, tune_step_fft, skip_tune_step_fft, + tuning_ranges, tag_now, low_power_hold_down, slew_rx_time), tag_(pmt::intern(tag)), nfft_(nfft), fft_min_(fft_min), fft_max_(fft_max), sample_count_(0), sdir_(sdir), write_step_fft_(write_step_fft), write_step_fft_count_(write_step_fft), bucket_range_(bucket_range), @@ -274,6 +273,13 @@ retune_fft_impl::retune_fft_impl( [this](const pmt::pmt_t &msg) { next_retune_(host_now_()); }); set_tag_propagation_policy(TPP_DONT); reset_items_(); + // If the pre-FFT block is handling tuning, then it will have already sent + // a tuning message, start at tuning step 1. + // We still need the retuner class to keep state, so we know which tuning + // range we are in and if we have started a new sweep. + if (pre_fft) { + need_retune_(1); + } } void retune_fft_impl::reset_items_() { diff --git a/lib/retune_fft_impl.h b/lib/retune_fft_impl.h index 4cab672f..743f6d7c 100644 --- a/lib/retune_fft_impl.h +++ b/lib/retune_fft_impl.h @@ -268,7 +268,8 @@ class retune_fft_impl : public retune_fft, base_impl, retuner_impl { public: retune_fft_impl(const std::string &tag, size_t nfft, uint64_t samp_rate, - uint64_t freq_start, uint64_t freq_end, uint64_t tune_step_hz, + uint64_t tune_jitter_hz, uint64_t freq_start, + uint64_t freq_end, uint64_t tune_step_hz, uint64_t tune_step_fft, uint64_t skip_tune_step_fft, double fft_min, double fft_max, const std::string &sdir, uint64_t write_step_fft, double bucket_range, diff --git a/lib/retune_pre_fft_impl.cc b/lib/retune_pre_fft_impl.cc index 9b1550cf..e004f629 100644 --- a/lib/retune_pre_fft_impl.cc +++ b/lib/retune_pre_fft_impl.cc @@ -210,34 +210,33 @@ namespace gr { namespace iqtlabs { -retune_pre_fft::sptr -retune_pre_fft::make(size_t nfft, uint64_t samp_rate, size_t fft_batch_size, - const std::string &tag, uint64_t freq_start, - uint64_t freq_end, uint64_t tune_step_hz, - uint64_t tune_step_fft, uint64_t skip_tune_step_fft, - const std::string &tuning_ranges, bool tag_now, - bool low_power_hold_down, bool slew_rx_time) { +retune_pre_fft::sptr retune_pre_fft::make( + size_t nfft, uint64_t samp_rate, uint64_t tune_jitter_hz, + size_t fft_batch_size, const std::string &tag, uint64_t freq_start, + uint64_t freq_end, uint64_t tune_step_hz, uint64_t tune_step_fft, + uint64_t skip_tune_step_fft, const std::string &tuning_ranges, bool tag_now, + bool low_power_hold_down, bool slew_rx_time) { return gnuradio::make_block_sptr( - nfft, samp_rate, fft_batch_size, tag, freq_start, freq_end, tune_step_hz, - tune_step_fft, skip_tune_step_fft, tuning_ranges, tag_now, - low_power_hold_down, slew_rx_time); + nfft, samp_rate, tune_jitter_hz, fft_batch_size, tag, freq_start, + freq_end, tune_step_hz, tune_step_fft, skip_tune_step_fft, tuning_ranges, + tag_now, low_power_hold_down, slew_rx_time); } retune_pre_fft_impl::retune_pre_fft_impl( - size_t nfft, uint64_t samp_rate, size_t fft_batch_size, - const std::string &tag, uint64_t freq_start, uint64_t freq_end, - uint64_t tune_step_hz, uint64_t tune_step_fft, uint64_t skip_tune_step_fft, - const std::string &tuning_ranges, bool tag_now, bool low_power_hold_down, - bool slew_rx_time) + size_t nfft, uint64_t samp_rate, uint64_t tune_jitter_hz, + size_t fft_batch_size, const std::string &tag, uint64_t freq_start, + uint64_t freq_end, uint64_t tune_step_hz, uint64_t tune_step_fft, + uint64_t skip_tune_step_fft, const std::string &tuning_ranges, bool tag_now, + bool low_power_hold_down, bool slew_rx_time) : gr::block( "retune_pre_fft", gr::io_signature::make(1 /* min inputs */, 1 /* max inputs */, sizeof(block_type)), gr::io_signature::make(1 /* min outputs */, 1 /* max outputs */, sizeof(block_type) * nfft * fft_batch_size)), - retuner_impl(samp_rate, freq_start, freq_end, tune_step_hz, tune_step_fft, - skip_tune_step_fft, tuning_ranges, tag_now, - low_power_hold_down, slew_rx_time), + retuner_impl(samp_rate, tune_jitter_hz, freq_start, freq_end, + tune_step_hz, tune_step_fft, skip_tune_step_fft, + tuning_ranges, tag_now, low_power_hold_down, slew_rx_time), nfft_(nfft), fft_batch_size_(fft_batch_size), tag_(pmt::intern(tag)) { message_port_register_out(TUNE_KEY); unsigned int alignment = volk_get_alignment(); diff --git a/lib/retune_pre_fft_impl.h b/lib/retune_pre_fft_impl.h index 2f42a0ba..09d359a2 100644 --- a/lib/retune_pre_fft_impl.h +++ b/lib/retune_pre_fft_impl.h @@ -228,10 +228,11 @@ class retune_pre_fft_impl : public retune_pre_fft, base_impl, retuner_impl { boost::scoped_ptr total_; public: - retune_pre_fft_impl(size_t nfft, size_t samp_rate, size_t fft_batch_size, - const std::string &tag, uint64_t freq_start, - uint64_t freq_end, uint64_t tune_step_hz, - uint64_t tune_step_fft, uint64_t skip_tune_step_fft, + retune_pre_fft_impl(size_t nfft, uint64_t samp_rate, uint64_t tune_jitter_hz, + size_t fft_batch_size, const std::string &tag, + uint64_t freq_start, uint64_t freq_end, + uint64_t tune_step_hz, uint64_t tune_step_fft, + uint64_t skip_tune_step_fft, const std::string &tuning_ranges, bool tag_now, bool low_power_hold_down, bool slew_rx_time); ~retune_pre_fft_impl(); diff --git a/lib/retuner_impl.cc b/lib/retuner_impl.cc index 7d5fa2c9..0121188b 100644 --- a/lib/retuner_impl.cc +++ b/lib/retuner_impl.cc @@ -208,20 +208,25 @@ namespace gr { namespace iqtlabs { -retuner_impl::retuner_impl(uint64_t samp_rate, uint64_t freq_start, - uint64_t freq_end, uint64_t tune_step_hz, - uint64_t tune_step_fft, uint64_t skip_tune_step_fft, +retuner_impl::retuner_impl(uint64_t samp_rate, uint64_t tune_jitter_hz, + uint64_t freq_start, uint64_t freq_end, + uint64_t tune_step_hz, uint64_t tune_step_fft, + uint64_t skip_tune_step_fft, const std::string &tuning_ranges, bool tag_now, bool low_power_hold_down, bool slew_rx_time) - : samp_rate_(samp_rate), freq_start_(freq_start), freq_end_(freq_end), - tune_step_hz_(tune_step_hz), tune_step_fft_(tune_step_fft), - skip_tune_step_fft_(skip_tune_step_fft), tag_now_(tag_now), - slew_rx_time_(slew_rx_time), low_power_hold_down_(low_power_hold_down), - tuning_range_(0), last_tuning_range_(0), tuning_range_step_(0), - last_rx_freq_(0), last_rx_time_(0), last_sweep_start_(0), fft_count_(0), - pending_retune_(0), total_tune_count_(0), tune_freq_(0), - skip_fft_count_(skip_tune_step_fft), in_hold_down_(false), - reset_tags_(false), slew_samples_(0) { + : samp_rate_(samp_rate), tune_jitter_hz_(tune_jitter_hz), + freq_start_(freq_start), freq_end_(freq_end), tune_step_hz_(tune_step_hz), + tune_step_fft_(tune_step_fft), skip_tune_step_fft_(skip_tune_step_fft), + tag_now_(tag_now), slew_rx_time_(slew_rx_time), + low_power_hold_down_(low_power_hold_down), tuning_range_(0), + last_tuning_range_(0), tuning_range_step_(0), last_rx_freq_(0), + last_rx_time_(0), last_sweep_start_(0), fft_count_(0), pending_retune_(0), + total_tune_count_(0), tune_freq_(0), skip_fft_count_(skip_tune_step_fft), + in_hold_down_(false), reset_tags_(false), slew_samples_(0) { + std::random_device rand_dev; + // cppcheck-suppress useInitializationList + rand_gen_ = std::mt19937(rand_dev()); + rand_dist_ = std::uniform_int_distribution(0, (int)tune_jitter_hz); parse_tuning_ranges_(tuning_ranges); if (low_power_hold_down_ && !stare_mode_) { reset_tags_ = true; @@ -304,8 +309,13 @@ void retuner_impl::next_retune_(TIME_T host_now) { return; } size_t range_steps = tuning_ranges_[tuning_range_].steps; - tune_freq_ = std::min(tune_freq_ + tune_step_hz_, - tuning_ranges_[tuning_range_].freq_end); + tune_freq_ = tune_freq_ + tune_step_hz_; + if (!stare_mode_ && tune_jitter_hz_ > 0) { + tune_freq_ -= tune_jitter_hz_; + FREQ_T offset = rand_dist_(rand_gen_); + tune_freq_ += offset; + } + tune_freq_ = std::min(tune_freq_, tuning_ranges_[tuning_range_].freq_end); ++tuning_range_step_; if (last_sweep_start_ == 0) { last_sweep_start_ = host_now; diff --git a/lib/retuner_impl.h b/lib/retuner_impl.h index 26d92bc8..81d90265 100644 --- a/lib/retuner_impl.h +++ b/lib/retuner_impl.h @@ -205,6 +205,7 @@ #include "iqtlabs_types.h" #include #include +#include #include #include @@ -226,8 +227,8 @@ typedef struct { class retuner_impl { public: - retuner_impl(uint64_t samp_rate, uint64_t freq_start, uint64_t freq_end, - uint64_t tune_step_hz, uint64_t tune_step_fft, + retuner_impl(uint64_t samp_rate, uint64_t tune_jitter_hz, uint64_t freq_start, + uint64_t freq_end, uint64_t tune_step_hz, uint64_t tune_step_fft, uint64_t skip_tune_step_fft, const std::string &tuning_ranges, bool tag_now, bool low_power_hold_down, bool slew_rx_time); void add_range_(uint64_t freq_start, uint64_t freq_end); @@ -236,6 +237,7 @@ class retuner_impl { void next_retune_(TIME_T host_now); TIME_T apply_rx_time_slew_(TIME_T rx_time); uint64_t samp_rate_; + uint64_t tune_jitter_hz_; uint64_t freq_start_; uint64_t freq_end_; uint64_t tune_step_hz_; @@ -261,6 +263,8 @@ class retuner_impl { bool stare_mode_; bool in_hold_down_; bool reset_tags_; + std::mt19937 rand_gen_; + std::uniform_int_distribution rand_dist_; }; } /* namespace iqtlabs */ } /* namespace gr */ diff --git a/python/iqtlabs/bindings/failed_conversions.txt b/python/iqtlabs/bindings/failed_conversions.txt index 3022675f..00b1f9ba 100644 --- a/python/iqtlabs/bindings/failed_conversions.txt +++ b/python/iqtlabs/bindings/failed_conversions.txt @@ -1 +1,2 @@ ./include/gnuradio/iqtlabs/retune_pre_fft.hError occurred while running CASTXML xml file does not exist +./include/gnuradio/iqtlabs/retune_fft.hError occurred while running CASTXML xml file does not exist diff --git a/python/iqtlabs/bindings/retune_fft_python.cc b/python/iqtlabs/bindings/retune_fft_python.cc index e641839f..766c498f 100644 --- a/python/iqtlabs/bindings/retune_fft_python.cc +++ b/python/iqtlabs/bindings/retune_fft_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(retune_fft.h) */ -/* BINDTOOL_HEADER_FILE_HASH(b79ce98f7df88b5148f31e77fe929369) */ +/* BINDTOOL_HEADER_FILE_HASH(b719d36e60bfabb3278dde87340455f0) */ /***********************************************************************************/ #include @@ -40,6 +40,7 @@ void bind_retune_fft(py::module& m) py::arg("tag"), py::arg("nfft"), py::arg("samp_rate"), + py::arg("tune_jitter_hz"), py::arg("freq_start"), py::arg("freq_end"), py::arg("tune_step_hz"), diff --git a/python/iqtlabs/bindings/retune_pre_fft_python.cc b/python/iqtlabs/bindings/retune_pre_fft_python.cc index 1b915e48..ea38c4bc 100644 --- a/python/iqtlabs/bindings/retune_pre_fft_python.cc +++ b/python/iqtlabs/bindings/retune_pre_fft_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(retune_pre_fft.h) */ -/* BINDTOOL_HEADER_FILE_HASH(b7616b720066a13e82470e7cfe4fc614) */ +/* BINDTOOL_HEADER_FILE_HASH(044ac0d9b5e19c3139e3e48bc237dfbe) */ /***********************************************************************************/ #include @@ -41,6 +41,7 @@ void bind_retune_pre_fft(py::module& m) .def(py::init(&retune_pre_fft::make), py::arg("nfft"), py::arg("samp_rate"), + py::arg("tune_jitter_hz"), py::arg("fft_batch_size"), py::arg("tag"), py::arg("freq_start"), diff --git a/python/iqtlabs/qa_retune_fft.py b/python/iqtlabs/qa_retune_fft.py index 084012be..b1bc242b 100755 --- a/python/iqtlabs/qa_retune_fft.py +++ b/python/iqtlabs/qa_retune_fft.py @@ -284,45 +284,45 @@ def retune_fft(self, fft_roll): with tempfile.TemporaryDirectory() as tmpdir: test_file = os.path.join(tmpdir, "samples.csv") iqtlabs_tuneable_test_source_0 = tuneable_test_source(freq_end) - iqtlabs_retune_pre_fft_0 = retune_pre_fft( - points, - samp_rate, - 1, - "rx_freq", - int(freq_start), - int(freq_end), - tune_step_hz, - tune_step_fft, - skip_tune_step_fft, - tuning_ranges, - False, - False, - False, + nfft=points, + samp_rate=samp_rate, + tune_jitter_hz=0, + fft_batch_size=1, + tag="rx_freq", + freq_start=int(freq_start), + freq_end=int(freq_end), + tune_step_hz=tune_step_hz, + tune_step_fft=tune_step_fft, + skip_tune_step_fft=skip_tune_step_fft, + tuning_ranges=tuning_ranges, + tag_now=False, + low_power_hold_down=False, + slew_rx_time=False, ) - iqtlabs_retune_fft_0 = retune_fft( - "rx_freq", - points, - samp_rate, - int(freq_start), - int(freq_end), - tune_step_hz, - tune_step_fft, - skip_tune_step_fft, - fft_min, - 1e9, - tmpdir, - fft_write_count, - bucket_range, - tuning_ranges, - "a text description", - 3600, - True, - False, - False, - False, - 0, + tag="rx_freq", + nfft=points, + samp_rate=samp_rate, + tune_jitter_hz=0, + freq_start=int(freq_start), + freq_end=int(freq_end), + tune_step_hz=tune_step_hz, + tune_step_fft=tune_step_fft, + skip_tune_step_fft=skip_tune_step_fft, + fft_min=fft_min, + fft_max=1e9, + sdir=tmpdir, + write_step_fft=fft_write_count, + bucket_range=bucket_range, + tuning_ranges=tuning_ranges, + description="a text description", + rotate_secs=3600, + pre_fft=True, + tag_now=False, + low_power_hold_down=False, + slew_rx_time=False, + peak_fft_range=0, ) pdu_decoder_0 = pdu_decoder() fft_vxx_0 = fft.fft_vcc(points, True, [], fft_roll, 1)