[sdiy] Digital interpolation filtering

Tom Wiltshire tom at electricdruid.net
Sun May 31 17:24:56 CEST 2009


On 31 May 2009, at 15:56, Eric Brombaugh wrote:
>
> For example, suppose you wanted to generate a set of FIR filter  
> coefficients and plot the frequency response. In Octave, I'd do it  
> like this:
>
>  b = remez(35, [0 .14 .22 1], [1 1 0 0]);
>  freqz(b, 1);
>
> ...snip ...

> Just a bit quicker than coding all that up at a lower level.

I'll say.

> It's hard for me to tell, but it seems that there are a few  
> concepts being confused here.

Not unlikely!

> While you mention a raised cosine window, you also talk about a  
> sinc function. It sounds like you're trying to use a filter design  
> technique called windowing, where a frequency response is  
> constructed (often using a raised cosine or other window type) and  
> processed through an inverse FFT to derive the corresponding  
> impulse response. In this approach one usually has only indirect  
> control over the period of the resulting sinc pulse because the  
> input to the IFFT entirely determines the characteristics of the  
> output.
>
> Alternatively, it may be that you're working entirely in the time  
> domain but just windowing a sinc function with a raised cosine in  
> order to chop it down to fit into the available taps.

Yes, this sounds like what I was trying to do. I learned this  
approach from here:

http://www.dspguide.com/ch16/1.htm

You start off with a sinc function, an ideal filter kernel, or (the  
same thing) an ideal impulse response. You then window it with some  
smooth window function to eliminate the long sidelobes. I was using  
the basic raised-cosine window, but this afternoon I've done a few  
experiments with Blackman and Hamming windows - these are pretty much  
variations on the theme. They don't produce results that are visually  
hugely different. This is where some better analysis comes in.

> I'd recommend that you code up some method of viewing the frequency  
> response - use an FFT to process the coefficients you've created,  
> plot the magnitude and see how changing the variables to your  
> coefficient generation code affects the result. Building up some  
> intuition about how they interact is critical to making progress.

Good idea, and yes, it's already been quite an eye-opener to have a  
little filter to play with.

Thanks for your help, Eric.

Tom





More information about the Synth-diy mailing list