mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-14 12:08:40 +00:00
Waterfall in AM/NFM Audio mode extended to 48kHz
This commit is contained in:
parent
c626d83c3b
commit
4bc360d652
@ -34,12 +34,14 @@ void NarrowbandAMAudio::execute(const buffer_c8_t& buffer) {
|
|||||||
|
|
||||||
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
||||||
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
||||||
|
|
||||||
|
channel_spectrum.feed(decim_1_out, channel_filter_pass_f, channel_filter_stop_f);
|
||||||
|
|
||||||
const auto decim_2_out = decim_2.execute(decim_1_out, dst_buffer);
|
const auto decim_2_out = decim_2.execute(decim_1_out, dst_buffer);
|
||||||
const auto channel_out = channel_filter.execute(decim_2_out, dst_buffer);
|
const auto channel_out = channel_filter.execute(decim_2_out, dst_buffer);
|
||||||
|
|
||||||
// TODO: Feed channel_stats post-decimation data?
|
// TODO: Feed channel_stats post-decimation data?
|
||||||
feed_channel_stats(channel_out);
|
feed_channel_stats(channel_out);
|
||||||
channel_spectrum.feed(channel_out, channel_filter_pass_f, channel_filter_stop_f);
|
|
||||||
|
|
||||||
auto audio = demodulate(channel_out);
|
auto audio = demodulate(channel_out);
|
||||||
audio_compressor.execute_in_place(audio);
|
audio_compressor.execute_in_place(audio);
|
||||||
@ -93,7 +95,7 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) {
|
|||||||
channel_filter.configure(message.channel_filter.taps, channel_filter_decimation_factor);
|
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_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_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs;
|
||||||
channel_spectrum.set_decimation_factor(std::floor(channel_filter_output_fs / (channel_filter_pass_f + channel_filter_stop_f)));
|
channel_spectrum.set_decimation_factor(1.0f);
|
||||||
modulation_ssb = (message.modulation == AMConfigureMessage::Modulation::SSB);
|
modulation_ssb = (message.modulation == AMConfigureMessage::Modulation::SSB);
|
||||||
audio_output.configure(message.audio_hpf_config);
|
audio_output.configure(message.audio_hpf_config);
|
||||||
|
|
||||||
|
@ -38,10 +38,12 @@ void NarrowbandFMAudio::execute(const buffer_c8_t& buffer) {
|
|||||||
|
|
||||||
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
||||||
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
||||||
|
|
||||||
|
channel_spectrum.feed(decim_1_out, channel_filter_pass_f, channel_filter_stop_f);
|
||||||
|
|
||||||
const auto channel_out = channel_filter.execute(decim_1_out, dst_buffer);
|
const auto channel_out = channel_filter.execute(decim_1_out, dst_buffer);
|
||||||
|
|
||||||
feed_channel_stats(channel_out);
|
feed_channel_stats(channel_out);
|
||||||
channel_spectrum.feed(channel_out, channel_filter_pass_f, channel_filter_stop_f);
|
|
||||||
|
|
||||||
if (!pitch_rssi_enabled) {
|
if (!pitch_rssi_enabled) {
|
||||||
// Normal mode, output demodulated audio
|
// Normal mode, output demodulated audio
|
||||||
@ -145,7 +147,7 @@ void NarrowbandFMAudio::configure(const NBFMConfigureMessage& message) {
|
|||||||
demod.configure(demod_input_fs, message.deviation);
|
demod.configure(demod_input_fs, message.deviation);
|
||||||
channel_filter_pass_f = message.channel_filter.pass_frequency_normalized * channel_filter_input_fs;
|
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_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs;
|
||||||
channel_spectrum.set_decimation_factor(std::floor(channel_filter_output_fs / (channel_filter_pass_f + channel_filter_stop_f)));
|
channel_spectrum.set_decimation_factor(1.0f);
|
||||||
audio_output.configure(message.audio_hpf_config, message.audio_deemph_config, (float)message.squelch_level / 100.0);
|
audio_output.configure(message.audio_hpf_config, message.audio_deemph_config, (float)message.squelch_level / 100.0);
|
||||||
|
|
||||||
hpf.configure(audio_24k_hpf_30hz_config);
|
hpf.configure(audio_24k_hpf_30hz_config);
|
||||||
|
Loading…
Reference in New Issue
Block a user