at JVMs suggestion did BWE after energy calculation, that fixed problem
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 1 Mar 2012 20:21:50 +0000 (20:21 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 1 Mar 2012 20:21:50 +0000 (20:21 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@337 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/quantise.c

index d18a3e3a3ac1c2fa3fb3d9bc243ab3619f151a84..4c031100a3e7eb2cf5fc6c4328e0b4844608f12f 100644 (file)
@@ -863,6 +863,14 @@ float speech_to_uq_lsps(float lsp[],
     for(i=0; i<=order; i++)
        E += ak[i]*R[i];
  
+    /* 15 Hz BW expansion as I can't hear the difference and it may help
+       help occasional fails in the LSP root finding.  Important to do this
+       after energy caluclation to avoid -ve energy values.
+    */
+
+    for(i=0; i<=order; i++)
+       ak[i] *= pow(0.994,(float)i);
+
     roots = lpc_to_lsp(ak, order, lsp, 5, LSP_DELTA1);
     if (roots != order) {
        /* use some benign LSP values we can use instead */