From: okcsampson Date: Sat, 3 Jun 2017 23:31:08 +0000 (+0000) Subject: Add in the initial OFDM Header files X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=960948a7805680f6ef71c3f85334a3391025ecd8;p=freetel-svn-tracking.git Add in the initial OFDM Header files git-svn-id: https://svn.code.sf.net/p/freetel/code@3152 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/codec2_ofdm.h b/codec2-dev/src/codec2_ofdm.h new file mode 100644 index 00000000..c2590163 --- /dev/null +++ b/codec2-dev/src/codec2_ofdm.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2017 David Rowe + * + * All rights reserved + * + * Licensed under GNU LGPL V2.1 + * See LICENSE file for information + */ + +#ifndef CODEC2_OFDM_H +#define CODEC2_OFDM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes */ + +#include +#include + +#include "comp.h" + +/* Defines */ + +struct OFDM; + +/* Prototypes */ + +struct OFDM *ofdm_create(float, float, int, float, float, int, int); +void ofdm_destroy(struct OFDM *); +int ofdm_errno(void); +COMP *ofdm_mod(struct OFDM *ofdm, int *); +int *ofdm_demod(struct OFDM *ofdm, COMP *); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/codec2-dev/src/ofdm_internal.h b/codec2-dev/src/ofdm_internal.h new file mode 100644 index 00000000..d0c55f62 --- /dev/null +++ b/codec2-dev/src/ofdm_internal.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2017 David Rowe + * + * All rights reserved + * + * Licensed under GNU LGPL V2.1 + * See LICENSE file for information + */ + +#ifndef OFDM_INTERNAL_H +#define OFDM_INTERNAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#ifndef M_PI +#define M_PI 3.14159265358979323846f /* math constant */ +#endif + +#define TAU (2.0f * M_PI) /* mathematical constant */ + +/* + * QPSK Quadrant bit-pair values - Gray Coded + * + * 0.0 - 89.9 = 00 + * 90.0 - 179.9 = 01 + * 180.0 - 269.9 = 11 + * 270.0 - 359.9 = 10 + */ +const complex float constellation[] = { + 1.0f + 0.0f * I, + 0.0f + 1.0f * I, + 0.0f - 1.0f * I, + -1.0f + 0.0f * I +}; + +struct OFDM { + float Fs; + float Ts; + float Rs; + float Tcp; + float Ncp; + float Fcentre; + float foff_est_gain; + float foff_est_hz; + + int Nbitsperframe; + int Nrowsperframe; + int Nsamperframe; + int Ns; + int Nc; + int M; + int bps; + int ftwindow_width; + int verbose; + int sample_point; + int timing_est; + int nin; + int Nrxbuf; + + bool timing_en; + bool foff_est_en; + bool phase_est_en; + + /* dynamic heap memory allocation */ + + complex float *rate_fs_pilot_samples; + complex float **W; + complex float *rxbuf; + float *w; + int *pilots; +}; + +#ifdef __cplusplus +} +#endif + +#endif