Ringing False: Digital Audio's Ubiquitous Filter How The Filters Were Designed

Sidebar 1: How The Filters Were Designed

Fully featured software dedicated to the design of digital filters is expensive and, even so, not best adapted to creating the type of filter required for this project. The method I used is cheaper and more flexible but demands some mathematical background and the ability to write executable computer code. It also requires Iowegian's ScopeDSP, an inexpensive ($60) FFT utility ideally adapted to this type of work. For those who would like to experiment along similar lines, here's a brief outline of the design process so you understand what you're getting into.

First you need to know the filter's transfer function: the equation that relates output to input. In effect, this means simulating one of the classic analog filter alignments: Butterworth, Chebyshev, Inverse Chebyshev, or Elliptical. Next you must write a software utility that calculates the real and imaginary components of this transfer function at the frequency steps demanded by the required filter length (usually a power of two) and sampling frequency, and write these values to a text file in the correct format for ScopeDSP to read. (If you're already lost by this point, you're going to have to read up on complex numbers and FFT theory before you're equipped to undertake this.) By simple manipulation of the real and imaginary components, additional text files can be written at the same time to contain the data for linear-phase and all-pass equivalents.

Once the text file has been imported into ScopeDSP and the correct sampling rate specified, the equivalent impulse response can be created by performing an inverse FFT—a single mouse click. These data are then exported to create the coefficients of the digital filter. (Hint: Performing an FFT on the impulse response will return you to the frequency domain and show the actual performance of the filter using these coefficients. If the response is unacceptable, try again using more coefficients.)

To create the final filter coefficients, all that remains is to reorder them if necessary and normalize them so that they sum to unity (1). You will probably have to write another software utility to achieve this, and yet another to reverse the coefficients if you wish to generate a maximum-phase filter from a minimum-phase one. More code will also be required to calculate the ScopeDSP input data for an interpolated response between linear phase and minimum phase. Once again, to achieve this you will need a sound working knowledge of complex numbers and a good understanding of filter behavior.

Last but not least, the filter(s) must be applied to the audio source material using convolution software. I haven't looked, but I imagine that inexpensive convolution code able to handle 24-bit/96kHz WAV files and apply correct dithering to the output is thin on the ground, so again, you may have to write your own (as I did). Standard convolution will suffice; FFT convolution is faster for longer filters but requires much more complex code. It goes without saying that care should be taken to verify the results every step of the way.

All told, this is no project for the faint-hearted.—Keith Howard

Share | |
Site Map / Direct Links