Skip to content

Commit 72145d9

Browse files
committed
Fixed signal shift.
1 parent f357de1 commit 72145d9

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

sources/radio/recorder.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,12 @@ constexpr auto LABEL = "recorder";
2323
// https://github.com/gqrx-sdr/gqrx/blob/master/src/applications/gqrx/receiver.cpp
2424

2525
Block buildDecimator(Frequency sampleRate, Frequency shift, int decim) {
26-
if (1 < decim) {
27-
const auto filter = gr::filter::freq_xlating_fir_filter_ccf::make(decim, {1}, 0.0, sampleRate);
28-
const auto outRate = sampleRate / decim;
29-
const auto lpf_cutoff = 120e3;
30-
filter->set_center_freq(shift);
31-
filter->set_taps(gr::filter::firdes::low_pass(1.0, sampleRate, lpf_cutoff, outRate - 2 * lpf_cutoff, gr::fft::window::WIN_BLACKMAN_HARRIS));
32-
return filter;
33-
} else {
34-
auto shiftBlock = gr::blocks::rotator_cc::make();
35-
shiftBlock->set_phase_inc(2.0l * M_PIl * (static_cast<double>(shift) / static_cast<float>(sampleRate)));
36-
return shiftBlock;
37-
}
26+
const auto filter = gr::filter::freq_xlating_fir_filter_ccf::make(decim, {1}, 0.0, sampleRate);
27+
const auto outRate = sampleRate / decim;
28+
const auto lpf_cutoff = 120e3;
29+
filter->set_center_freq(shift);
30+
filter->set_taps(gr::filter::firdes::low_pass(1.0, sampleRate, lpf_cutoff, outRate - 2 * lpf_cutoff, gr::fft::window::WIN_BLACKMAN_HARRIS));
31+
return filter;
3832
}
3933

4034
Block buildResampler(Frequency inputRate, Frequency outputRate) {

0 commit comments

Comments
 (0)