removed debug stuff
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 12 Jan 2017 22:36:06 +0000 (22:36 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 12 Jan 2017 22:36:06 +0000 (22:36 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2964 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/phase.c

index 0488644e38c64a367fe3a7ad635d31b2b4290778..61efc95c48c89e7bf4ee7750055add444499cccc 100644 (file)
 
 \*---------------------------------------------------------------------------*/
 
-void sample_phase(MODEL *model, COMP H[], COMP A[])
+void sample_phase(MODEL *model, 
+                  COMP H[], 
+                  COMP A[]        /* LPC analysis filter in freq domain */
+                  )                  
 {
     int   m, b;
-    float phi_, r;
+    float r;
 
     r = TWO_PI/(FFT_ENC);
 
@@ -58,9 +61,7 @@ void sample_phase(MODEL *model, COMP H[], COMP A[])
 
     for(m=1; m<=model->L; m++) {
         b = (int)(m*model->Wo/r + 0.5);
-        phi_ = -atan2f(A[b].imag, A[b].real);
-        H[m].real = cosf(phi_);
-        H[m].imag = sinf(phi_);
+        H[m] = cconj(A[b]);      /* synth filter 1/A is opposite phase to analysis filter */
     }
 }
 
@@ -270,20 +271,10 @@ void mag_to_phase(float phase[],             /* Nfft/2+1 output phase samples in
         cf[i].imag = 0.0;
     }
 
-    fprintf(stderr, "  cf:  ");
-    for(i=0; i<Nfft; i++)
-        fprintf(stderr, "[%d] (%5.3f %5.3f)\n", i, cf[i].real, cf[i].imag);
-    fprintf(stderr,"\n");
-    
     /* Cf = dB_magnitude + j * minimum_phase */
 
     codec2_fft(fft_fwd_cfg, cf, Cf);
 
-    fprintf(stderr, "  Cf:  ");
-    for(i=0; i<5; i++)
-        fprintf(stderr, "(%5.3f %5.3f)  ", Cf[i].real, Cf[i].imag);
-    fprintf(stderr,"\n");
-    
     /*  The maths says we are meant to be using log(x), not 20*log10(x),
         so we need to scale the phase to account for this:
         log(x) = 20*log10(x)/scale */