From f03d8ec69e0fedfb608412f6385f2152bc86c1b0 Mon Sep 17 00:00:00 2001 From: okcsampson Date: Fri, 16 Jun 2017 10:27:51 +0000 Subject: [PATCH] Add request to ofdm.c git-svn-id: https://svn.code.sf.net/p/freetel/code@3200 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/src/codec2_ofdm.h | 13 +++++++------ codec2-dev/src/ofdm.c | 23 +++++++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/codec2-dev/src/codec2_ofdm.h b/codec2-dev/src/codec2_ofdm.h index f5d9700f..11265bdd 100644 --- a/codec2-dev/src/codec2_ofdm.h +++ b/codec2-dev/src/codec2_ofdm.h @@ -49,15 +49,16 @@ struct OFDM *ofdm_create(void); void ofdm_destroy(struct OFDM *); void ofdm_mod(struct OFDM *, COMP *, const int *); void ofdm_demod(struct OFDM *, int *, COMP *); +int ofdm_get_nin(struct OFDM *); /* option setters */ -void set_verbose(struct OFDM *, int); -void set_timing_enable(struct OFDM *, bool); -void set_foff_est_enable(struct OFDM *, bool); -void set_phase_est_enable(struct OFDM *, bool); -void set_foff_est_gain(struct OFDM *, float); -void set_off_est_hz(struct OFDM *, float); +void ofdm_set_verbose(struct OFDM *, int); +void ofdm_set_timing_enable(struct OFDM *, bool); +void ofdm_set_foff_est_enable(struct OFDM *, bool); +void ofdm_set_phase_est_enable(struct OFDM *, bool); +void ofdm_set_foff_est_gain(struct OFDM *, float); +void ofdm_set_off_est_hz(struct OFDM *, float); #ifdef __cplusplus } diff --git a/codec2-dev/src/ofdm.c b/codec2-dev/src/ofdm.c index 13dfbe1a..23e676c8 100644 --- a/codec2-dev/src/ofdm.c +++ b/codec2-dev/src/ofdm.c @@ -304,6 +304,13 @@ struct OFDM *ofdm_create() { } } + + for (i = 0; i < (OFDM_NS + 3); i++) { + for (j = 0; j < (OFDM_NC + 2); j++) { + ofdm->rx_sym[i][j] = 0.0f + 0.0f * I; + } + } + /* default settings of options and states */ ofdm->verbose = 0; @@ -345,27 +352,31 @@ struct OFDM *ofdm_create() { void ofdm_destroy(struct OFDM *ofdm) { } -void set_verbose(struct OFDM *ofdm, int level) { +int ofdm_get_nin(struct OFDM *ofdm) { + return ofdm->nin; +} + +void ofdm_set_verbose(struct OFDM *ofdm, int level) { ofdm->verbose = level; } -void set_timing_enable(struct OFDM *ofdm, bool val) { +void ofdm_set_timing_enable(struct OFDM *ofdm, bool val) { ofdm->timing_en = val; } -void set_foff_est_enable(struct OFDM *ofdm, bool val) { +void ofdm_set_foff_est_enable(struct OFDM *ofdm, bool val) { ofdm->foff_est_en = val; } -void set_phase_est_enable(struct OFDM *ofdm, bool val) { +void ofdm_set_phase_est_enable(struct OFDM *ofdm, bool val) { ofdm->phase_est_en = val; } -void set_foff_est_gain(struct OFDM *ofdm, float val) { +void ofdm_set_foff_est_gain(struct OFDM *ofdm, float val) { ofdm->foff_est_gain = val; } -void set_off_est_hz(struct OFDM *ofdm, float val) { +void ofdm_set_off_est_hz(struct OFDM *ofdm, float val) { ofdm->foff_est_hz = val; } -- 2.25.1