From de115a043c5dd60cfcad75b06f2f5b5aa2a7be95 Mon Sep 17 00:00:00 2001 From: ArjanteMarvelde Date: Thu, 14 Jul 2022 21:57:21 +0200 Subject: [PATCH] V3.02 --- README.md | 2 +- dsp.c | 5 +++-- dsp_fft.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 48cdff1..fc24f51 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The display is a standard 16x2 LCD, but with an I2C interface. The display is co ## Open issues: - [ ] implement proper AGC - [x] implement RSSI and S-meter -- [ ] improve FFT-based signal processing +- [x] improve FFT-based signal processing - [ ] revisit Si5351A driver ## Installing and using the SDK for Windows: diff --git a/dsp.c b/dsp.c index 10ed283..dd8d5ff 100644 --- a/dsp.c +++ b/dsp.c @@ -217,10 +217,10 @@ volatile int32_t q_sample, i_sample, a_sample; // Latest processed sample /*** Include the desired DSP engine ***/ #if DSP_FFT == 1 -#define AGC_TOP 16383L +#define AGC_TOP 2047L #include "dsp_fft.c" #else -#define AGC_TOP 1500L +#define AGC_TOP 2047L #include "dsp_tim.c" #endif @@ -345,6 +345,7 @@ bool __not_in_flash_func(dsp_callback)(repeating_timer_t *t) temp = (MAX(q,((29*q/32) + (61*i/128))))>>LSH; s_rssi = MAX(1,temp); rx_agc = AGC_TOP/s_rssi; // calculate required AGC factor + if (rx_agc==0) rx_agc=1; } #if DSP_FFT == 1 diff --git a/dsp_fft.c b/dsp_fft.c index 3e396d8..3bdd1f8 100644 --- a/dsp_fft.c +++ b/dsp_fft.c @@ -253,7 +253,7 @@ bool __not_in_flash_func(rx)(void) /*** Scale down into DAC_RANGE! ***/ - peak = 128; + peak = 256; for (i=0; i