Skip to content

Commit

Permalink
real SAM demodulation df8oe#2
Browse files Browse the repository at this point in the history
  • Loading branch information
DD4WH committed Dec 31, 2016
1 parent f56e97b commit 25b7d2b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
9 changes: 4 additions & 5 deletions mchf-eclipse/drivers/audio/audio_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ void AudioDriver_Init(void)
// DX = 0.2, 70
// medium 0.6, 200
// fast 1.0, 500
ads.zeta = 0.4; // 0.01;// 0.001; // 0.1; //0.65; // PLL step response: smaller, slower response 1.0 - 0.1
ads.omegaN = 200.0; //200.0; // PLL bandwidth 50.0 - 1000.0
ads.zeta = 0.8; // 0.01;// 0.001; // 0.1; //0.65; // PLL step response: smaller, slower response 1.0 - 0.1
ads.omegaN = 250.0; //200.0; // PLL bandwidth 50.0 - 1000.0

//pll
ads.omega_min = (2.0 * PI * ads.pll_fmin * ads.DF / IQ_SAMPLE_RATE_F); //-0.5235987756; //
Expand Down Expand Up @@ -2891,11 +2891,10 @@ static void AudioDriver_RxProcessor(AudioSample_t * const src, AudioSample_t * c
// which case there is ***NO*** audio phase shift applied to the I/Q channels.
//
//
if(ts.dmod_mode != DEMOD_SAM)
{

arm_fir_f32(&FIR_I,adb.i_buffer, adb.i_buffer,blockSize); // in AM: lowpass filter, in other modes: Hilbert lowpass 0 degrees
arm_fir_f32(&FIR_Q,adb.q_buffer, adb.q_buffer,blockSize); // in AM: lowpass filter, in other modes: Hilbert lowpass -90 degrees
}


switch(dmod_mode)
{
Expand Down
26 changes: 17 additions & 9 deletions mchf-eclipse/drivers/audio/audio_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,13 @@ const FilterPathDescriptor FilterPathInfo[AUDIO_FILTER_PATH_NUM] =
},

{
AUDIO_2P1KHZ, "AM", FILTER_MASK_AM, 1, Q_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_2k3_coeffs, &FirRxDecimate,
AUDIO_2P1KHZ, "AM", FILTER_MASK_AM, 1, Q_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_3k6_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_3k6_LPF,
&FirRxInterpolate_4_5k, &IIR_aa_5k
},

{
AUDIO_2P3KHZ, "AM", FILTER_MASK_AM, 1, Q_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_2k3_coeffs, &FirRxDecimate,
AUDIO_2P3KHZ, "AM", FILTER_MASK_AM, 1, Q_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_3k6_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_4k2_LPF,
&FirRxInterpolate_4_5k, &IIR_aa_5k
},
Expand Down Expand Up @@ -713,25 +713,33 @@ const FilterPathDescriptor FilterPathInfo[AUDIO_FILTER_PATH_NUM] =


{
AUDIO_1P8KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, i_rx_3k6_coeffs, q_rx_3k6_coeffs, &FirRxDecimate,
AUDIO_1P8KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_3k6_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_1k8_LPF,
&FirRxInterpolate, NULL
},

{
AUDIO_2P3KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, i_rx_3k6_coeffs, q_rx_3k6_coeffs, &FirRxDecimate,
AUDIO_2P3KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_3k6_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_2k3_LPF,
&FirRxInterpolate, NULL
},

/*
AUDIO_2P5KHZ, "AM", FILTER_MASK_AM, 1, Q_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_3k6_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_4k6_LPF,
&FirRxInterpolate_4_5k, &IIR_aa_5k
*/


{
AUDIO_2P9KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, i_rx_3k6_coeffs, q_rx_3k6_coeffs, &FirRxDecimate,
AUDIO_2P9KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_3k6_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_2k9_LPF,
&FirRxInterpolate, NULL
},

{
AUDIO_3P4KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, i_rx_3k6_coeffs, q_rx_3k6_coeffs, &FirRxDecimate,
AUDIO_3P4KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, iq_rx_am_3k6_coeffs, iq_rx_am_3k6_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_3k4_LPF,
&FirRxInterpolate, NULL
},
Expand All @@ -740,19 +748,19 @@ const FilterPathDescriptor FilterPathInfo[AUDIO_FILTER_PATH_NUM] =
// now I have implemented the IIR_aa_5k antialiasing filter in SAM 4k2 and 4k8 filters and all the aliases
// are down by at least 60dB below signal level
{
AUDIO_4P2KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, i_rx_4k5_coeffs, q_rx_4k5_coeffs, &FirRxDecimate,
AUDIO_4P2KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, iq_rx_am_4k5_coeffs, iq_rx_am_4k5_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_4k2_LPF,
&FirRxInterpolate_4_5k, &IIR_aa_5k
},

{
AUDIO_4P8KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, i_rx_5k_coeffs, q_rx_5k_coeffs, &FirRxDecimate,
AUDIO_4P8KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, iq_rx_am_5k_coeffs, iq_rx_am_5k_coeffs, &FirRxDecimate,
RX_DECIMATION_RATE_12KHZ, &IIR_4k8_LPF,
&FirRxInterpolate_4_5k, &IIR_aa_5k
},

{
AUDIO_7P5KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, i_rx_7k5_coeffs, q_rx_7k5_coeffs, &FirRxDecimateMinLPF,
AUDIO_7P5KHZ, "SAM", FILTER_MASK_SAM, 1, I_NUM_TAPS, iq_rx_am_7k5_coeffs, iq_rx_am_7k5_coeffs, &FirRxDecimateMinLPF,
RX_DECIMATION_RATE_24KHZ, NULL,
&FirRxInterpolate10KHZ, NULL
}
Expand Down

0 comments on commit 25b7d2b

Please sign in to comment.