Add in the initial OFDM Header files
authorokcsampson <okcsampson@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 3 Jun 2017 23:31:08 +0000 (23:31 +0000)
committerokcsampson <okcsampson@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 3 Jun 2017 23:31:08 +0000 (23:31 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3152 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/codec2_ofdm.h [new file with mode: 0644]
codec2-dev/src/ofdm_internal.h [new file with mode: 0644]

diff --git a/codec2-dev/src/codec2_ofdm.h b/codec2-dev/src/codec2_ofdm.h
new file mode 100644 (file)
index 0000000..c259016
--- /dev/null
@@ -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 <complex.h>
+#include <stdbool.h>
+    
+#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 (file)
index 0000000..d0c55f6
--- /dev/null
@@ -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 <complex.h>
+#include <stdbool.h>
+
+#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