Change NBFM audio fs->24k, AM ->12k.

Send channel decimation factor from application to baseband.
This commit is contained in:
Jared Boone 2016-01-29 19:23:30 -08:00
parent 65d224be14
commit aead1d8798
6 changed files with 18 additions and 14 deletions

View File

@ -62,12 +62,13 @@ void AnalogAudioModel::configure_nbfm() {
taps_4k25_decim_0,
taps_4k25_decim_1,
taps_4k25_channel,
2,
2500,
audio_16k_hpf_300hz_config,
audio_16k_deemph_300_6_config
audio_24k_hpf_300hz_config,
audio_24k_deemph_300_6_config
};
shared_memory.baseband_queue.push(message);
clock_manager.set_base_audio_clock_divider(3);
clock_manager.set_base_audio_clock_divider(2);
}
void AnalogAudioModel::configure_wfm() {
@ -88,8 +89,9 @@ void AnalogAudioModel::configure_am() {
taps_6k0_decim_0,
taps_6k0_decim_1,
taps_6k0_channel,
audio_8k_hpf_300hz_config
4,
audio_12k_hpf_300hz_config
};
shared_memory.baseband_queue.push(message);
clock_manager.set_base_audio_clock_divider(6);
clock_manager.set_base_audio_clock_divider(4);
}

View File

@ -70,11 +70,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;
constexpr size_t channel_filter_output_fs = channel_filter_input_fs / channel_filter_decimation_factor;
const size_t channel_filter_output_fs = channel_filter_input_fs / message.channel_decimation;
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, channel_filter_decimation_factor);
channel_filter.configure(message.channel_filter.taps, message.channel_decimation);
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)));

View File

@ -40,8 +40,6 @@ public:
private:
static constexpr size_t baseband_fs = 3072000;
static constexpr size_t channel_filter_decimation_factor = 1;
static constexpr size_t post_channel_decimation_factor = 6;
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {

View File

@ -70,13 +70,13 @@ void NarrowbandFMAudio::configure(const NBFMConfigureMessage& 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;
constexpr size_t channel_filter_output_fs = channel_filter_input_fs / channel_filter_decimation_factor;
const size_t channel_filter_output_fs = channel_filter_input_fs / message.channel_decimation;
constexpr size_t demod_input_fs = channel_filter_output_fs / post_channel_decimation_factor;
const size_t demod_input_fs = channel_filter_output_fs;
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, channel_filter_decimation_factor);
channel_filter.configure(message.channel_filter.taps, message.channel_decimation);
demod.configure(demod_input_fs, message.deviation);
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;

View File

@ -40,8 +40,6 @@ public:
private:
static constexpr size_t baseband_fs = 3072000;
static constexpr size_t channel_filter_decimation_factor = 1;
static constexpr size_t post_channel_decimation_factor = 3;
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {

View File

@ -320,6 +320,7 @@ 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 size_t deviation,
const iir_biquad_config_t audio_hpf_config,
const iir_biquad_config_t audio_deemph_config
@ -327,6 +328,7 @@ public:
decim_0_filter(decim_0_filter),
decim_1_filter(decim_1_filter),
channel_filter(channel_filter),
channel_decimation { channel_decimation },
deviation { deviation },
audio_hpf_config { audio_hpf_config },
audio_deemph_config { audio_deemph_config }
@ -336,6 +338,7 @@ 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 size_t deviation;
const iir_biquad_config_t audio_hpf_config;
const iir_biquad_config_t audio_deemph_config;
@ -374,11 +377,13 @@ 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 }
{
}
@ -386,6 +391,7 @@ 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;
};