From 10bbe2a267c7a5eb92036b88d80a3dd1d1ddffab Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 7 Nov 2017 09:20:06 +0100 Subject: [PATCH 1/2] Avoid IF parameter ambiguity Added a new boolean for proper instantiation and connection of the internal blocks --- .../input_filter/adapters/pulse_blanking_filter.cc | 8 +++++--- .../input_filter/adapters/pulse_blanking_filter.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index 9c1c18b82..07c543a92 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -44,6 +44,7 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, out_streams_(out_streams) { size_t item_size; + xlat_ = false; std::string default_input_item_type = "gr_complex"; std::string default_output_item_type = "gr_complex"; std::string default_dump_filename = "../data/input_filter.dat"; @@ -79,6 +80,7 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, double if_ = config_->property(role_ + ".IF", if_aux); if (std::abs(if_) > 1.0) { + xlat_ = true; double default_sampling_freq = 4000000.0; double sampling_freq_ = config_->property(role_ + ".sampling_frequency", default_sampling_freq); double default_bw = 2000000.0; @@ -111,7 +113,7 @@ void PulseBlankingFilter::connect(gr::top_block_sptr top_block) { top_block->connect(pulse_blanking_cc_, 0, file_sink_, 0); } - if (std::abs(config_->property(role_ + ".if", 0.0)) > 1.0) + if (xlat_) { top_block->connect(freq_xlating_, 0, pulse_blanking_cc_, 0); } @@ -133,7 +135,7 @@ void PulseBlankingFilter::disconnect(gr::top_block_sptr top_block) { top_block->disconnect(pulse_blanking_cc_, 0, file_sink_, 0); } - if (std::abs(config_->property(role_ + ".if", 0.0)) > 1.0) + if (xlat_) { top_block->disconnect(freq_xlating_, 0, pulse_blanking_cc_, 0); } @@ -149,7 +151,7 @@ gr::basic_block_sptr PulseBlankingFilter::get_left_block() { if (input_item_type_.compare("gr_complex") == 0) { - if (std::abs(config_->property(role_ + ".if", 0.0)) > 1.0) + if (xlat_) { return freq_xlating_; } diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h index e0748a9d2..8c5211c64 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h @@ -73,6 +73,7 @@ public: private: ConfigurationInterface* config_; bool dump_; + bool xlat_; std::string dump_filename_; std::string input_item_type_; size_t input_size_; From 829071369dfed3d4045ee8fc1eaa56796c6cf309 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 7 Nov 2017 10:34:49 +0100 Subject: [PATCH 2/2] Changes in cut-off frequency and transition width parameters --- .../input_filter/adapters/freq_xlating_fir_filter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc index d52b4ad51..a62d179f1 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -412,8 +412,8 @@ void FreqXlatingFirFilter::init() { double default_bw = 2000000.0; double bw_ = config_->property(role_ + ".bw", default_bw); - double default_tw = bw_ / 20.0; + double default_tw = bw_ / 10.0; double tw_ = config_->property(role_ + ".tw", default_tw); - taps_ = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_ / 2.0, tw_); + taps_ = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_, tw_); } }