support for HPF
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 16 Nov 2010 09:35:38 +0000 (09:35 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 16 Nov 2010 09:35:38 +0000 (09:35 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@236 01035d8c-6547-0410-b346-abe4f91aad63

codec2/src/c2sim.c
codec2/src/sine.h

index 4f809eb8f4005cc81a0794954cc7742032320bc4..3fb03b565167e791f0e30d90eec851c7fb3c43fb 100644 (file)
@@ -125,6 +125,7 @@ int main(int argc, char *argv[])
   float ak_interp[LPC_MAX];
 
   void *nlp_states;
+  float hpf_states[2];
 
   for(i=0; i<M; i++)
       Sn[i] = 1.0;
@@ -146,6 +147,7 @@ int main(int argc, char *argv[])
       prev_lsps[i] = i*PI/(LPC_ORD+1);
   }
   e = prev_e = 1;
+  hpf_states[0] = hpf_states[1] = 0.0;
 
   nlp_states = nlp_create();
 
@@ -240,7 +242,7 @@ int main(int argc, char *argv[])
     for(i=0; i<M-N; i++)
       Sn[i] = Sn[i+N];
     for(i=0; i<N; i++)
-      Sn[i+M-N] = buf[i];
+       Sn[i+M-N] = hpf((float)buf[i], hpf_states);
  
     /* Estimate pitch */
 
index 88eee37f7fa21efa59016d4a0532b1434dca630b..ae578bf70b383dd68bb9b473d040211c0d064ce9 100644 (file)
 #include "comp.h"
 
 void make_analysis_window(float w[], COMP W[]);
+float hpf(float x, float states[]);
 void dft_speech(COMP Sw[], float Sn[], float w[]);
 void two_stage_pitch_refinement(MODEL *model, COMP Sw[]);
 void estimate_amplitudes(MODEL *model, COMP Sw[], COMP W[]);
-float est_voicing_mbe(MODEL *model, COMP Sw[], COMP W[], COMP Sw_[],COMP Ew[], float prev_Wo);
+float est_voicing_mbe(MODEL *model, COMP Sw[], COMP W[], COMP Sw_[],COMP Ew[], 
+                     float prev_Wo);
 void make_synthesis_window(float Pn[]);
 void synthesise(float Sn_[], MODEL *model, float Pn[], int shift);