diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index 696ccefea..c59179534 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -63,6 +63,17 @@ MmseResamplerConditioner::MmseResamplerConditioner( if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); + + + //create a FIR low pass filter + std::vector taps = gr::filter::firdes::low_pass(1.0, + sample_freq_in_, + sample_freq_out_ / 2.1, + sample_freq_out_ / 10, + gr::filter::firdes::win_type::WIN_HAMMING); + std::cout << "Enabled fractional resampler low pass filter with " << taps.size() << " taps" << std::endl; + fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps); + #ifdef GR_GREATER_38 resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); #else @@ -96,18 +107,17 @@ MmseResamplerConditioner::MmseResamplerConditioner( MmseResamplerConditioner::~MmseResamplerConditioner() {} - - void MmseResamplerConditioner::connect(gr::top_block_sptr top_block) { if (dump_) { + top_block->connect(fir_filter_ccf_, 0, resampler_, 0); top_block->connect(resampler_, 0, file_sink_, 0); DLOG(INFO) << "connected resampler to file sink"; } else { - DLOG(INFO) << "nothing to connect internally"; + top_block->connect(fir_filter_ccf_, 0, resampler_, 0); } } @@ -116,14 +126,19 @@ void MmseResamplerConditioner::disconnect(gr::top_block_sptr top_block) { if (dump_) { + top_block->disconnect(fir_filter_ccf_, 0, resampler_, 0); top_block->disconnect(resampler_, 0, file_sink_, 0); } + else + { + top_block->disconnect(fir_filter_ccf_, 0, resampler_, 0); + } } gr::basic_block_sptr MmseResamplerConditioner::get_left_block() { - return resampler_; + return fir_filter_ccf_; } diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h index b5c20c846..462e49e88 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h @@ -36,9 +36,13 @@ #include "gnss_block_interface.h" #ifdef GR_GREATER_38 #include +#include #else #include +#include #endif + +#include #include class ConfigurationInterface; @@ -91,6 +95,7 @@ private: #else gr::filter::fractional_resampler_cc::sptr resampler_; #endif + gr::filter::fir_filter_ccf::sptr fir_filter_ccf_; gr::block_sptr file_sink_; };