Filter design is the process of designing a signal processing filter that satisfies a set of requirements, some of which may be conflicting. The purpose is to find a realization of the filter that meets each of the requirements to a sufficient degree to make it useful.
The filter design process can be described as an optimization problem where each requirement contributes to an error function that should be minimized. Certain parts of the design process can be automated, but normally an experienced electrical engineer is needed to get a good result.
The design of digital filters is a deceptively complex topic. Although filters are easily understood and calculated, the practical challenges of their design and implementation are significant and are the subject of advanced research.
Typical design requirements
Typical requirements which are considered in the design process are: The filter should have a specific frequency response The filter should have a specific phase shift or group delay The filter should have a specific impulse response The filter should be causal The filter should be stable The filter should be localized (pulse or step inputs should result in finite time outputs) The computational complexity of the filter should be low The filter should be implemented in particular hardware or software
The frequency function
An important parameter is the required frequency response. In particular, the steepness and complexity of the response curve is a deciding factor for the filter order and feasibility.
A first-order recursive filter will only have a single frequency-dependent component. This means that the slope of the frequency response is limited to 6 dB per octave. For many purposes, this is not sufficient. To achieve steeper slopes, higher-order filters are required.
In relation to the desired frequency function, there may also be an accompanying weighting function, which describes, for each frequency, how important it is that the resulting frequency function approximates the desired one. The larger weight, the more important is a close approximation.
Typical examples of frequency function are: A low-pass filter is used to cut unwanted high-frequency signals. A high-pass filter passes high frequencies fairly well; it is helpful as a filter to cut any unwanted low-frequency components. A band-pass filter passes a limited range of frequencies. A band-stop filter passes frequencies above and below a certain range. A very narrow band-stop filter is known as a notch filter. A differentiator has an amplitude response proportional to the frequency. A low-shelf filter passes all frequencies, but increases or reduces frequencies below the shelf frequency by specified amount. A high-shelf filter passes all frequencies, but increases or reduces frequencies above the shelf frequency by specified amount. A peak EQ filter makes a peak or a dip in the frequency response, commonly used in parametric equalizers.
Phase and group delay
An all-pass filter passes through all frequencies unchanged, but changes the phase of the signal. Filters of this type can be used to equalize the group delay of recursive filters. This filter is also used in phaser effects. A Hilbert transformer is a specific all-pass filter that passes sinusoids with unchanged amplitude but shifts each sinusoid phase by ±90°. A fractional delay filter is an all-pass that has a specified and constant group or phase delay for all frequencies.
The impulse response
There is a direct correspondence between the filter's frequency function and its impulse response: the former is the Fourier transform of the latter. That means that any requirement on the frequency function is a requirement on the impulse response, and vice versa.
However, in certain applications it may be the filter's impulse response that is explicit and the design process then aims at producing as close an approximation as possible to the requested impulse response given all other requirements.