Digital Audio: Part 17 - Filters And Stability

The recursive filter has the advantage of using less hardware, but is more complex to understand.

As has been seen, the FIR filter is characterized by applying a window to the incoming sample stream that is fixed in size by the design of the filter. Samples outside that window are ignored. The FIR filter contains only forward paths and must be unconditionally stable as a result.

When considering stability, there are two meanings associated with the word. One of them refers to dynamic stability, which means that a filter should neither turn into an oscillator nor run up to an end stop. The other meaning refers to long-term stability, which is the way a filter maintains its response in the presence of component drift. Clearly in a digital filter there is no component drift and stability refers to dynamic stability.

The Infinite Impulse Response (IIR) filter uses recursion so that the present output is determined by all previous outputs as well as by the input. Fig. 1 shows a digital integrator. The output of the adder is stored for one sample period and presented to one of the adder's inputs. Obtaining a delay of one sample period is trivial in the digital domain. The output of the integrator is essentially the sum of all the sample values that have ever been input.

As audio signals are bipolar, all audio signals should integrate to a value of zero. If they do not, they must contain an offset. Editing between clips having different offsets causes thumps or transients at the edits. The integrator can be used in a feedback loop surrounding an ADC. In the event that the integral of the samples is non-zero, this can be fed back into the ADC in such a sense that the offset is diminished.

Fig. 1 also shows that the impulse response, the response to inputting a single non-zero sample value, is a step. After inputting that single impulse, the value of the step is maintained indefinitely; hence the system has an infinite impulse response.

In the analog domain it is difficult to make an ideal integrator because leakage currents will affect the charge on the integrating capacitor. The digital integrator has no such problem and digital techniques were first applied to systems that depended on accurate integration, such as inertial navigators, where integrator drift results in a position error.

On the other hand if an analog integrator is modified by the deliberate inclusion of a leakage path, the impulse response still begins with a step, but it will be followed by the exponential decay of the capacitor voltage. 

Fig.1 - A digital integrator adds together every sample value received. The impulse response of an integrator is a step that is maintained indefinitely.

Fig.1 - A digital integrator adds together every sample value received. The impulse response of an integrator is a step that is maintained indefinitely.

Fig.2 shows a recursive system in which there is a multiplier in the recursion path that multiplies the feedback by 0.5. The impulse response is shown. The first sample will have the same value as the input, but the next one will be half of that, the next one a quarter and so on. The impulse response is the same as that of an analog RC network, which is an exponential decay.

This highlights another difference between FIR and IIR filters. The FIR filter can have absolutely any impulse response that will fit within the window, because the coefficients come from a look-up table or memory, whereas the IIR filter is restricted to responses that can be computed using recursion. In practice this is not really a problem for a lot of audio applications, since analog audio filters were restricted in the same way. The traditional equalizing that was done in analog audio using RC networks and operational amplifiers can all be replicated using IIR filters.

In the traditional analog domain, a given filtering action had to be implemented in specific hardware, some of which acquired legendary status on account of the pleasing results. With the advent of digital technology such filters can be replicated in the digital domain. It is only necessary to test the original device and to measure its impulse response in all meaningful configurations, and that impulse response can be sampled and incorporated into any digital filter.

Instead of purchasing the physical filter, which could well be in limited supply, the audio engineer instead purchases the software that allows the response of the filter to be obtained in his computer. The traditional effects rack has become virtual.

The bass and treble controls of the Baxandall type fitted to many audio preamplifiers can be implemented with IIR filters, as can the presence control found on many mixing consoles, which is effectively a band-pass filter operating in the midrange.

As IIR filters are suitable for most audio applications, FIR filters tend to be reserved for special applications such as sampling rate conversion. Sampling rate conversion is meaningless in the analog domain, which is why FIR filters only became important with the use of sampling and digital techniques, and especially important when dealing with sampled images.

Fig.2 - A recursive filter whose impulse response is an exponential decay.

Fig.2 - A recursive filter whose impulse response is an exponential decay.

IIR filters are causal and the impulse response is always asymmetrical, just like that of analog filters. When the impulse response is convolved with a low frequency sine wave, the area of overlap is the area of the impulse, whereas in the case of a high frequency the area of overlap falls. The falling overlap area as a function of rising frequency is characteristic of a low-pass or lag filter.

