Audio Basis - articles about audio
Probably, you have heard not once about the ringing in audio. It’s a type of distortion. The ringing does not look good at plots. It may be clearly visible for musical instruments with a sharp attack: piano, guitar, drums, etc. What is audio ringing? Why it appears? Is it true that bad for sound quality? Should we reduce this artifact? Keep reading.
Ringing audio is artifacts of the output response of an audio device or a DSP algorithm (software/firmware), which is caused by input signal. These artifacts look like damped oscillations.
The reference input signal for ringing measurement is delta pulse (Dirac delta function).
In the theory, it's a signal with infinite high amplitude during an infinitely short time.
For digital-system measurements, that test pulse is 1 sample with maximum amplitude.
Analog input test pulse should have minimum durations that tend to be zero.
The ideal output signal should be similar to the input signal.
But elements of the system have digital filters and/or feedback.
Ringing in simple words
Let's imagine a security box with a transporter in an airport.
If we put a metal cube on the band at the box input, at the output we should get the cube. It's the ideal system.
If inside the box, hit the cube with a metal hummer, at the output we get the sounding cube. It will sound some time. And. it's a real system.
Ringing is output oscillations, that should not be for an ideal audio system.
In the time after the input pulse (see drawing above), we can observe post-ringing. It's like an "echo".
In the time before the input pulse, we can observe pre-ringing. It's like a "backward echo".
We put a 1-sample pulse on a filter input. At the filter output, oscillation happens.
The ringing frequency is the oscillation frequency.
The filter has some magnitude-phase (level-time delay) response for an input sine.
Magnitude-phase responses for all input sines are called "magnitude-phase response of filter".
It shows what frequencies filter pass or suppress.
The magnitude-phase response of the filter defines the oscillation frequency.
A digital filter unit can cause ringing.
If we consider filter as a unit, it has 1 input and 1 output.
A digital signal comes to the input. And other signal exists from the output.
Actually, filter catches several samples at the input.
After it, the unit:
I.e. the filter inputs slide along the processed samples of the input signal.
As we told above, to calculate an output sample, a digital filter takes several sequential input samples. The maximum amplitude at the output rise when the pulse's sample will at the middle of the inputs (taps). It's shown in the picture below (time N).
So, we can consider time N as a moment of pulse rising at the output.
But in previous moment time 1, when pulse's sample comes to the most left input with minimum gain, non-zero level rise at the filter output.
So, we can view the non-zero output level by the input pulse, before it comes to output in maximum level (time N).
When the pulse's sample comes to the second input with higher gain, it produces a higher non-zero output level (time 2). And, same way, up to time N when pulse achieved tap with maximum gain.
Oscillations (distortions) at the output [before actual pulse moment (time N)] are called as pre-ringing.
Post-ringing is the opposite effect. When pulse moves from the input with maximum gain to the most right input with minimum gain, non-zero levels rise at the filter output.
It happens after pulse's actual moment at the output (time N). I.e. already no signal at the output, but oscillations, still, are there.
From an analog-system point of view, pre-ringing is a "strange" issue enough.
Still no signal but its artefacts are there.
To solve the issue, a minimum phase filter was invented.
However, minimum phase filter have own issues.
Minimum vs linear phase filter
|Magnitude-frequency response||identical for both ones|
|Post-ringing energy||Higher than post-ringing energy of linear phase filter|
A minimum phase filter has a non-linear phase into the passband. Non-linearity degree depends on filtering unit implementation.
For example, we consider a low-frequency filter, that is very popular in audio. Other filtering types have same properties.
Low-frequency filter has passband at low frequencies and stopband at high ones.
Between these bands, transient band is placed.
To keep the maximum signal band after resampling, the transient band should have zero width.
But the band minimization requires more taps (see above: filter inputs). And higher tap number causes the longer length of ringing (see picture "Ringing audio of linear phase filter").
It is fairly for the minimum phase one too.
When the audio system (digital or analog) has a flat amplitude-frequency response from 0 to Infinity Hz, no ringing is there.
Many sampling rate conversion algorithms use resampling filters.
For the qualitative rejection of conversion artefacts and minimum losses of the passband width:
Sharpness (width) of the transient band depend on the suppression level at stopband. The suppression level defines distortion level into useful (including audible) band after resampling.
But filtering unit with narrower transition band (higher its sharpness) has higher energy of the ringing oscillations out of the time of input pulse.
NOTE: these bandwidths of a digital filter are considered in relative coordinated. As rule, total bandwidth is considered as 1.0. And the bandwidths are in range 0.0 ... 1.0.
The widths and ringing lenght (in samples) don't depend on sample rate.
The author has no information about proper studies of real ringing effect in low or high pass and other filters impact to sound quality.
In the general case, ringing is not so scary, as it seems at the response to the pulse plot.
To achieve this effect, the difference between neighbor samples should be close to maximum possible value.
But, in most cases, the difference is too small.
And the ringing level is very low too.
For sharp-attack waveforms (piano, guitar, drums, etc.), ringing may be visible even.
Anyway, high resolution of musical signals allows using a wider transient band and keep artefact suppression.
The actual audible range is up to 20 kHz. High resolution has a higher band.
So resampling and other filters may start transient band from 20 kHz.
A higher sampling rate allows to reduce the sharpness of the transient band and keeps stopband.
Lesser sharpness reduces tap number and ringing.
How to reduce ringing in circuit of filter? Which filter does not produce ringing effect?
Audio device and software designers strive to reduce or rid of the ringing.
One of the examples is an apodizing filter. For input pulse, it should provide output response without oscillations. As example, it may be implemented as some expanding of the pulse in time at the output.
However, the backside of the improvement is the lesser sharpness of the transient band. In some cases, it can cause audible aliases due to sampling rate limitation. However, high-resolution may solve (or partially solve) sharpness-aliases issue.
In digital filtering, ringing audio is unavoidable artefacts. Only filter optimization may be applied to save balance between:
The author knows nothing about proper researches of ringing impact to sound quality.
In majority of musical signal types, ringing levels are below noise floor. And we don't even have consider the artefacts there.
In general case of audio device/software design, ringing-audio reducing may be recommended.
Author: Yuri Korzunov,
Audiophile Inventory's developer
In electrical and electronical circuits, all conductors (wires) have physical sizes. It causes unwanted capacity and inductance. It may cause ringing for transient processes (oscillations or "the ringing") when electrical voltage in the circuit is changed.
Any filter has transient processes at output when input signal is changed. In instance, input sine changes amplitude or frequency.
However, pre-ringing is digital filter feature only.
Ideal low-pass filter is so-called "brickwall" filter. Such filter has no transient band.
If you want to reduce ringing energy, you're need to expand transient band.