mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-12-15 15:59:39 -05:00
Adding Wefax demodulation mode inside Audio App (#2539)
* Adding_new_WFAX_GUI_mode_Audio_App * Wefax_APT_demodulation_structure * Solving REC Apt signal.wav from WFAX * clang format issues * correcting comments
This commit is contained in:
parent
b6e498a6d3
commit
52c3760e90
19 changed files with 383 additions and 55 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include "event_m4.hpp"
|
||||
|
||||
#include <array>
|
||||
#include "dsp_hilbert.hpp"
|
||||
|
||||
void NarrowbandAMAudio::execute(const buffer_c8_t& buffer) {
|
||||
if (!configured) {
|
||||
|
|
@ -44,16 +45,28 @@ void NarrowbandAMAudio::execute(const buffer_c8_t& buffer) {
|
|||
// TODO: Feed channel_stats post-decimation data?
|
||||
feed_channel_stats(channel_out);
|
||||
|
||||
auto audio = demodulate(channel_out);
|
||||
auto audio = demodulate(channel_out); // now 3 AM demodulation types : demod_am, demod_ssb, demod_ssb_fm (for Wefax)
|
||||
audio_compressor.execute_in_place(audio);
|
||||
audio_output.write(audio);
|
||||
}
|
||||
|
||||
buffer_f32_t NarrowbandAMAudio::demodulate(const buffer_c16_t& channel) {
|
||||
if (modulation_ssb) {
|
||||
return demod_ssb.execute(channel, audio_buffer);
|
||||
} else {
|
||||
return demod_am.execute(channel, audio_buffer);
|
||||
switch (modulation_ssb) { // enum class Modulation : int32_t {DSB = 0, SSB = 1, SSB_FM = 2}
|
||||
case (int)(AMConfigureMessage::Modulation::DSB):
|
||||
return demod_am.execute(channel, audio_buffer);
|
||||
break;
|
||||
|
||||
case (int)(AMConfigureMessage::Modulation::SSB):
|
||||
return demod_ssb.execute(channel, audio_buffer);
|
||||
break;
|
||||
|
||||
case (int)(AMConfigureMessage::Modulation::SSB_FM): // Added to handle Weather Fax mode.
|
||||
// chDbgPanic("case SSB_FM demodulation"); // Debug.
|
||||
return demod_ssb_fm.execute(channel, audio_buffer); // Calling a derivative of demod_ssb (USB) , but with different FIR taps + FM audio tones demod.
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -98,8 +111,9 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) {
|
|||
channel_filter_high_f = message.channel_filter.high_frequency_normalized * channel_filter_input_fs;
|
||||
channel_filter_transition = message.channel_filter.transition_normalized * channel_filter_input_fs;
|
||||
channel_spectrum.set_decimation_factor(1.0f);
|
||||
modulation_ssb = (message.modulation == AMConfigureMessage::Modulation::SSB);
|
||||
audio_output.configure(message.audio_hpf_config);
|
||||
// modulation_ssb = (message.modulation == AMConfigureMessage::Modulation::SSB); // originally we had just 2 AM types of demod. (DSB , SSB)
|
||||
modulation_ssb = (int)message.modulation; // now sending by message , 3 types of AM demod : enum class Modulation : int32_t {DSB = 0, SSB = 1, SSB_FM = 2}
|
||||
audio_output.configure(message.audio_hpf_lpf_config); // hpf in all AM demod modes (AM-6K/9K, USB/LSB,DSB), except Wefax (lpf there).
|
||||
|
||||
configured = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue