experimenting with attenuation m=1 harmonic to improve males - works well but messes...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 13 Sep 2009 01:43:11 +0000 (01:43 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 13 Sep 2009 01:43:11 +0000 (01:43 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@59 01035d8c-6547-0410-b346-abe4f91aad63

codec2/src/quantise.c

index e24fe0871e674b72032e056ce1ef55c4e507c6e0..d00036b5a26206a7666156d918feae194a81ff2b 100644 (file)
@@ -358,4 +358,18 @@ void aks_to_M2(
     model->A[m] = Am;
   }
   *snr = 10.0*log10(signal/noise);
+
+  /* attenuate fundamental by 30dB if F0 < 150 Hz.  LPC modelling often makes
+     big errors on 1st harmonic, which is usually at very low level due to
+     analog HPF.
+
+     Another option is to use a single bit to swith thos attenuation
+     in and out based on measured error an encoder.  That way
+     non-HPF speech won't be impaired.
+   */
+
+  if (model->Wo < PI*150.0/4000) {
+      model->A[1] *= 0.032;
+  }
+
 }