Noise shaping is the process of changing the frequency content of the errors in the digitally recorded signal introduced during quantization.
Recording the signal digitally is called quantization. Quantization, due to limitations in digital formats, introduces errors – differences between the actual value of the signal and the recorded value of the signal (quantization is explained in the topic on Dithering; as an example, consider that CD quality audio uses a sampling resolution that allows the recording of information only with integer numbers between -32768 and 32768 and, if the true value of the signal is 5.1, it will be recorded as 5, introducing an errors of 0.1).
The errors introduced into the signal are a signal in themselves, with specific frequency content. The purpose of noise shaping is to change this frequency content, usually to reduce the magnitudes of frequencies that are inside the interval, where the ear is most sensitive (e.g., between 1 KHz to 5 KHz). Noise shaping is typically applied with dithering – the process of making quantization errors non-systematic by introducing random changes to the errors. The purpose of noise shaping here is similar, to change the frequency content of the errors, which is known as dither coloration.
An example of noise shaping
Noise shaping can be applied during quantization when the error is known. Suppose that the signal x_{0}(k) is to be quantized as the signal x(k) and the error before any noise shaping is ε_{0}(k).
We can apply any filter on the error ε(k) and create a new quantized value X(k), such as the following.
We can recognize that the new error ε(k) is computed with the impulse invariant second order low pass Butterworth filter.
After an inverse Laplace transform and the Z transform, the filter above, for example with the cutoff frequency ω_{c} = 0.6 and the sampling frequency 2000 Hz, is
In practice, it is more common to reduce computations by using
where a(n) are some filter coefficients for the filtered error. In the simplest case, consider that the formula
translates to the error terms being computed as in
This is essentially the first order impulse invariant low pass Butterworth filter with cutoff frequency ω_{c} = 1.