[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resampling FIR Filter Parameters



If you want to peer at some existing code to compare to, the rat engine can use digital filters for rate conversion.

--bob

At 03:43 PM 6/6/2002 -0700, Wesley Miaw wrote:
This email is sort of a "does anyone else know about this stuff" email. I have some idea of what I'm supposed to be doing, but it'd be nice if someone else also thought I knew what I was doing. At the very least, it will dump some information into the Open Mash archives.

I have been unable to get Apple's AudioConverter subroutines to work correctly, so at this point, I have been looking at ways to resample the audio data myself. Specifically, I am trying to resample from 44.1kHz to 8kHz.

I've found the OpenDSP software (http://www.dspguru.com/), which has C subroutines to decimate, interpolate, and resample audio data, but I need to create the resampling lowpass filter coefficients. To do that, I downloaded the trial version of ScopeFIR (http://www.iowegian.com/).

To do this resampling, I need to interpolate first by 80 and then decimate by 441. So I need an interpolation filter for 80. With the trial version of ScopeFIR I can have up to 32 taps. Since the number of taps must be evenly divisible by my interpolation filter, I can interpolate first by 8 (32 taps) and then 10 (30 taps) to get 80 total. Interpolating smallest to largest in two or three steps is recommended.

Using ScopeFIR, it looks like the "Passband Upper Frequency" should be 4kHz, according to the Nyquist Theorem. I don't know what the "Stopband Lower Frequency" should be, but I'm just choosing 16kHz because that seems like a good frequency at which to cut off audio data based on acoustical models.

I have no idea what values to put for "Passband Ripple in dB" or "Stopband Attenuation in dB". But, a passband ripple of 3dB seems okay based on the last paragraph of http://www.appsig.com/papers/tn070/tn070_2_2.html. (Political Note: All papers should be available free in their entirety in lots of places on the Internet.) Since 3dB was suggested in the ScopeFIR tutorial along with 40dB for the stopband attenuation, I suppose 40dB must be okay as well.

Those values actually result in a very clean filter in ScopeFIR, so I'm going to try them. But, does anyone on here know anything about this that might be able to help me figure things out better?
--
Wesley Miaw, Berkeley Multimedia Research Center
wesley@bmrc.berkeley.edu