changed fifo.h and fdmdv.h to more unique names codec2_fifo.h & codec2_fdmdv.h to...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 22 Dec 2012 07:15:02 +0000 (07:15 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 22 Dec 2012 07:15:02 +0000 (07:15 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1150 01035d8c-6547-0410-b346-abe4f91aad63

16 files changed:
codec2-dev/src/Makefile.am
codec2-dev/src/codec2_fdmdv.h [new file with mode: 0644]
codec2-dev/src/codec2_fifo.h [new file with mode: 0644]
codec2-dev/src/fdmdv.c
codec2-dev/src/fdmdv.h [deleted file]
codec2-dev/src/fdmdv_demod.c
codec2-dev/src/fdmdv_get_test_bits.c
codec2-dev/src/fdmdv_interleave.c
codec2-dev/src/fdmdv_internal.h
codec2-dev/src/fdmdv_mod.c
codec2-dev/src/fdmdv_put_test_bits.c
codec2-dev/src/fifo.c
codec2-dev/src/fifo.h [deleted file]
codec2-dev/unittest/t48_8.c
codec2-dev/unittest/tfdmdv.c
codec2-dev/unittest/tfifo.c

index 8d0d990c43c5110e08df4aec953277dff7a87c7a..853b644b45cf0c7597e72a91c191013bcc2153b9 100644 (file)
@@ -144,7 +144,7 @@ libcodec2_la_CFLAGS = $(AM_CFLAGS)
 libcodec2_la_LDFLAGS = $(LIBS)
 
 library_includedir = $(prefix)/include
-library_include_HEADERS        = codec2.h
+library_include_HEADERS        = codec2.h codec2_fdmdv.h codec2_fifo.h
 
 bin_PROGRAMS = c2demo c2enc c2dec c2sim fdmdv_get_test_bits fdmdv_mod fdmdv_demod fdmdv_put_test_bits fdmdv_interleave
 
diff --git a/codec2-dev/src/codec2_fdmdv.h b/codec2-dev/src/codec2_fdmdv.h
new file mode 100644 (file)
index 0000000..46b3a6a
--- /dev/null
@@ -0,0 +1,117 @@
+/*---------------------------------------------------------------------------*\
+                                                                             
+  FILE........: codec2_fdmdv.h
+  AUTHOR......: David Rowe
+  DATE CREATED: April 14 2012
+                                                                             
+  A 1400 bit/s Frequency Division Multiplexed Digital Voice (FDMDV)
+  modem.  Used for digital audio over HF SSB. See README_fdmdv.txt for
+  more information, and fdmdv_mod.c and fdmdv_demod.c for example
+  usage.
+  
+  The name codec2_fdmdv.h is used to make it unique when "make
+  installed".
+                   
+  References:
+    [1] http://n1su.com/fdmdv/FDMDV_Docs_Rel_1_4b.pdf
+
+\*---------------------------------------------------------------------------*/
+
+/*
+  Copyright (C) 2012 David Rowe
+
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU Lesser General Public License version 2.1, as
+  published by the Free Software Foundation.  This program is
+  distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __FDMDV__
+#define __FDMDV__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* set up the calling convention for DLL function import/export for
+   WIN32 cross compiling */
+
+#ifdef __CODEC2_WIN32__
+#ifdef __CODEC2_BUILDING_DLL__
+#define CODEC2_WIN32SUPPORT __declspec(dllexport) __stdcall
+#else
+#define CODEC2_WIN32SUPPORT __declspec(dllimport) __stdcall
+#endif
+#else
+#define CODEC2_WIN32SUPPORT
+#endif
+
+#include "comp.h"
+
+#define FDMDV_BITS_PER_FRAME          28  /* 20ms frames, 1400 bit/s                                        */
+#define FDMDV_NOM_SAMPLES_PER_FRAME  160  /* modulator output samples/frame and nominal demod samples/frame */
+                                          /* at 8000 Hz sample rate                                         */
+#define FDMDV_MAX_SAMPLES_PER_FRAME  200  /* max demod samples/frame, use this to allocate storage          */
+#define FDMDV_SCALE                 1000  /* suggested scaling for 16 bit shorts                            */
+#define FDMDV_NSYM                    15
+#define FDMDV_FCENTRE               1500  /* Centre frequency, Nc/2 carriers below this, Nc/2 carriers above (Hz) */
+
+/* 8 to 48 kHz sample rate conversion */
+
+#define FDMDV_OS                 6         /* oversampling rate           */
+#define FDMDV_OS_TAPS           48         /* number of OS filter taps    */
+
+/* FFT points */
+
+#define FDMDV_NSPEC             512
+#define FDMDV_MAX_F_HZ          4000
+
+/* FDMDV states and stats structures */
+
+struct FDMDV;
+    
+struct FDMDV_STATS {
+    float  snr_est;                /* estimated SNR of rx signal in dB (3 kHz noise BW)  */
+    COMP   rx_symbols[FDMDV_NSYM]; /* latest received symbols, for scatter plot          */ 
+    int    fest_coarse_fine;       /* freq est state, 0-coarse 1-fine                    */ 
+    float  foff;                   /* estimated freq offset in Hz                        */       
+    float  rx_timing;              /* estimated optimum timing offset in samples         */
+    float  clock_offset;           /* Estimated tx/rx sample clock offset in ppm         */
+};
+
+struct FDMDV * CODEC2_WIN32SUPPORT fdmdv_create(void);
+void           CODEC2_WIN32SUPPORT fdmdv_destroy(struct FDMDV *fdmdv_state);
+    
+void           CODEC2_WIN32SUPPORT fdmdv_mod(struct FDMDV *fdmdv_state, COMP tx_fdm[], int tx_bits[], int *sync_bit);
+void           CODEC2_WIN32SUPPORT fdmdv_demod(struct FDMDV *fdmdv_state, int rx_bits[], int *sync_bit, COMP rx_fdm[], int *nin);
+    
+void           CODEC2_WIN32SUPPORT fdmdv_get_test_bits(struct FDMDV *fdmdv_state, int tx_bits[]);
+void           CODEC2_WIN32SUPPORT fdmdv_put_test_bits(struct FDMDV *f, int *sync, int *bit_errors, int *ntest_bits, int rx_bits[]);
+    
+void           CODEC2_WIN32SUPPORT fdmdv_get_demod_stats(struct FDMDV *fdmdv_state, struct FDMDV_STATS *fdmdv_stats);
+void           CODEC2_WIN32SUPPORT fdmdv_get_rx_spectrum(struct FDMDV *fdmdv_state, float mag_dB[], COMP rx_fdm[], int nin);
+
+void           CODEC2_WIN32SUPPORT fdmdv_8_to_48(float out48k[], float in8k[], int n);
+void           CODEC2_WIN32SUPPORT fdmdv_48_to_8(float out8k[], float in48k[], int n);
+
+void           CODEC2_WIN32SUPPORT fdmdv_freq_shift(COMP rx_fdm_fcorr[], COMP rx_fdm[], float foff, COMP *foff_rect, COMP *foff_phase_rect, int nin);
+
+/* debug/development function(s) */
+
+void CODEC2_WIN32SUPPORT fdmdv_dump_osc_mags(struct FDMDV *f);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/codec2-dev/src/codec2_fifo.h b/codec2-dev/src/codec2_fifo.h
new file mode 100644 (file)
index 0000000..dc93e15
--- /dev/null
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------------*\
+                                                                             
+  FILE........: codec2_fifo.h
+  AUTHOR......: David Rowe
+  DATE CREATED: Oct 15 2012
+                                                                             
+  A FIFO design useful in gluing the FDMDV modem and codec together in
+  integrated applications.
+  
+  The name codec2_fifo.h is used to make it unique when "make
+  installed".                   
+
+\*---------------------------------------------------------------------------*/
+
+/*
+  Copyright (C) 2012 David Rowe
+
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU Lesser General Public License version 2.1, as
+  published by the Free Software Foundation.  This program is
+  distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __FIFO__
+#define __FIFO__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct FIFO;
+
+struct FIFO *fifo_create(int nshort);
+void fifo_destroy(struct FIFO *fifo);
+int fifo_write(struct FIFO *fifo, short data[], int n);
+int fifo_read(struct FIFO *fifo, short data[], int n);
+int fifo_used(struct FIFO *fifo);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index a6204f411ed44cb79a4f8b0987490991ac2ff366..703bd4cc39c2b3ac1dc4471564c7dd55222a48c6 100644 (file)
@@ -38,7 +38,7 @@
 #include <math.h>
 
 #include "fdmdv_internal.h"
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 #include "rn.h"
 #include "test_bits.h"
 #include "pilot_coeff.h"
diff --git a/codec2-dev/src/fdmdv.h b/codec2-dev/src/fdmdv.h
deleted file mode 100644 (file)
index 3ad83e6..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*---------------------------------------------------------------------------*\
-                                                                             
-  FILE........: fdmdv.h
-  AUTHOR......: David Rowe
-  DATE CREATED: April 14 2012
-                                                                             
-  A 1400 bit/s Frequency Division Multiplexed Digital Voice (FDMDV)
-  modem.  Used for digital audio over HF SSB. See README_fdmdv.txt for
-  more information, and fdmdv_mod.c and fdmdv_demod.c for example
-  usage.
-                     
-  References:
-    [1] http://n1su.com/fdmdv/FDMDV_Docs_Rel_1_4b.pdf
-
-\*---------------------------------------------------------------------------*/
-
-/*
-  Copyright (C) 2012 David Rowe
-
-  All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License version 2.1, as
-  published by the Free Software Foundation.  This program is
-  distributed in the hope that it will be useful, but WITHOUT ANY
-  WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
-  License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __FDMDV__
-#define __FDMDV__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* set up the calling convention for DLL function import/export for
-   WIN32 cross compiling */
-
-#ifdef __CODEC2_WIN32__
-#ifdef __CODEC2_BUILDING_DLL__
-#define CODEC2_WIN32SUPPORT __declspec(dllexport) __stdcall
-#else
-#define CODEC2_WIN32SUPPORT __declspec(dllimport) __stdcall
-#endif
-#else
-#define CODEC2_WIN32SUPPORT
-#endif
-
-#include "comp.h"
-
-#define FDMDV_BITS_PER_FRAME          28  /* 20ms frames, 1400 bit/s                                        */
-#define FDMDV_NOM_SAMPLES_PER_FRAME  160  /* modulator output samples/frame and nominal demod samples/frame */
-                                          /* at 8000 Hz sample rate                                         */
-#define FDMDV_MAX_SAMPLES_PER_FRAME  200  /* max demod samples/frame, use this to allocate storage          */
-#define FDMDV_SCALE                 1000  /* suggested scaling for 16 bit shorts                            */
-#define FDMDV_NSYM                    15
-#define FDMDV_FCENTRE               1500  /* Centre frequency, Nc/2 carriers below this, Nc/2 carriers above (Hz) */
-
-/* 8 to 48 kHz sample rate conversion */
-
-#define FDMDV_OS                 6         /* oversampling rate           */
-#define FDMDV_OS_TAPS           48         /* number of OS filter taps    */
-
-/* FFT points */
-
-#define FDMDV_NSPEC             512
-#define FDMDV_MAX_F_HZ          4000
-
-/* FDMDV states and stats structures */
-
-struct FDMDV;
-    
-struct FDMDV_STATS {
-    float  snr_est;                /* estimated SNR of rx signal in dB (3 kHz noise BW)  */
-    COMP   rx_symbols[FDMDV_NSYM]; /* latest received symbols, for scatter plot          */ 
-    int    fest_coarse_fine;       /* freq est state, 0-coarse 1-fine                    */ 
-    float  foff;                   /* estimated freq offset in Hz                        */       
-    float  rx_timing;              /* estimated optimum timing offset in samples         */
-    float  clock_offset;           /* Estimated tx/rx sample clock offset in ppm         */
-};
-
-struct FDMDV * CODEC2_WIN32SUPPORT fdmdv_create(void);
-void           CODEC2_WIN32SUPPORT fdmdv_destroy(struct FDMDV *fdmdv_state);
-    
-void           CODEC2_WIN32SUPPORT fdmdv_mod(struct FDMDV *fdmdv_state, COMP tx_fdm[], int tx_bits[], int *sync_bit);
-void           CODEC2_WIN32SUPPORT fdmdv_demod(struct FDMDV *fdmdv_state, int rx_bits[], int *sync_bit, COMP rx_fdm[], int *nin);
-    
-void           CODEC2_WIN32SUPPORT fdmdv_get_test_bits(struct FDMDV *fdmdv_state, int tx_bits[]);
-void           CODEC2_WIN32SUPPORT fdmdv_put_test_bits(struct FDMDV *f, int *sync, int *bit_errors, int *ntest_bits, int rx_bits[]);
-    
-void           CODEC2_WIN32SUPPORT fdmdv_get_demod_stats(struct FDMDV *fdmdv_state, struct FDMDV_STATS *fdmdv_stats);
-void           CODEC2_WIN32SUPPORT fdmdv_get_rx_spectrum(struct FDMDV *fdmdv_state, float mag_dB[], COMP rx_fdm[], int nin);
-
-void           CODEC2_WIN32SUPPORT fdmdv_8_to_48(float out48k[], float in8k[], int n);
-void           CODEC2_WIN32SUPPORT fdmdv_48_to_8(float out8k[], float in48k[], int n);
-
-void           CODEC2_WIN32SUPPORT fdmdv_freq_shift(COMP rx_fdm_fcorr[], COMP rx_fdm[], float foff, COMP *foff_rect, COMP *foff_phase_rect, int nin);
-
-/* debug/development function(s) */
-
-void CODEC2_WIN32SUPPORT fdmdv_dump_osc_mags(struct FDMDV *f);
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
index 96090d033dfce8da0b81bd2d60d6d044028e7474..a1f1dd39c3747cb6821e78241cda47c6f1b25c52 100644 (file)
@@ -40,7 +40,7 @@
 #include <math.h>
 #include <errno.h>
 
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 #include "octave.h"
 
 #define BITS_PER_CODEC_FRAME (2*FDMDV_BITS_PER_FRAME)
index e3120e9337f0c90f39100de5001ea0a806097154..3a18b8cae1ded15fb4e95f980a8ac61ea800c064 100644 (file)
@@ -33,7 +33,7 @@
 #include <math.h>
 #include <errno.h>
 
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 
 #define BITS_PER_CODEC_FRAME (2*FDMDV_BITS_PER_FRAME)
 #define BYTES_PER_CODEC_FRAME (BITS_PER_CODEC_FRAME/8)
index 010aa1a72b53fda347ce1ce233029a3f92cb89c2..5e3aa643b80201e045e602b8434602d1a24bd7ea 100644 (file)
@@ -34,7 +34,7 @@
 #include <math.h>
 #include <errno.h>
 
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 
 #define MAX_INTERLEAVER 1024
 
index 7f3c779c7eadd2ff327c820626af07f00f1af015..d41207332bb5e9f4a17bec8d0cef15fc9db45caf 100644 (file)
@@ -30,7 +30,7 @@
 #define __FDMDV_INTERNAL__
 
 #include "comp.h"
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 #include "kiss_fft.h"
 
 /*---------------------------------------------------------------------------*\
index b85f8d1fa4a33a31dfb517ba07202492ca7a7f1f..9339cf092dc36b1daca0961eb47b8c08a24bdc43 100644 (file)
@@ -36,7 +36,7 @@
 #include <math.h>
 #include <errno.h>
 
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 
 #define BITS_PER_CODEC_FRAME (2*FDMDV_BITS_PER_FRAME)
 #define BYTES_PER_CODEC_FRAME (BITS_PER_CODEC_FRAME/8)
index ed773e7c59b9dec2e3707791a0a89be04e679ff9..4af6d7acf8d472f931ea3202db96f1c6ab9d3d54 100644 (file)
@@ -34,7 +34,7 @@
 #include <math.h>
 #include <errno.h>
 
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 
 #define BITS_PER_CODEC_FRAME (2*FDMDV_BITS_PER_FRAME)
 #define BYTES_PER_CODEC_FRAME (BITS_PER_CODEC_FRAME/8)
index 4d224da7e1bc686af08fe5272703880a2e35b972..be4995e8b75615d25f43a43fe63e3be63f0a5520 100644 (file)
@@ -32,7 +32,7 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include "fifo.h"
+#include "codec2_fifo.h"
 
 struct FIFO {
     short *buf;
diff --git a/codec2-dev/src/fifo.h b/codec2-dev/src/fifo.h
deleted file mode 100644 (file)
index a6a1039..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*---------------------------------------------------------------------------*\
-                                                                             
-  FILE........: fifo.h
-  AUTHOR......: David Rowe
-  DATE CREATED: Oct 15 2012
-                                                                             
-  A FIFO design useful in gluing the FDMDV modem and codec together in
-  integrated applications.
-
-\*---------------------------------------------------------------------------*/
-
-/*
-  Copyright (C) 2012 David Rowe
-
-  All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License version 2.1, as
-  published by the Free Software Foundation.  This program is
-  distributed in the hope that it will be useful, but WITHOUT ANY
-  WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
-  License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __FIFO__
-#define __FIFO__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct FIFO;
-
-struct FIFO *fifo_create(int nshort);
-void fifo_destroy(struct FIFO *fifo);
-int fifo_write(struct FIFO *fifo, short data[], int n);
-int fifo_read(struct FIFO *fifo, short data[], int n);
-int fifo_used(struct FIFO *fifo);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index 1eff979b20b478ef8ff65b60a07863f15435667a..61a1bfa284372afd6d8bde07a02015de3e87a37a 100644 (file)
@@ -20,7 +20,7 @@
 #include <math.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 
 #define N8                        160 /* procssing buffer size at 8 kHz */
 #define N48             (N8*FDMDV_OS)
index f9c09cb57984b4a328fade8fd99269cb9a982f5b..583d0e1848531696197047b5cca73dda4fe51637 100644 (file)
@@ -36,7 +36,7 @@
 #include <math.h>
 
 #include "fdmdv_internal.h"
-#include "fdmdv.h"
+#include "codec2_fdmdv.h"
 #include "octave.h"
 
 #define FRAMES 25
index f52c4cf551e383fe8ce9b4b33fb3e0ae5e0073a1..12e0d2b627c9814b6f1cd53215acafd14f9a7a62 100644 (file)
@@ -9,7 +9,7 @@
 #include <assert.h>
 #include <stdio.h>
 #include <pthread.h>
-#include "fifo.h"
+#include "codec2_fifo.h"
 
 #define FIFO_SZ  1024
 #define WRITE_SZ 10