mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 14:55:29 +00:00
Adding_WFM_AM_mode_to_Audio_App (#2644)
* Adding_WFM_AM_mode_to_Audio_App * more precise values for cos and sin theta, fix sen_theta to sin_theta * fix sen_theta to sin_theta
This commit is contained in:
@@ -1325,6 +1325,128 @@ constexpr fir_taps_real<16> taps_40k_wfm_decim_1 = {
|
||||
}},
|
||||
};
|
||||
|
||||
// WFMAM decimation filters ////////////////////////////////////////////////
|
||||
// Used for NOAA 137 Mhz APT sat demod.
|
||||
// IFIR prototype filter: fs=768000, pass=42000, stop=95000, decim=8, fout=96000
|
||||
constexpr fir_taps_real<32> taps_84k_wfmam_decim_1 = {
|
||||
.low_frequency_normalized = -42000.0f / 768000.0f,
|
||||
.high_frequency_normalized = 42000.0f / 768000.0f,
|
||||
.transition_normalized = 53000.0f / 768000.0f,
|
||||
.taps = {{
|
||||
13,
|
||||
-6,
|
||||
-47,
|
||||
-116,
|
||||
-207,
|
||||
-294,
|
||||
-332,
|
||||
-266,
|
||||
-39,
|
||||
386,
|
||||
1012,
|
||||
1795,
|
||||
2648,
|
||||
3452,
|
||||
4079,
|
||||
4423,
|
||||
4423,
|
||||
4079,
|
||||
3452,
|
||||
2648,
|
||||
1795,
|
||||
1012,
|
||||
386,
|
||||
-39,
|
||||
-266,
|
||||
-332,
|
||||
-294,
|
||||
-207,
|
||||
-116,
|
||||
-47,
|
||||
-6,
|
||||
13,
|
||||
}},
|
||||
};
|
||||
|
||||
/* 1st Wideband FM demod baseband filter of audio AM tones ,
|
||||
to pass all DSB band of AM fsubcarrier 2.4Khz mod. with APT */
|
||||
/* 24kHz int16_t input
|
||||
* -> FIR filter, <4.5kHz (0.1875fs) pass, >5.2kHz (0.2166fs) stop
|
||||
* -> 12kHz int16_t output, gain of 1.0 (I think).
|
||||
* sum(abs(taps)): 125152 , before <125270>, very similar.
|
||||
*/
|
||||
constexpr fir_taps_real<64> taps_64_lp_1875_2166{
|
||||
.low_frequency_normalized = -0.1875f,
|
||||
.high_frequency_normalized = 0.1875f,
|
||||
.transition_normalized = 0.03f,
|
||||
.taps = {{
|
||||
38,
|
||||
-21,
|
||||
-51,
|
||||
-9,
|
||||
77,
|
||||
82,
|
||||
-50,
|
||||
-168,
|
||||
-67,
|
||||
190,
|
||||
253,
|
||||
-61,
|
||||
-403,
|
||||
-243,
|
||||
356,
|
||||
616,
|
||||
15,
|
||||
-814,
|
||||
-671,
|
||||
550,
|
||||
1335,
|
||||
334,
|
||||
-1527,
|
||||
-1689,
|
||||
725,
|
||||
2978,
|
||||
1455,
|
||||
-3277,
|
||||
-5361,
|
||||
830,
|
||||
13781,
|
||||
24549,
|
||||
24549,
|
||||
13781,
|
||||
830,
|
||||
-5361,
|
||||
-3277,
|
||||
1455,
|
||||
2978,
|
||||
725,
|
||||
-1689,
|
||||
-1527,
|
||||
334,
|
||||
1335,
|
||||
550,
|
||||
-671,
|
||||
-814,
|
||||
15,
|
||||
616,
|
||||
356,
|
||||
-243,
|
||||
-403,
|
||||
-61,
|
||||
253,
|
||||
190,
|
||||
-67,
|
||||
-168,
|
||||
-50,
|
||||
82,
|
||||
77,
|
||||
-9,
|
||||
-51,
|
||||
-21,
|
||||
38,
|
||||
}},
|
||||
};
|
||||
|
||||
// TPMS decimation filters ////////////////////////////////////////////////
|
||||
|
||||
// IFIR image-reject filter: fs=2457600, pass=100000, stop=407200, decim=4, fout=614400
|
||||
|
@@ -56,8 +56,8 @@ constexpr iir_biquad_config_t audio_12k_hpf_300hz_config{
|
||||
{1.00000000f, -1.77863178f, 0.80080265f}};
|
||||
|
||||
// scipy.signal.butter(2, 1500 / 6000.0, 'low', analog=False)
|
||||
constexpr iir_biquad_config_t audio_12k_lpf_1500hz_config{
|
||||
// Added to lpf the audio in wefax mode , before sending to SD card or spk.
|
||||
constexpr iir_biquad_config_t apt_audio_12k_lpf_1500hz_config{
|
||||
// Added to lpf the apt audio in wefax mode , before sending to SD card or spk.
|
||||
{0.09763107f, 0.19526215f, 0.09763107f},
|
||||
{1.00000000f, -0.94280904f, 0.33333333f}};
|
||||
|
||||
@@ -108,4 +108,15 @@ constexpr iir_biquad_config_t audio_48k_deemph_2122_6_config{
|
||||
{0.12264116f, 0.12264116f, 0.00000000f},
|
||||
{1.00000000f, -0.75471767f, 0.00000000f}};
|
||||
|
||||
// scipy.signal.iirnotch(f0, Q, fs) = signal.iirnotch(2400, 15, 12000)
|
||||
constexpr iir_biquad_config_t apt_audio_12k_notch_2k4_config{
|
||||
{0.95977357f, -0.59317269f, 0.95977357f},
|
||||
{1.00000000f, -0.59317269f, 0.91954714f}};
|
||||
|
||||
// scipy.signal.butter(2, 2000 / 6000.0, 'low', analog=False)
|
||||
constexpr iir_biquad_config_t apt_audio_12k_lpf_2000hz_config{
|
||||
// Added to lpf the apt audio in NOAA mode , before sending to SD card or spk.
|
||||
{0.15505103f, 0.31010205f, 0.15505103f},
|
||||
{1.00000000f, -0.6202041f, 0.24040821f}};
|
||||
|
||||
#endif /*__DSP_IIR_CONFIG_H__*/
|
||||
|
@@ -130,7 +130,7 @@ class Message {
|
||||
WeFaxRxConfigure = 73,
|
||||
WeFaxRxStatusData = 74,
|
||||
WeFaxRxImageData = 75,
|
||||
|
||||
WFMAMConfigure = 76,
|
||||
MAX
|
||||
};
|
||||
|
||||
@@ -584,6 +584,32 @@ class WFMConfigureMessage : public Message {
|
||||
const iir_biquad_config_t audio_deemph_config;
|
||||
};
|
||||
|
||||
class WFMAMConfigureMessage : public Message {
|
||||
public:
|
||||
constexpr WFMAMConfigureMessage(
|
||||
const fir_taps_real<24> decim_0_filter,
|
||||
const fir_taps_real<32> decim_1_filter,
|
||||
const fir_taps_real<64> audio_filter,
|
||||
const size_t deviation,
|
||||
const iir_biquad_config_t audio_hpf_config,
|
||||
const iir_biquad_config_t audio_deemph_config)
|
||||
: Message{ID::WFMAMConfigure},
|
||||
decim_0_filter(decim_0_filter),
|
||||
decim_1_filter(decim_1_filter),
|
||||
audio_filter(audio_filter),
|
||||
deviation{deviation},
|
||||
audio_hpf_config(audio_hpf_config),
|
||||
audio_deemph_config(audio_deemph_config) {
|
||||
}
|
||||
|
||||
const fir_taps_real<24> decim_0_filter;
|
||||
const fir_taps_real<32> decim_1_filter;
|
||||
const fir_taps_real<64> audio_filter;
|
||||
const size_t deviation;
|
||||
const iir_biquad_config_t audio_hpf_config;
|
||||
const iir_biquad_config_t audio_deemph_config;
|
||||
};
|
||||
|
||||
class AMConfigureMessage : public Message {
|
||||
public:
|
||||
enum class Modulation : int32_t {
|
||||
|
Reference in New Issue
Block a user