From d732b1cb905bc0a4199c83d4508cafe9e8521d9d Mon Sep 17 00:00:00 2001 From: drowe67 Date: Tue, 24 Apr 2018 03:38:46 +0000 Subject: [PATCH] fixed bug in amplitude estimator that improved LDPC dec perf - C code git-svn-id: https://svn.code.sf.net/p/freetel/code@3522 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/src/freedv_api.c | 1 + codec2-dev/src/ofdm.c | 4 ++-- codec2-dev/src/ofdm_demod.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/codec2-dev/src/freedv_api.c b/codec2-dev/src/freedv_api.c index 2f65dc0a..eb21a47f 100644 --- a/codec2-dev/src/freedv_api.c +++ b/codec2-dev/src/freedv_api.c @@ -1561,6 +1561,7 @@ static int freedv_comprx_700(struct freedv *f, COMP demod_in_8kHz[], int *valid) [ ] error pattern support? [ ] work out how to handle return of multiple interleaved frames over time [ ] deal with out of sync returning nin samples, listening to analog audio when out of sync + [ ] level issues */ #define ASCALE (2E5*1.1491/2.0) /* scale from shorts back to floats */ diff --git a/codec2-dev/src/ofdm.c b/codec2-dev/src/ofdm.c index d3352c34..7ee14b1a 100644 --- a/codec2-dev/src/ofdm.c +++ b/codec2-dev/src/ofdm.c @@ -874,9 +874,9 @@ void ofdm_demod(struct OFDM *ofdm, int *rx_bits, COMP *rxbuf_in) { aphase_est_pilot_rect = aphase_est_pilot_rect + vector_sum(symbol, 3); aphase_est_pilot[i] = cargf(aphase_est_pilot_rect); - /* TODO David: WTF 12.0 constant? Something to do with LDPC input scaling? */ + /* amplitude is estimated over 6 rows of pilots */ - aamp_est_pilot[i] = cabsf(aphase_est_pilot_rect / 12.0f); + aamp_est_pilot[i] = cabsf(aphase_est_pilot_rect / 6.0f); } /* diff --git a/codec2-dev/src/ofdm_demod.c b/codec2-dev/src/ofdm_demod.c index a9cc81e6..3c00cad0 100644 --- a/codec2-dev/src/ofdm_demod.c +++ b/codec2-dev/src/ofdm_demod.c @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) int rx_uw[OFDM_NUWBITS]; f = 0; Nerrs = Terrs = Tbits = Terrs2 = Tbits2 = Terrs_coded = Tbits_coded = frame_count = 0; - float EsNo = 10; + float EsNo = 3; fprintf(stderr,"Warning EsNo: %f hard coded\n", EsNo); COMP codeword_symbols[interleave_frames*coded_syms_per_frame]; -- 2.25.1