From: drowe67 Date: Tue, 8 Sep 2009 04:43:03 +0000 (+0000) Subject: added MBE pitch post processor to nlp.c, still debugging X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=cd5d93c1544a0f094938f16ab41741ab91de225c;p=freetel-svn-tracking.git added MBE pitch post processor to nlp.c, still debugging git-svn-id: https://svn.code.sf.net/p/freetel/code@44 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2/unittest/Makefile b/codec2/unittest/Makefile index 0dd6d98b..9ef936a4 100644 --- a/codec2/unittest/Makefile +++ b/codec2/unittest/Makefile @@ -1,6 +1,6 @@ CFLAGS = -I. -I../src -I../speex -Wall -g -DFLOATING_POINT -DVAR_ARRAYS -all: genres lsptest genlsp extract vqtrain +all: genres lsptest genlsp extract vqtrain tnlp genres: genres.o ../src/lpc.o gcc $(CFLAGS) -o genres genres.o ../src/lpc.o -lm @@ -9,6 +9,9 @@ LSP_TEST_OBJ = lsptest.o ../src/lpc.o ../speex/lsp.o sd.o ../src/four1.o \ ../speex/quant_lsp.o ../speex/bits.o ../speex/lsp_tables_nb.o \ ../speex/high_lsp_tables.c +TNLP_OBJ = tnlp.o ../src/nlp.o ../src/four1.o ../src/initenc.o ../src/dump.o \ + ../src/globals.o ../src/refine.o + lsptest: $(LSP_TEST_OBJ) gcc $(CFLAGS) -o lsptest $(LSP_TEST_OBJ) -lm @@ -21,5 +24,8 @@ extract: extract.o vqtrain: vqtrain.o gcc $(CFLAGS) -o vqtrain vqtrain.o -lm +tnlp: $(TNLP_OBJ) + gcc $(CFLAGS) -o tnlp $(TNLP_OBJ) -lm + %.o : %.c $(CC) -c $(CFLAGS) $< -o $@ diff --git a/codec2/unittest/tnlp.c b/codec2/unittest/tnlp.c index cf582f9c..d4fedbbe 100644 --- a/codec2/unittest/tnlp.c +++ b/codec2/unittest/tnlp.c @@ -26,49 +26,42 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define N 160 /* frame size */ +#define N 80 /* frame size */ #define M 320 /* pitch analysis window size */ #define PITCH_MIN 20 -#define PITCH_MAX 133 +#define PITCH_MAX 160 #define TNLP -int frames; - #include #include #include -#include "four1.c" -#include "nlpl.c" - -/*---------------------------------------------------------------------------*\ +#include "nlp.h" +#include "dump.h" - FUNCTIONS +int frames; +/*---------------------------------------------------------------------------*\ + + switch_present() + + Searches the command line arguments for a "switch". If the switch is + found, returns the command line argument where it ws found, else returns + NULL. + \*---------------------------------------------------------------------------*/ -void swap(buf,n) -short buf[]; /* array of speech samples */ -int n; /* number of speech samples */ +int switch_present(sw,argc,argv) + char sw[]; /* switch in string form */ + int argc; /* number of command line arguments */ + char *argv[]; /* array of command line arguments in string form */ { - int i; - short a,b; - - for(i=0; i> 8) & 0xff; - buf[i] = (a << 8) | b; - } -} + int i; /* loop variable */ -void short_to_float(b,s,n) -short b[]; /* buffer of short speech samples */ -float s[]; /* buffer of float speech samples */ -int n; /* number of speech samples */ -{ - int i; - - for(i=0; i 2) - fprintf(fout,"%f\n",pitch); + for(i=0; i