[sdiy] Looking for cheap lowpass filter algorithm
Seb Francis
seb at burnit.co.uk
Fri Aug 18 17:53:22 CEST 2006
Hi Scott,
Scott Gravenhorst wrote:
> So what are your suggestions regarding filter design, assuming you know you want certain
> rolloff characteristics, phase distortion, ripple, etc., do you start with a low number
> of taps (how many?) and keep physically testing/increasing the calculated coefficients
> until the ear says "OK"?
>
> That seems rather hit or miss, or maybe I'm making too big a deal of this?
>
> If you see a nice spectral response graph using many taps, what would make you want to
> try fewer taps when the graph looks horrible with them?
>
> I guess what I'm asking is given all this, what good is the graph then? How truthful is
> it, i.e., on what graphical characteristics can I depend to give me reliable and useful
> information about my prospective design?
>
>
>
>
Well I think if you require specific rolloff, phase, ripple
characteristics then you can quite easily find the minimum number of
taps necessary to achieve this - just use some software and keep
increasing the number of taps until you get there. Some software will
provide you with an estimated number of taps required fulfil your
requirements - this is a good starting point, but go lower as well as
higher from this, and remember that even or odd number of taps can make
a significant difference. I would definitely recommend ScopeFIR
software for this process, although it does have a couple of
limitations: unless registered you can only export the coefficients for
up to 32 taps, and you can't process audio with it - so you have to put
the coefficients into something else to preview your filter with your ears.
I think with a bit of experience a graph will give you a good idea how
it will sound. In my case (since I had absolutely no experience with
DSP filters) I was trying different things and listening to the results.
What I found in this specific case was that less taps produced a 'nicer'
sound. I wrote in my previous post that I thought this had something to
do with the fact that the phase didn't keep oscillating back and forth
between -180 and 180 in the passband. However, having thought about
this some more I realise this is nonsense. The graphs of FIR filters
generally show a sawtooth pattern for the phase in the passband. This
is simply the time delay introduced by the filter taps - the phase shift
that a particular delay introduces varies linearly with frequency - in
other words there isn't any phase distortion.
So the only factor why it sounded nice must have been that it had a very
gentle amplitude roll-off compared to higher order filters. This fits
with my experience with analog EQ: that I almost always prefer the sound
of EQ with a very gentle, wide curve (although of course with analog
EQ/filters there is phase distortion going on as well).
I didn't mind the fact that the filter makes sounds with high frequency
content sound a bit 'muffled', since in this specific application people
can just switch to 48kHz mode if they want good wideband frequency response.
I guess in most modern applications my 9-tap filter would not be
considered adequate. But then again the bandwidth of much old analog
gear (that people still love and use to this day) would not be
considered adequate by modern standards. Poor frequency response and
other forms of distortion and instability are not always a bad thing :)
Seb
More information about the Synth-diy
mailing list