[sdiy] IIR and FIR for bandlimited waveforms (or BLEPs?)
Olivier Gillet
ol.gillet at gmail.com
Thu Jan 6 18:19:46 CET 2011
> The typical bandlimited square wave (perhaps built by additive synthesis from a harmonic series of sinewaves) has little ripples before and after each abrupt edge. There's a name for them which presently escapes me, but it doesn't matter.
It's called the Gibbs phenomenon.
> The point is that the ripples are symmetrical in time, before and after the edge. This is similar to a FIR lowpass filter (say, a windowed sinc pulse) which also has this same symmetrical arrangement of ripples. And lo and behold if you feed a naive square wave through the FIR filter, you get the bandlimited squarewave with symmetrical ripples.
You get the bandlimited squarewave... with a delay! This would be very
uncanny indeed if the filter "knew in advance" that there was going to
be a sharp edge and the ringing/smoothing started *before* the edge.
> Now, the reason this is important is because the typical analogue filter doesn't give this behaviour. If I were trying to sample a bandlimited squarewave, I could start with a non-bandlimited squarewave from the oscillators in my Pro-One, and then I could filter it using the 24dB/oct filter. This produces a bandlimited squarewave which I'd be safe to sample without aliasing, but it doesn't look like the "symmetrical ripples" version. In fact, it looks more like the result you'd get from feeding a naive squarewave through an IIR filter, rather than an FIR, which is logical enough.
The filter doesn't "know in advance" there is going to be a sharp edge
so it can't ring/smooth before the edge!
The FIR / IIR dichotomy isn't the right way at looking at the problem,
since you could very well take the impulse response of a low-pass IIR
filter, truncate it after 1M samples where it has reached zero values
and tada, you have a FIR. I mean, what you observe is not intrinsic to
one method being a FIR and the other being an IIR. What you observe is
due to one filter being ideal/non-causal, while the physical filter
being, well, physical, hence causal. They differ in the way they mess
up with time and hence with... phase! The ideal low-pass has a
harmless phase response, which is why you get exactly the same thing
(symmetrical ringing at the edge) as with a truncated additive series.
But a physical, actual low-pass must either incorporate a huge delay
or mess with the phase, which explains the differences in waveforms.
Now, you could very well take the (non-causal) response of an ideal
low-pass (sinc), do a minimum-phase reconstruction on it -- which is
very roughly a way of "causalizing" a filter response in such a way
that it mess as little as possible with the phase response -- and
you'd get a result closer to the results observed on your Pro-one.
First graphs: waveforms built upon a minimum phase reconstruction of a
band-limited pulse ; second graphs: waveforms built upon an ideal
(non-causal) band-limited pulse.
http://img714.imageshack.us/img714/130/picture1jx.png
> Either version of the bandlimited squarewave would be suitable for sampling without any risk of aliasing. So could I use a BLEP algorithm to make a squarewave, but instead of using a FIR filter to produce the bandlimited steps, use an IIR?
As long as you adhere to the "ear isn't sensitive to phase" theory, yes.
Olivier
More information about the Synth-diy
mailing list