From db2d89a9275bea6f21b4250fabf928046c829af1 Mon Sep 17 00:00:00 2001 From: okcsampson Date: Mon, 12 Jun 2017 00:34:34 +0000 Subject: [PATCH] Add changes to ofdm.c for unit test git-svn-id: https://svn.code.sf.net/p/freetel/code@3177 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/src/codec2_ofdm.h | 2 +- codec2-dev/src/ofdm.c | 2 +- codec2-dev/src/test_bits_ofdm.h | 113 ++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 2 deletions(-) diff --git a/codec2-dev/src/codec2_ofdm.h b/codec2-dev/src/codec2_ofdm.h index 82713b1e..3da37355 100644 --- a/codec2-dev/src/codec2_ofdm.h +++ b/codec2-dev/src/codec2_ofdm.h @@ -29,7 +29,7 @@ struct OFDM; struct OFDM *ofdm_create(void); void ofdm_destroy(struct OFDM *); -void ofdm_mod(struct OFDM *ofdm, COMP [OFDM_SAMPLESPERFRAME], int *); +void ofdm_mod(struct OFDM *ofdm, COMP [OFDM_SAMPLESPERFRAME], const int *); int *ofdm_demod(struct OFDM *ofdm, COMP *); /* option setters */ diff --git a/codec2-dev/src/ofdm.c b/codec2-dev/src/ofdm.c index c01144ba..5cb26115 100644 --- a/codec2-dev/src/ofdm.c +++ b/codec2-dev/src/ofdm.c @@ -316,7 +316,7 @@ void set_off_est_hz(struct OFDM *ofdm, float val) { * -------------------------------------- */ -void ofdm_mod(struct OFDM *ofdm, COMP result[OFDM_SAMPLESPERFRAME], int *tx_bits) { +void ofdm_mod(struct OFDM *ofdm, COMP result[OFDM_SAMPLESPERFRAME], const int *tx_bits) { int length = OFDM_BITSPERFRAME / OFDM_BPS; complex float tx[OFDM_SAMPLESPERFRAME]; complex float tx_sym_lin[length]; diff --git a/codec2-dev/src/test_bits_ofdm.h b/codec2-dev/src/test_bits_ofdm.h index acbed019..f91ce232 100644 --- a/codec2-dev/src/test_bits_ofdm.h +++ b/codec2-dev/src/test_bits_ofdm.h @@ -1,6 +1,118 @@ /* Generated by test_bits_ofdm_file() Octave function */ const int test_bits_ofdm[]={ + 0, + 1, + 0, + 0, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 0, 1, 1, 0, @@ -114,3 +226,4 @@ const int test_bits_ofdm[]={ 1, 0 }; + -- 2.25.1