[sdiy] Looking for cheap lowpass filter algorithm
Magnus Danielson
cfmd at bredband.net
Thu Aug 17 10:00:42 CEST 2006
From: Seb Francis <seb at burnit.co.uk>
Subject: Re: [sdiy] Looking for cheap lowpass filter algorithm
Date: Thu, 17 Aug 2006 03:05:13 +0100
Message-ID: <44E3CED9.9090506 at burnit.co.uk>
> Thanks to everyone for the help so far, I seem to be getting there with
> this FIR stuff .. learning more and more about this DSP stuff every day :)
>
> Turns out a 33 tap filter can be implemented in 37 cycles on a dsPIC so
> I'm pretty happy to use this order of filter.
>
> But I'm still a bit confused about a couple of things ...
>
> Antti said
> "I should emphasize that those are 32 multiplies at _24 kHz_ samplerate,
> not 48 kHz".
> Does this mean that I should discard every other sample and apply the 33
> tap filter to the 24kHz sample rate data?
> Or does it mean that I should apply a 17 tap filter to the 48kHz sample
> rate data then discard every other sample?
Look at it this way: You could do 32 multiplies at 48 kHz, it is just that your
sampling of every other sample on the output of that FIR filter will actually
waste half of the processed samples and thus half of your total amount of
filtering computation. By letting two samples pass between each computation
rather than one, you have integrated the sampling somewhat with the filtering.
This would be equalent but only half the processing. Neat huh?
> And the other thing I'm still getting my head around is how to calculate
> the optimal coefficients for my application - which requires a very
> steep response filter with the stopband at 0.25*Fs (or possibly at
> 0.5*Fs depending on the answer to the above question).
Fs/4 is your answer regardless.
> I've tried out a couple of online calculators people have kindly sent me
> but I'm not sure any of these are exactly what I need ...
>
> Raised Cosine Filter
> http://www-users.cs.york.ac.uk/~fisher/mkfilter/racos.html
> Parks-McClellan equiripple FIR filter
> http://www.dsptutor.freeuk.com/remez/RemezFIRFilterDesign.html
> Kaiser Window FIR filter
> http://www.dsptutor.freeuk.com/KaiserFilterDesign/KaiserFilterDesign.html
>
> None of them seem to generate a very steep cutout. It could just be
> that I'm not setting the parameters right, or that I need to use a
> higher order filter, but I suspect that there may be other filter design
> algorithms that would suit my purpose better .. unfortunately I'm a bit
> of a newbie when it comes to all this DSP maths!
The Parks-McClellan/Remez-exchange should do what you want, you just need to
learn to twist the knobs a bit.
> A couple of people have mentioned Matlab, but this isn't exactly a free
> download. Eric suggested octave and octave-forge function library, but
> this looks like a lot of work to learn to use, and even then I'm not
> sure I'd know the names of the right mathematical algorithms to use.
Matlab and octave should be comparable in this regard.
Cheers,
Magnus
More information about the Synth-diy
mailing list