mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-22 03:02:39 +00:00
Change audio sampling rates on NBFM, AM modes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user