From: drowe67 Date: Tue, 8 Sep 2009 21:53:28 +0000 (+0000) Subject: fixed buffer update bug in nlp X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=69b7ccda338710443fecc2c7800a1a91dab67100;p=freetel-svn-tracking.git fixed buffer update bug in nlp git-svn-id: https://svn.code.sf.net/p/freetel/code@47 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2/README.txt b/codec2/README.txt index 4585ead6..7a86c5df 100644 --- a/codec2/README.txt +++ b/codec2/README.txt @@ -31,7 +31,7 @@ Status 3. Phase model developed that uses 0 bits for phase and 1 bit/frame for voiced/unvoiced decision. -[[source code]] +[[source]] The Source Code --------------- @@ -270,14 +270,14 @@ References ---------- [1] http://perens.com/[Bruce Perens] introducing the - http://codec2.org/[codec2 project concept]: + http://codec2.org/[codec2 project concept] [2] David's PhD Thesis, http://www.itr.unisa.edu.au/~steven/thesis/dgr.pdf["Techniques for - Harmonic Sinusoidal Coding"], used for baseline algorithm: + Harmonic Sinusoidal Coding"], used for baseline algorithm [3] http://www.rowetel.com/blog/?p=128[Open Source Low rate Speech - Codec Part 1 - Introduction:] + Codec Part 1 - Introduction] [4] http://www.rowetel.com/blog/?p=130[Open Source Low rate Speech Codec Part 1 - Spectral Magnitudes] diff --git a/codec2/raw/mmt1.raw b/codec2/raw/mmt1.raw new file mode 100644 index 00000000..40638a5a Binary files /dev/null and b/codec2/raw/mmt1.raw differ diff --git a/codec2/src/dump.c b/codec2/src/dump.c index 1295074b..02a354d5 100644 --- a/codec2/src/dump.c +++ b/codec2/src/dump.c @@ -43,6 +43,8 @@ static FILE *fphase = NULL; static FILE *fphase_ = NULL; static FILE *ffw = NULL; static FILE *fe = NULL; +static FILE *fsq = NULL; +static FILE *fdec = NULL; static char prefix[MAX_STR]; @@ -74,6 +76,10 @@ void dump_off(){ fclose(ffw); if (fe != NULL) fclose(fe); + if (fsq != NULL) + fclose(fsq); + if (fdec != NULL) + fclose(fdec); } void dump_Sn(float Sn[]) { @@ -288,4 +294,41 @@ void dump_e(float e_hz[]) { fprintf(fe,"\n"); } +void dump_sq(float sq[]) { + int i; + char s[MAX_STR]; + + if (!dumpon) return; + + if (fsq == NULL) { + sprintf(s,"%s_sq.txt", prefix); + fsq = fopen(s, "wt"); + assert(fsq != NULL); + } + + for(i=0; i #include +#include #include #include "nlp.h" #include "dump.h" @@ -122,7 +123,7 @@ char *argv[]; dft_speech(); dump_Sn(Sn); dump_Sw(Sw); - nlp(Sn,N,M,N-NLP_NTAP/2,PITCH_MIN,PITCH_MAX,&pitch,Sw); + nlp(Sn,N,M,PITCH_MIN,PITCH_MAX,&pitch,Sw); fprintf(fout,"%f\n",pitch);