mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-23 08:09:58 -05:00
Multiple AM modes selection in application API.
This commit is contained in:
parent
a1e1677b8b
commit
a97cd642ac
@ -48,7 +48,7 @@ AnalogAudioModel::AnalogAudioModel(ReceiverModel::Mode mode) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ReceiverModel::Mode::AMAudio:
|
case ReceiverModel::Mode::AMAudio:
|
||||||
configure_am();
|
configure_am(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -98,13 +98,25 @@ void AnalogAudioModel::configure_wfm() {
|
|||||||
clock_manager.set_base_audio_clock_divider(1);
|
clock_manager.set_base_audio_clock_divider(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalogAudioModel::configure_am() {
|
struct AMMode {
|
||||||
|
const fir_taps_complex<64> channel;
|
||||||
|
const AMConfigureMessage::Modulation modulation;
|
||||||
|
};
|
||||||
|
|
||||||
|
static constexpr std::array<AMMode, 3> am_mode_configs { {
|
||||||
|
{ taps_6k0_dsb_channel, AMConfigureMessage::Modulation::DSB },
|
||||||
|
{ taps_2k8_usb_channel, AMConfigureMessage::Modulation::SSB },
|
||||||
|
{ taps_2k8_lsb_channel, AMConfigureMessage::Modulation::SSB },
|
||||||
|
} };
|
||||||
|
|
||||||
|
void AnalogAudioModel::configure_am(const size_t index) {
|
||||||
|
const auto config = am_mode_configs[index];
|
||||||
const AMConfigureMessage message {
|
const AMConfigureMessage message {
|
||||||
taps_6k0_decim_0,
|
taps_6k0_decim_0,
|
||||||
taps_6k0_decim_1,
|
taps_6k0_decim_1,
|
||||||
taps_6k0_decim_2,
|
taps_6k0_decim_2,
|
||||||
taps_2k8_usb_channel,
|
config.channel,
|
||||||
AMConfigureMessage::Modulation::SSB,
|
config.modulation,
|
||||||
audio_12k_hpf_300hz_config
|
audio_12k_hpf_300hz_config
|
||||||
};
|
};
|
||||||
shared_memory.baseband_queue.push(message);
|
shared_memory.baseband_queue.push(message);
|
||||||
|
@ -32,7 +32,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void configure_nbfm(const size_t index);
|
void configure_nbfm(const size_t index);
|
||||||
void configure_wfm();
|
void configure_wfm();
|
||||||
void configure_am();
|
void configure_am(const size_t index);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
@ -189,6 +189,29 @@ constexpr fir_taps_real<32> taps_6k0_decim_2 {
|
|||||||
} },
|
} },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr fir_taps_complex<64> taps_6k0_dsb_channel {
|
||||||
|
.pass_frequency_normalized = 3000.0f / 12000.0f,
|
||||||
|
.stop_frequency_normalized = 3300.0f / 12000.0f,
|
||||||
|
.taps = { {
|
||||||
|
{ -70, 0 }, { -142, 0 }, { 121, 0 }, { 90, 0 },
|
||||||
|
{ -134, 0 }, { -136, 0 }, { 200, 0 }, { 170, 0 },
|
||||||
|
{ -278, 0 }, { -209, 0 }, { 378, 0 }, { 251, 0 },
|
||||||
|
{ -505, 0 }, { -294, 0 }, { 665, 0 }, { 336, 0 },
|
||||||
|
{ -868, 0 }, { -378, 0 }, { 1131, 0 }, { 417, 0 },
|
||||||
|
{ -1479, 0 }, { -453, 0 }, { 1965, 0 }, { 484, 0 },
|
||||||
|
{ -2698, 0 }, { -510, 0 }, { 3967, 0 }, { 528, 0 },
|
||||||
|
{ -6829, 0 }, { -540, 0 }, { 20819, 0 }, { 32767, 0 }, /* TODO: Saturated peak! Originally 33312. */
|
||||||
|
{ 20819, 0 }, { -540, 0 }, { -6829, 0 }, { 528, 0 },
|
||||||
|
{ 3967, 0 }, { -510, 0 }, { -2698, 0 }, { 484, 0 },
|
||||||
|
{ 1965, 0 }, { -453, 0 }, { -1479, 0 }, { 417, 0 },
|
||||||
|
{ 1131, 0 }, { -378, 0 }, { -868, 0 }, { 336, 0 },
|
||||||
|
{ 665, 0 }, { -294, 0 }, { -505, 0 }, { 251, 0 },
|
||||||
|
{ 378, 0 }, { -209, 0 }, { -278, 0 }, { 170, 0 },
|
||||||
|
{ 200, 0 }, { -136, 0 }, { -134, 0 }, { 90, 0 },
|
||||||
|
{ 121, 0 }, { -142, 0 }, { -70, 0 }, { 0, 0 },
|
||||||
|
} },
|
||||||
|
};
|
||||||
|
|
||||||
// USB AM 2K80J3E emission type ///////////////////////////////////////////
|
// USB AM 2K80J3E emission type ///////////////////////////////////////////
|
||||||
|
|
||||||
// IFIR prototype filter: fs=12000, pass=3000, stop=3300, decim=1, fout=12000
|
// IFIR prototype filter: fs=12000, pass=3000, stop=3300, decim=1, fout=12000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user