From: drowe67 Date: Wed, 17 Nov 2010 03:26:00 +0000 (+0000) Subject: added HP filter to main library X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=490e996334615f35dfba7e3749f735b278f240cc;p=freetel-svn-tracking.git added HP filter to main library git-svn-id: https://svn.code.sf.net/p/freetel/code@237 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2/src/codec2.c b/codec2/src/codec2.c index 8c505f8f..5d9c1be7 100644 --- a/codec2/src/codec2.c +++ b/codec2/src/codec2.c @@ -48,6 +48,7 @@ typedef struct { COMP W[FFT_ENC]; /* DFT of w[] */ float Pn[2*N]; /* trapezoidal synthesis window */ float Sn[M]; /* input speech */ + float hpf_states[2]; /* high pass filter states */ void *nlp; /* pitch predictor states */ float Sn_[2*N]; /* synthesised output speech */ float ex_phase; /* excitation model phase track */ @@ -98,6 +99,7 @@ void *codec2_create() for(i=0; iSn[i] = 1.0; + c2->hpf_states[0] = c2->hpf_states[1] = 0.0; for(i=0; i<2*N; i++) c2->Sn_[i] = 0; make_analysis_window(c2->w,c2->W); @@ -350,7 +352,8 @@ void analyse_one_frame(CODEC2 *c2, MODEL *model, short speech[]) for(i=0; iSn[i] = c2->Sn[i+N]; for(i=0; iSn[i+M-N] = speech[i]; + c2->Sn[i+M-N] = hpf((float)speech[i], c2->hpf_states); + dft_speech(Sw, c2->Sn, c2->w); /* Estimate pitch */