[sdiy] Digital interpolation filtering

Tom Wiltshire tom at electricdruid.net
Sun May 31 11:42:21 CEST 2009


Hi Terry, Eric,

I'm using 16-bit data. I'm working on a dsPIC.
I don't have any good tools for simulation, and mostly use PHP  
scripts (yeah, really!) to do stuff that Matlab probably does better.
I've got it plotting the filter impulse response, than giving me a  
graph of the raw input (roughly 400Hz square wave) and then doing the  
filtering and plotting the output. An example output:

http://www.electricdruid.com/DigitalFilterTest.html

The code I use to generate the impulse response has a variable for  
the number of taps, and then stretches a raised cosine window to that  
size. There's then also a variable for the relative frequency of the  
sinc function (eg 1=same frequency as the raised cosine, from -pi to  
pi, 4=4 times the freq -4pi to +4pi, etc).
I've found that altering these two parameters seems to change the  
cutoff frequency and response, but I've got no handle on how exactly.  
I've simply plugged some numbers in and then had a look to see what  
the output looks like. With certain sets of values I can get good  
looking bandlimited square waves out, so I figure it's working. But I  
have no idea when I've got the "right" coefficients, or what exactly  
the response of the filter is. It's all done by eye currently!

Thanks,
Tom



On 30 May 2009, at 22:19, thx1138 wrote:
> Hi Folks,
>
> What is the bit width of the data you are processing? 16/24/32?
>
> I assume you will quantize the coefficients?
>
> I use Momentum Data Systems Filter design tools and get pretty good  
> results.
> Presently Matlab only supports 16/32 bit coefficients and I use  
> Freescale 24
> DSP's for audio processing. There are many ways to do this job, but  
> I was
> curious what tools you use. SciLab is a open source tool similar to  
> Matlab
> that several folks pointed me to as well.
>
> Regards,
>
> Terry Shultz
> thx1138 at earthlink.net



On 30 May 2009, at 22:09, Eric Brombaugh wrote:
>
> This is a fairly common approach - so common that it has a name:  
> polyphase filtering. You create a set of coefficients for your 6x  
> upsampling filter, then sort them into 6 subfilters or phases.  
> Those subfilters are applied sequentially to the low rate data to  
> create the high rate data. Instead of requiring you run a N-sample  
> MAC for every output sample, you only need to run an N/6 sample MAC.
>
> I'm also curious about the technique you use to compute the  
> coefficients. You alluded to an algorithm that let you specify the  
> characteristics of the sinc function. What method are you using?  
> How to you know when you've got the right coeffs?
>
> Eric
>




More information about the Synth-diy mailing list