Next: , Previous: Tutorial, Up: Tutorial


2.1 Filter Design

In this section, we briefly review basic concepts about filters and filter design.

A filter is a signal-processing system that is meant to modify certain frequencies relative to others. For example, the “tone” control in your CD player is a filter that modifies the relative level of high and low frequencies. It is not fruitful for us to specify more precisely which systems are filters and which are not; the important point is that, in a filter, we mostly care about how the filter reacts to different frequencies.1

Researchers have identified many classes of useful filters, and in addition, any given filter can be implemented using a variety of technologies. For example, an old CD player might implement the tone control by means of resistors or capacitors, but a new CD player likely implements the filter in software. In this manual, we do not worry about the implementation technology, and we view the filter as a black box that inputs a certain signal x(t) (a function of time), and outputs another signal y(t).

gmeteor designs a specific class of filters, namely, linear time-invariant discrete-time linear-phase filters with a finite impulse response (FIR). For these filters, the time variable t is an integer, and the input and output signals can be viewed as equispaced samples of a continous signal. Other classes of filters are also important and useful, but we do not worry about them here, because gmeteor only knows about FIR filters.

A FIR filter can be described by a sequence of l real numbers h[0], h[1], ..., h[l-1], called the impulse response of the filter. The number l is called the filter length. The relation between the input and the output is expressed by the following formula. y[t] = SUM FOR i = 0 TO l - 1 OF h[i] * x[t - i]

(This kind of expression is usually called a (linear) convolution.)

The filter coefficients h[i] uniquely determine the frequency response H(f) of the filter, which is a complex function of the frequency f. The frequency response is important because of the following two facts. First, every “interesting” signal can be decomposed into a (possibly infinite) sum of sine waves. Second, a FIR filter transforms a sine wave into a sine wave of the same frequency. If the input sine wave has amplitude 1 and frequency f, the output sine wave has frequency f, amplitude |H(f)|, and its phase is shifted by arg H(f) with respect to the input signal. Consequently, by selecting H(f) appropriately, we can design a filter that modifies frequencies in any way we desire.

The function H(f) is the discrete-time Fourier transform of the filter coefficients, and well-known ways exist to compute the frequency response from the filter coefficients and vice versa. Unfortunately, it turns out that most frequency responses can only be implemented with a filter of infinite length. If we are to implement these filters in practice, we must settle for an approximation of the desired frequency response. The filter design problem is therefore the problem of finding a “good” approximation to the desired H(f) with a finite (and hopefully small) filter length.

With gmeteor, you address the filter design problem by specifying constraints on the desired frequency response and possibly on its first and second derivatives. gmeteor then finds the coefficients that best approximate these constraints. More precisely, gmeteor designs optimal filters in the Chebyshev sense. (The precise mathematical description the problem solved by gmeteor is given in Optimal Filters.) The rest of this chapter explains the various kinds of constraints that gmeteor supports, what they mean, and how to specify them.


Footnotes

[1] In the same way, the meat of a pig becomes “pork” only if you intend to eat it, and it is not fruitful to argue about the precise time when the pig becomes pork.