diff --git a/firmware/application/analog_audio_app.cpp b/firmware/application/analog_audio_app.cpp index a820dc62..affcdcd9 100644 --- a/firmware/application/analog_audio_app.cpp +++ b/firmware/application/analog_audio_app.cpp @@ -103,7 +103,6 @@ void AnalogAudioModel::configure_am() { taps_6k0_decim_0, taps_6k0_decim_1, taps_6k0_channel, - 4, audio_12k_hpf_300hz_config }; shared_memory.baseband_queue.push(message); diff --git a/firmware/baseband/proc_am_audio.cpp b/firmware/baseband/proc_am_audio.cpp index c522eb6d..9d8a2341 100644 --- a/firmware/baseband/proc_am_audio.cpp +++ b/firmware/baseband/proc_am_audio.cpp @@ -66,11 +66,11 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) { constexpr size_t decim_1_output_fs = decim_1_input_fs / decim_1.decimation_factor; constexpr size_t channel_filter_input_fs = decim_1_output_fs; - const size_t channel_filter_output_fs = channel_filter_input_fs / message.channel_decimation; + const size_t channel_filter_output_fs = channel_filter_input_fs / channel_filter_decimation_factor; decim_0.configure(message.decim_0_filter.taps, 33554432); decim_1.configure(message.decim_1_filter.taps, 131072); - channel_filter.configure(message.channel_filter.taps, message.channel_decimation); + channel_filter.configure(message.channel_filter.taps, channel_filter_decimation_factor); channel_filter_pass_f = message.channel_filter.pass_frequency_normalized * channel_filter_input_fs; channel_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs; channel_spectrum.set_decimation_factor(std::floor((channel_filter_output_fs / 2) / ((channel_filter_pass_f + channel_filter_stop_f) / 2))); diff --git a/firmware/baseband/proc_am_audio.hpp b/firmware/baseband/proc_am_audio.hpp index 43ec8c97..569b5a1d 100644 --- a/firmware/baseband/proc_am_audio.hpp +++ b/firmware/baseband/proc_am_audio.hpp @@ -40,6 +40,8 @@ public: private: static constexpr size_t baseband_fs = 3072000; + static constexpr size_t decim_2_decimation_factor = 4; + static constexpr size_t channel_filter_decimation_factor = 1; std::array dst; const buffer_c16_t dst_buffer { diff --git a/firmware/common/message.hpp b/firmware/common/message.hpp index 1f902af0..1ee92fd5 100644 --- a/firmware/common/message.hpp +++ b/firmware/common/message.hpp @@ -377,13 +377,11 @@ public: const fir_taps_real<24> decim_0_filter, const fir_taps_real<32> decim_1_filter, const fir_taps_real<32> channel_filter, - const size_t channel_decimation, const iir_biquad_config_t audio_hpf_config ) : Message { ID::AMConfigure }, decim_0_filter(decim_0_filter), decim_1_filter(decim_1_filter), channel_filter(channel_filter), - channel_decimation { channel_decimation }, audio_hpf_config { audio_hpf_config } { } @@ -391,7 +389,6 @@ public: const fir_taps_real<24> decim_0_filter; const fir_taps_real<32> decim_1_filter; const fir_taps_real<32> channel_filter; - const size_t channel_decimation; const iir_biquad_config_t audio_hpf_config; };