diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index e6bcc2632..454434baa 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -32,6 +32,7 @@ #include #include #include "configuration_interface.h" +#include using google::LogMessage; @@ -71,7 +72,13 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, item_size = sizeof(gr_complex); //avoids uninitialization input_size_ = sizeof(gr_complex); //avoids uninitialization } - + float default_if = 0.0; + float if_ = config_->property(role_ + ".if", default_if); + if (if_ > 0.0) + { + const std::vector taps = { 1.0 }; //All-pass filter + freq_xlating_ = gr::filter::freq_xlating_fir_filter_ccf::make(1, taps, if_, config_->property("SignalSource.sampling_frequency", 2000000)); + } if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; @@ -95,6 +102,10 @@ void PulseBlankingFilter::connect(gr::top_block_sptr top_block) { top_block->connect(pulse_blanking_cc_, 0, file_sink_, 0); } + if (config_->property(role_ + ".if", 0.0) > 0.0) + { + top_block->connect(freq_xlating_, 0, pulse_blanking_cc_, 0); + } } else @@ -113,6 +124,10 @@ void PulseBlankingFilter::disconnect(gr::top_block_sptr top_block) { top_block->disconnect(pulse_blanking_cc_, 0, file_sink_, 0); } + if (config_->property(role_ + ".if", 0.0) > 0.0) + { + top_block->disconnect(freq_xlating_, 0, pulse_blanking_cc_, 0); + } } else { @@ -125,7 +140,14 @@ gr::basic_block_sptr PulseBlankingFilter::get_left_block() { if (input_item_type_.compare("gr_complex") == 0) { - return pulse_blanking_cc_; + if (config_->property(role_ + ".if", 0.0) > 0.0) + { + return freq_xlating_; + } + else + { + return pulse_blanking_cc_; + } } else { diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h index 18b040bcc..238636f28 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h @@ -35,6 +35,7 @@ #include #include #include +#include #include "gnss_block_interface.h" #include "pulse_blanking_cc.h" @@ -82,6 +83,7 @@ private: unsigned int out_streams_; gr::blocks::file_sink::sptr file_sink_; pulse_blanking_cc_sptr pulse_blanking_cc_; + gr::filter::freq_xlating_fir_filter_ccf::sptr freq_xlating_; }; #endif // GNSS_SDR_PULSE_BLANKING_FILTER_H_