Sound source equalization

Ssource measurement

Some applications - notably speech intelligibility measurements - demand that a sound source emit a signal with a precisely defined spectrum. Dirac 6 contains the necessary tools required to equalize a sound source and to generate such signals.
However, having the tools is not enough. Knowing how to use them is equally important. Here you will find an overview of the signal shaping procedure, and a fully worked out use case provided by Mr. Alastair Gurtner.

The central tool in the equalization procedure is the Shaping Filter Designer (SFD), which is available on the Process menu. In a typical usage scenario, the input to the SFD is the impulse response of a loudspeaker, while the output of the SFD is a FIR filter that can shape a signal through convolution. If the impulse response of a loudspeaker can be seen as a filter that is applied to the signal that is fed into the loudspeaker, then the output of the SFD is the inverse filter that can be used to flatten the response of the loudspeaker, or even to impose a specific spectral shape on the output.

To illustrate this, the image below displays the frequency response of the Echo speech source, measured in an anechoic chamber.

Loudspeaker frequency response

With this impulse response loaded, the SFD is executed with the following setup:

SFD dialog

The resulting inverse filter is displayed as (magenta) overlay in the image below:

Inverted response

To show that the inverse filter works, we can convolve it with the original impulse response, using the Convolve option on the Process menu. The result should be a flat frequency response.

Flat response

Any signal that is convolved with the inverse filter and fed into the loudspeaker will retain its spectrum. The filtering performed by the loudspeaker is counteracted by the inverse filter.

If we remove the smoothing and zoom in on the y-axis we see the following:

Unsmoothed response

This result may not be as flat as expected at first sight. The discrepancy from a perfectly flat response is caused by the 1/12-octave smoothing that was set in the SFD dialog.

In theory it is possible to create a perfect inverse filter that would result in a perfectly flat response. However, a loudspeaker is a non-linear element which will not respond in the same way to all inputs. Indeed, using an input signal with a sharp peak where the loudspeaker response shows a sharp valley, will in many cases not have the desired result. Instead, the valley in the loudspeaker response may simply 'shift' to a slightly higher or lower frequency. In effect, the loudspeaker's response depends, to a certain extend, on the signal that is applied.

By smoothing, we remove the sharpest peaks and valleys that are difficult to correct, and would only lead to excitation signals that are impossible to reproduce for the loudspeaker. In practice this technique gives very acceptable and robust results.

The non-linear character of the loudspeaker's response often calls for an iterative approach to equalization. In each iteration the response of the loudspeaker is measured again based on the equalization constructed in the previous step. The discrepancies between the actual and the desired response are then used to adjust the SFD shape table.

It is also possible to impose an extra shape on the filter, and thus on the filtered signal. For instance, in the SFD setup below a shape is specified that raises the response by 12 dB in the frequency range from 1 kHz to 2 kHz.

SFD shape table

Convolving the resulting filter with the loudspeaker's impulse response results in a raised level between 1 and 2 kHz as specified.

Raised level

This shaping can be extended such that, for example, the loudspeaker emits an IEC 60268-16 compliant male or female spectrum.

Loudspeakers have a limited frequency range, and they are not able to reproduce an (equalized) signal with a spectrum as shown above. In general, the loudspeaker will not be able to handle very low and very high frequencies.
The equalization procedure will tend to create inverse filters that have a very high gain at the low and high ends of the spectrum, and thus a lot of energy can be wasted in driving the loudspeaker beyond its capabilities.
In most cases, particularly for speech signals, a wide bandwidth is not required, and it is helpful to disregard or suppress the parts of the spectrum outside the area of interest.
The bandlimiting option in the SFD dialog will suppress the parts of the spectrum that are of no interest. Note that the transition of the limiter is very sharp, and a similar effect can be reached by incorporating the bandlimiting in the shape table.

Use case
A fully worked out example, including excel templates for the iterations, and detailed technical background information, can be found in this download. These documents and worksheets contain much more relevant information on the different aspects that play a role in optimizing the stimuli for specific loudspeakers. They also contain step-by step instructions for using the templates to construct accurate IEC 60286-16 compliant stimuli. This self-contained kit was created by Alastair Gurtner, who gracefully made them available for readers of this blog.

Equalizing a sound source requires a little more than just software. A fair amount of experimentation and compromises in selecting the proper smoothing and bandlimiting is needed. For the most accurate results you will also need access to an anechoic chamber. These techniques have been applied successfully in the development and production of the Echo speech source, and using the templates developed by Alastair Gurtner you can try to equalize your own source.