Change audio sampling rates on NBFM, AM modes.

This commit is contained in:
Jared Boone
2016-01-29 15:33:01 -08:00
parent 0e436ded14
commit db642cac8d
5 changed files with 32 additions and 15 deletions

View File

@@ -39,9 +39,12 @@ void NarrowbandAMAudio::execute(const buffer_c8_t& buffer) {
feed_channel_stats(channel_out);
channel_spectrum.feed(channel_out, channel_filter_pass_f, channel_filter_stop_f);
auto audio = demod.execute(channel_out, work_audio_buffer);
audio_output.write(audio);
channel_block_buffer.feed(
channel_out, [this](const buffer_c16_t buffer) {
auto audio = this->demod.execute(buffer, this->audio_buffer);
this->audio_output.write(audio);
}
);
}
void NarrowbandAMAudio::on_message(const Message* const message) {
@@ -81,7 +84,7 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) {
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)));
audio_output.configure(audio_hpf_300hz_config);
audio_output.configure(audio_8k_hpf_300hz_config);
configured = true;
}