Figs. 1 and 2 show a hardware implementation on the grounds that it is easier to follow. In practice the calculations may be done in a general-purpose processor that might be found in a laptop computer and controlled by software. Processors may also be optimized for such filtering are then known as digital signal processors (DSP).

IIR filters are not necessarily stable. The recursion is analogous to feedback, and there is not much difference between a high-Q filter and an oscillator. The filter must be precise enough that the difference is maintained in practice and not just in theory. All digital filters use quantized data of finite accuracy and coefficients of finite accuracy. An exponential decay will eventually result in values that are so small that they are of the same order as quantizing intervals.

Digital filters use multipliers and the result of a multiplication is, except for special cases, word length extension. In a recursive filter, the sample value passes through endless multiplication processes, each one of which causes word length extension, and so on that basis an IIR filter requires infinite word length. In practice this is not true because there is no point in providing a noise floor that is lower than that of any input signal.

Fig.3 - a) A lead filter controlled by coefficients K1 and K2. b) With K2 set to zero, the system becomes an integrator. c) With K2 set to unity, the system becomes a high pass filter.

Fig.3 - a) A lead filter controlled by coefficients K1 and K2. b) With K2 set to zero, the system becomes an integrator. c) With K2 set to unity, the system becomes a high pass filter.

As quantizing error is bipolar, a very small signal may be bigger than it should be after quantizing. The result may be that the exponential decay does not go on indefinitely, but enters an oscillatory sequence known as a limit cycle. The problem can be overcome by using digital dither, which converts quantizing distortion into low level random noise, and which is subjectively preferable to a limit cycle.

A filter having a constant response is relatively straightforward, as the coefficients never change, but in many cases, such as in a mixing console, the response needs to be variable. In an analog console, the controls cannot be moved faster than the operator's hands, and no difficulty arises. However, in a digital filter the coefficients could in principle be changed in one sample period.

A large change in a coefficient would result in a transient being created in the audio. It is therefore usual to have filters in the coefficient paths so that they cannot change too quickly.

Another problem met with digital filters that has a direct parallel with the analog world is the internal overload, where a filter clips prematurely because signals inside it are larger than the input or output signals.

This will be found, for example, in causal constant voltage loudspeaker crossovers where the outputs must exceed the input level near the crossover frequency in order to add back to the input signal. This arises because the outputs are not in-phase.

If an overload causes the calculated value to exceed the range allowed by the word length, many processors will wrap around such that the output changes polarity. This can result in large audible transients, but it can also cause high level limit cycles. The digital processes used in filters should be designed so that they cannot wrap around. Instead an overload condition should result in the output of the process being forced to maximum positive or maximum negative, simulating the clipping of an analog system.

Instead of adding samples to form an integrator, it is also possible to differentiate by subtracting successive samples. In this case a delay of one sample period allows successive samples to be presented to a subtractor. Fig.3 shows a hardware configuration that is controlled by the coefficients K1 and K2. When K2 is zero, the system is a differentiator. When K2 is set to unity, the system becomes a high pass filter.

Broadcast Bridge Survey

You might also like...

Expanding Display Capabilities And The Quest For HDR & WCG

Broadcast image production is intrinsically linked to consumer displays and their capacity to reproduce High Dynamic Range and a Wide Color Gamut.

NDI For Broadcast: Part 2 – The NDI Tool Kit

This second part of our mini-series exploring NDI and its place in broadcast infrastructure moves on to exploring the NDI Tools and what they now offer broadcasters.

HDR & WCG For Broadcast: Part 2 - The Production Challenges Of HDR & WCG

Welcome to Part 2 of ‘HDR & WCG For Broadcast’ - a major 10 article exploration of the science and practical applications of all aspects of High Dynamic Range and Wide Color Gamut for broadcast production. Part 2 discusses expanding display capabilities and…

Great Things Happen When We Learn To Work Together

Why doesn’t everything “just work together”? And how much better would it be if it did? This is an in-depth look at the issues around why production and broadcast systems typically don’t work together and how we can change …

Microphones: Part 1 - Basic Principles

This 11 part series by John Watkinson looks at the scientific theory of microphone design and use, to create a technical reference resource for professional broadcast audio engineers. It begins with the basic principles of what a microphone is and does.