[xiph-commits] r10713 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Mon Jan 9 01:53:21 PST 2006


Author: jm
Date: 2006-01-09 01:53:19 -0800 (Mon, 09 Jan 2006)
New Revision: 10713

Modified:
   trunk/speex/libspeex/mdf.c
Log:
radius of the notch filter poles varies with sampling rate.


Modified: trunk/speex/libspeex/mdf.c
===================================================================
--- trunk/speex/libspeex/mdf.c	2006-01-09 09:18:59 UTC (rev 10712)
+++ trunk/speex/libspeex/mdf.c	2006-01-09 09:53:19 UTC (rev 10713)
@@ -127,6 +127,7 @@
    void *fft_table;
    spx_word16_t memX, memD, memE;
    spx_word16_t preemph;
+   spx_word16_t notch_radius;
    spx_mem_t notch_mem[2];
 };
 
@@ -308,6 +309,13 @@
    }
    st->memX=st->memD=st->memE=0;
    st->preemph = QCONST16(.9,15);
+   if (st->sampling_rate<12000)
+      st->notch_radius = QCONST16(.9, 15);
+   else if (st->sampling_rate<24000)
+      st->notch_radius = QCONST16(.982, 15);
+   else
+      st->notch_radius = QCONST16(.992, 15);
+
    st->notch_mem[0] = st->notch_mem[1] = 0;
    st->adapted = 0;
    st->Pey = st->Pyy = FLOAT_ONE;
@@ -392,7 +400,7 @@
    M_1 = 1.f/M;
 #endif
 
-   filter_dc_notch16(ref, QCONST16(.95,15), st->d, st->frame_size, st->notch_mem);
+   filter_dc_notch16(ref, st->notch_radius, st->d, st->frame_size, st->notch_mem);
    /* Copy input data to buffer */
    for (i=0;i<st->frame_size;i++)
    {



More information about the commits mailing list