There exists a widespread belief that digital low-pass filters introduce an audible ringing effect when applied to music. We investigate the phenomenon.
From the ADC capturing a performance to the DAC reproducing it, digital audio involves the use of various filters. Virtually inescapable are the low-pass filters used in both ADCs and DACs using sigma-delta designs. Some say these filters are detrimental to the sound quality because of their ringing. Looking a little closer, we shall find that this is not necessarily true.
What is ringing?
In digital signal processing, filters are often specified through their impulse response, the result of applying them to a single-sample pulse surrounded by zeros. The impulse response of a typical low-pass filter, see figure 1 below, consists of a central peak with diminishing ripples extending to either side. These ripples are what is sometimes referred to as ringing. The contention from some audiophiles is that when such a filter is used with music, the ringing manifests in audible ways, the portion preceding the main peak being deemed especially harmful.
The impulse response in figure 1 is that of a low-pass filter with a cut-off frequency of 1/16 of the sample rate. The ripples can be seen to have a period of 16 samples. This turns out to be a general property of such filters. The ripples always occur at the cut-off frequency of the filter. For audio applications, this frequency is 20 kHz or higher and thus inaudible to humans. There is, however, some fear and speculation that it might nonetheless be perceptible. To be on the safe side, we would thus like to eliminate the ringing entirely.
A low-pass filter such as the one shown above is an example of a linear system. This means that its effect on a signal is equivalent to multiplication in the frequency domain. The magnitude of any frequency in the output is obtained by multiplying the magnitudes of the same frequency found in the input signal and in the impulse response of the filter. Since the ripple, or ringing, occurs at the filter cut-off frequency, it follows that in order to show up in the filtered output, this frequency must be present in the input signal. A linear system can never conjure spectral content out of thin air. This is demonstrated below.
To validate the assertion that a low-pass filter will not ring if the input already has no spectral content at the cut-off frequency, we require a band-limited test signal with a pulse-like shape that will reveal any added ringing. Such a signal is shown in figure 2.
Unlike an ideal impulse, which consists of a single non-zero sample, this pulse has a width at its base of about 20 samples. This allows its bandwidth to be suitably constrained.
As we can see in figure 3, the frequency content of this pulse stops just short of 1/4 of the sample rate. Higher frequencies, up to the Nyquist limit of half the sample rate, are virtually absent.
Filtering above the band limit
With the pulse described above, we should be able to apply a low-pass filter at 1/4 of the sample rate without any ringing being introduced. The impulse response of such a filter is shown in figure 4 and its frequency response in figure 5.
The impulse response has plenty of ripple with the predicted period of 4 samples. If this gets added to the test pulse, it should be easily noticed. Figure 6 shows the result of this filtering operation.
The output looks exactly the same as the input. In fact, at the resolution of these graphs, not a single pixel differs. Despite the appearance of the impulse response, no ringing whatsoever is present in the output.
Filtering below the band limit
Applying a low-pass filter above the band limit of a signal is of course pointless, so next we test a lower cut-off frequency with our pulse signal. The impulse response of a filter with a cut-off frequency of 1/16 of the sample rate has already been shown in figure 1. Its frequency response can be seen in figure 7.
This is not a particularly impressive filter, but for illustrative purposes it will do. Applying it to the test signal produces the output shown in figure 8.
Some ringing is now apparent. This is expected since the input signal has a fairly high level of spectral content at the cut-off frequency.
Filtering below a lower band limit
What of frequency components in the input signal above the filter cut-off? Might they trigger the ringing? As discussed previously, a linear filter can only attenuate or amplify frequencies already present in the input. Therefore, spectral content above the cut-off should not be able to cause ringing. In order to test this, we can mirror the spectrum of the band-limited pulse by inverting the sign of every other sample. This produces the signal shown in figure 9, its spectrum in figure 10.
Applying the low-pass filter from figure 4 to this signal produces the most boring of graphs, a perfectly straight line, in figure 11.
Note that the full vertical scale in this graph corresponds to less than one LSB at 24-bit precision. Clearly, input frequencies above the cut-off do not cause ringing in the filtered output.
Filtering at a gap in the spectrum
Low-pass filters like the ones above are an integral part of any oversampling DAC. Doubling the sample rate creates a mirrored image spectrum between the original Nyquist frequency and the new upper limit. This image must be removed using a low-pass filter. The test pulse we created has a spectrum ending a little below 1/4 of the sample rate. If we set every other sample to zero, we obtain a signal that retains the original spectrum while adding a mirror image, see figures 12 and 13.
This construct serves as a model for a 2x oversampling as might be performed in a DAC. The low half of the spectrum is that of the input signal while the high half is the undesirable image. To get rid of the image, we need to apply a low-pass filter at 1/4 of the sample rate. Since the signal, including the mirror spectrum, has no content in the vicinity of the filter cut-off, we expect the output to exhibit no ringing. As figure 14 shows, this is indeed the case.
This looks very much like the original test pulse. The observant reader may notice that although the shape is unchanged, the height has been reduced to half. This is the result of us zeroing half the samples. It should be pointed out that vertical scaling in an analysis such as this is irrelevant. Since we are dealing with linear systems, we can obtain any scale we desire simply through multiplying by a constant factor.
The properties demonstrated above lead to an important realisation. Ringing from oversampling filters in DACs is eliminated entirely if the input signal has a little margin between its highest frequency component and the Nyquist limit of half the sample rate. Contrary to certain claims, the filter characteristics can be decided entirely at the production end without the need to impose an end to end architecture on the full chain from recording to playback. All it takes is sacrificing a little bandwidth at the top of the spectrum. If recording at 96 kHz or higher, this is hardly of any concern.
Testing on a DAC
We can measure the analogue output of a real DAC to verify that the ringing from its oversampling filters can indeed be eliminated. First we capture the impulse response using a single-sample pulse.
As seen in figure 15, the impulse response of this DAC has the familiar ringing pattern. Playing the band-limited pulse should, according to the theory, result in an analogue output free of ringing. This is shown in figure 16.
No more ringing. Due to the reduced high-frequency content of this pulse, it is much wider than the main peak of the impulse response. More importantly, however, the oversampling filter in the DAC has not caused any hint of ringing. This shows that with a band-limited input, DAC filters do not cause ringing.
In summary, we have demonstrated that ringing effects from oversampling filters can be eliminated by leaving a small margin above the highest frequency in a recording. Depending on the sample rate used, the filters needed to create this headroom may of course result in some ringing of their own. However, this is fully under the control of the producer. Even a very steep linear phase filter with long ripple tails will not add to whatever ringing, if any, is present in the distributed file. If the goal is to avoid ringing from DAC filters, it can be achieved entirely in the studio. Nothing needs to change at the playback end.
One Reply to “Filter ringing”
Which …. is why it’s advantageous to capture and deliver audio at sample rates somewhere north of 44.1.