WinAIRR

Version 4.02

WinAIRR (Windows Anechoic and In-Room Response) is a software tool for measuring the frequency response of loudspeaker systems. It runs on a PC with Windows95, Windows98, Windows/NT, Windows 2000 or Windows XP, equipped with a soundcard that must be capable of full-duplex operation. Full-duplex means that the soundcard can simultaneously record and playback. Most soundcards support full duplex.

Apart from the PC and soundcard, the only other equipment you need to make a measurement is a microphone and some loudspeakers to test!

WinAIRR is not a professional measurement system. The results you get from WinAIRR depend fundamentally on the quality of the sound card electronics. However, good and reproducible results can be obtained by careful adjustment of the WinAIRR parameters. Your mileage will vary. If you have very exacting requirements, there are plenty of similar or more richly functional systems to WinAIRR on the market, albeit at much higher prices.

The demonstration version runs for 50 samples, and uses a fixed sample rate of 22050 samples/second.

New in 4.02:

  1. 48kHz sample rate can now be selected on sound cards that support this rate

New in 4.01:

  1. Much improved signal stability due to the accurate measurement of Windows system delays between sending sample buffers to the soundcard, and the soundcard using them.
  2. MLS measurements use the Fast Hadamard Transform, making them much faster.
  3. Improved Mixer control: WinAIRR supports multiple mixers in the system, and also now saves and restores mixer settings.
  4. Time and Frequency domain plots no longer "flicker" due to the use of double-buffering with offscreen images.
  5. Time and Frequency domain plots show the cursor coordinates when the cursor moves in the plot region

This help file contains the following sections:

New users are recommended to start with "Setting Up". Otherwise, the Control Panel allows you to easily navigate to the section of interest.


Control Panel

The WinAIRR control panel is shown below. There are 10 areas in which you can control the behaviour of WinAIRR.These are described in detail in the sections that follow.


Features

This version features:

  • Pulse (Dirac) mode
  • MLS (Maximum Length Sequence) mode
  • Sine-wave mode with fully variable frequency
  • Square-wave mode with fully variable frequency
  • White noise mode
  • Sweep mode
  • Time domain plot
  • Upper and lower time domain cuts
  • Delay adjustment
  • Frequency domain plot
  • Phase plot
  • Waterfall plot with variable steps
  • Histogram plot
  • Full Mixer control via Windows Multimedia API with MIC, LINE and SPKR levels
  • deciBel scale adjustment
  • Sampling rates from 8kHz to 44kHz
  • Samples of length 64 up to 16384
  • File export and import with drag-and-drop
  • Compatibility with CALSOD 3.0

 


Setting Up

I recommend that you copy the WinAIRR files into a dedicated directory on your hard disk, e.g. C:\WinAIRR. Then just double-click the WinAIRR.exe filename in Explorer. Alternatively, you can start the program by using the Start->Run sequence from the toolbar, or by opening a command window, changing to the WinAIRR directory, and typing "WinAIRR".

If you have not already done so, plug the microphone jack into the "MIC" socket on your sound card. If you are using a specialised microphone such as the Mitey Mike, then you may need to avail yourself of converter plugs that allow you to use the jack socket on the sound card.

To check that WinAIRR is working correctly, I suggest you initially just try measuring the response of your PC's loudspeaker(s), or any small loudspeaker connected to the loudspeaker jack on the sound card. Plug the loudspeaker in to the sound card.

Activate WinAIRR by clicking on the "Start" button in the bottom left hand corner of the WinAIRR Control Panel.

Assuming you can hear "clicks" from the loudspeaker(s), position the microphone a short distance (approx. 6 inches) from the loudspeaker, and observe the WinAIRR Time Domain plot. You should see the pulse shape as picked up by the microphone. You should wait awhile so that WinAIRR adjusts the scale limits so that the pulse is big enough: in the end, it's height should be a significant fraction of the height of the Time Domain box. You may also have to wait until the pulse stops jumping around. If the pulse does not settle down, you may need to choose a different Sample Rate or Sample Length, in order to find a stable combination. The stability cannot be ensured in Windows ... see the Monitor section for more information. In general, greater stability will be obtained with lower sample rates and longer sample lengths. The picture below shows a typical pulse as seen in the Time Domain plot:

If you see very little in the Time Domain plot, ensure that the MIC gain slider is set high enough. Make sure that your Microphone is connected and turned on (if it has a switch on it). Check the microphone is functioning by using one of the software recording utilities (such as Windows Sound Recorder) supplied with Windows or your soundcard, or whistle at the microphone and watch for the resulting effect in the WinAIRR time domain plot. Notice that the Time Domain plot also shows the signal WinAIRR sent to the DAC: this is visible in this plot as a small white line at .00 mSecs at the bottom left hand corner of the plot.

Try moving the microphone backwards and forwards to observe the change in amplitude of the pulse in the Time Domain plot: the further away the microphone, the smaller in amplitude it becomes. Adjust the Delay slider if required so that the pulse appears close to the left-hand side of the Time Domain plot.

For reproducible measurements, you will usually want to average over very many pulses. Single shot sampling is useful to get an idea of the variations between individual pulses. If you average over many samples for a pulse like the one above, you tend to eliminate the wiggles of noise to the right hand side of the pulse.

When you are satisfied that the pulse shape and size are the best possible, start averaging the response over many samples by selecting the Average Over button in the WinAIRR Control Panel Averaging box. The picture below shows the result from averaging, and with the lower and upper time cuts positioned to window the interesting part of the pulse:

The Frequency Domain plot should now give you an accurate representation of the frequency response of your system:

This system doesn't look very Hi-Fi, does it?! Now click on the Histogram button in the Analysis Results box, and you will obtain the same information, but in the form of a histogram of 100 bins:

By clicking on the Waterfall button in the Analysis Results box, you can show the cumulative spectral decay of the impulse response. You may need to fiddle around with the Waterfall Start and Steps controls to get the picture to your taste. Here's an example (not taken from the same system used for the plots above):

Finally, you can examine the Phase response of the system, as a function of frequency, by selecting the Phase button in the Analysis Results box:

If you have problems making WinAIRR function properly, or if you find a bug (always possible!), or even if you have suggestions for improvements to the program, please drop me a line at: julianb@altavista.net


SoundCard Response

You can get an idea of the response curve of the SoundCard by looping the SPKR output back in to the LINE input socket. For this you need a cable with a stereo jack plug at each end (unless your soundcard is equipped with a different sort of socket). Select the LINE input using the "LINE" button in the WinAIRR Control Panel Mixer box. Connect the cable. Observe the characteristics of the pulse as shown in the Time Domain plot. If the pulse exhibits ringing, or is otherwise non-linear, try reducing the LINE in gain with the LINE slider control, as well as the SPK (Speaker) gain whilst ensuring that the pulse signal remains well above the noise background (the random fluctuations that occur on the right hand side of the Time Domain trace).

You should see a fairly flat curve in the Frequency Domain plot with a sharp roll-off above maybe 15 kHz. To measure the response at lower frequences, you should increase the Sample Length, or reduce the SoundCard sampling rate. Capture the spectrum using the Capture Current button in the WinAIRR Control Panel Storage box, or save the spectrum to a file using the Save As button in the same box. If you save the file, you might want to name it "amplifier.air".

On some SoundCards, jumpers on the board itself allow you to bypass the on-board amplifier. If you are using an external HiFi amplifier with the SoundCard, then this is a valuable option which maximises the fidelity of the output pulse. However, if you are powering the speaker directly from the SoundCard, then moving the jumpers is not a good idea.

Switch now to measuring the response via the Microphone by pressing the MIC button in the WinAIRR Control Panel Mixer box and the amplifier response you were measuring appears as a grey curve in the Frequency Domain plot.

You can subtract this curve from the green curve if you like, by checking the Subtract check box. (You can remove the grey curve from the display by un-checking the Show check box.)

Note that most sound cards tend to have rather poor response below around 50 Hz.


Averaging

Each WinAIRR data collection cycle causes N samples to be read from the SoundCard ADC. If the Single sample button is on, then WinAIRR displays the values for each sample individually as a curve in the Time Domain plot. If the Average over button is on, then what is displayed is the average for all samples so far. This helps to iron out random fluctuations in the digitized samples, and makes for smoother response plots when operating in pulse mode.

Samples in WinAIRR can be averaged over time or frequency. The Time button causes averaging to be made for the ADC samples. The Frequency button causes averaging to be made over the frequency data obtained from the FFT. In the latter case, the N new samples from the ADC are sent to the FFT, which yields a set of amplitudes in N/2 bins of frequency. It is then these amplitudes which are averaged and plotted in the Frequency Domain plot. This is useful for non-pulse mode operation, for example when analysing the pick up of a pure sine wave tone. Averaging over Time would not be appropriate in this case, as successive samples of the sine wave would tend to average one another out.

The number of samples to average over can be set by entering the required number in the Average over Edit box. The default is 100 samples. During WinAIRR operation, the current sample number in the averaging can be reset to 1, so causing a new average to begin. This is useful for when you need to let the measured signal "settle down" before starting an averaging series.

At the bottom of the Averaging section, the current sample number is displayed.

 


Excitation Mode

Select the type of signal you want to use for measuring. Pulse is used to generate a short, sharp voltage step on the SPKR output. MLS is used to generate a Maximum Length Sequence of voltage levels to be output. White Noise results in a pseudo-random set of voltage levels to be sent to the output (the random number is re-seeded for each cycle). The No Signal button is for measuring background noise, or sound generated from an external source: WinAIRR sends a set of voltage zero levels to the SoundCard. The Sweep button causes a signal to be generated that consists of a set of sine waves of all possible frequencies, which sounds like a sine tone of slowly increasing frequency. The Sine Wave button causes a sine wave of defined frequency to be sent to the SoundCard. The Square Wave button causes a square wave to be sent. The frequency can be set either by typing its value in Hertz in the text box, or by adjusting the slider control below.

All of these modes are described in more detail in the sections that follow.

The Artificial button determines whether WinAIRR measures the response to the excitation signal either from the Microphone, or from the internal software buffers. In the latter case, a pure signal is always analysed by WinAIRR.


MLS mode

An MLS is generated of cycle length equal to the Sample Rate, and sent to the SoundCard DAC. The sequence is then sampled by the ADC, autocorrelated, and the result shown in the Time Domain window. No Hadamard Transform is necessary. The MLS has the special property that its cyclical autocorrelation function is large and positive in one interval, and small and negative across other intervals. In other words the autocorrelation function has the same properties as a minimal-width pulse. Using the MLS method instead of the pulse is preferable as it has a low sensitivity to noisy environments, and the system does not suffer from the unnaturally (or, perhaps more correctly, un-musically) high crest factor of a single pulse The MLS is cyclically correlated with the signal recorded by the ADC to yield the impulse response.

For long sequences, the calculation time may be significant, especially on processors slower than a Pentium ...


Pulse Mode

A pulse of minumal width is used as output to the Speaker. This is a so-called "Dirac" pulse of one sample duration i.e. a width of 1/Sample Rate seconds.

The inverse Fast Fourier Transform of a pulse of zero width yields a flat frequency spectrum.


Sine-wave Mode

A sine wave of the desired frequency is generated and sent to the SoundCard's DAC. The frequency may be set using the Edit box, or the slider control. Note that the maximum frequency that can be generated is equal to half the Sample Rate. The minimum frequency is equal to:

F(min) = Sample Rate / (2 x Sample Length)

The slider control and Edit box will disallow the input of values for the frequency outside that range.

The FFT of a sine wave shows a sharp peak at the selected frequency. The suppression of harmonics in the response can be improved by using the 1/2 Hanning window.


Square-wave Mode

A square wave of set frequency is generated and sent to the SoundCard's DAC. The frequency may be set using the Edit box, or the slider control. Note that the maximum frequency that can be generated is equal to half the Sample Rate. The minimum frequency is equal to:

F(min) = Sample Rate / (2 x Sample Length)

The slider control and Edit box will disallow the input of values for the frequency outside that range.

The FFT of a square wave shows a peak at the selected frequency and many other significant peaks due to harmonics.

 


White noise Mode

White noise is generated. The energy spectrum of white noise is flat as a function of frequency. For each sample, a set of different random values are chosen to be sent to the DAC.

 


No signal Mode

No signal is generated. This mode is used when measuring the response for an external source. For example, you may have an external CD player which you want to use to generate test tones with.

 


Sweep Mode

A sinusoidal signal is generated that starts with a frequency Flow and gradually increases to Fhigh, where Flow and Fhigh are chosen to cover the full range of frequencies WinAIRR is capable of resolving in the current mode.

 


Artificial

Selecting this button causes WinAIRR to directly analyse the signal being sent to the SoundCard DAC. It is useful for checking what the frequency response of a perfect fidelity system would look like.


Fix dB Scale

This button controls whether WinAIRR automatically adjusts the vertical scale (in dB) of the Frequency Domain plot so that the response curve is completely visible. If automatic adjustment is not wished for, then activate the button, and then use the Edit boxes to set the lower and upper values you require on the Frequency Domain plot.


Storage

You can store the current Frequency Domain spectrum for reference by using the Capture button. When this button is pressed, a copy of the current curve is kept, and then superimposed in grey on whatever spectrum is subsequently plotted in the Frequency Domain window.

The frequency data points can also be stored in a text file on disk using the Save File button. The name of the file used is "default.air" by default, but you can use any file name by typing it in the File Edit box.

To restore a file saved in the this manner, you can either use the Read File button, which reads in the file specified in the File Edit box, or you can drag and drop a file anywhere into the WinAIRR control panel. The stored file will immediately be shown in grey on the Frequency Domain plot.

The Plot Capture checkbox is used to control the plotting of a captured spectrum, if there is one.

The Subtract checkbox allows a captured spectrum, or a spectrum loaded from a disk file, to be subtracted from the active spectrum. This is designed to be used in cases where the active spectrum must be corrected for the frequency response of another component.


Plot Scaling

By default, the WinAIRR software automatically adjusts the scales in the Frequency Domain plot so that the whole of the spectrum is visible, and not clipped. This behaviour can be turned off, by using the Fix dB scale button. Once this button is on, then values for the desired dB range can be typed in the two Edit boxes.

You can also adjust the vertical position of the spectrum by adding or subtracting a number of dBs from it: use the edit box or slider to set the adjustment value, which by default is 0dB.


Monitor

The triggering information in the Monitor box on the WinAIRR Control Panel shows the position in the recorded sample at which WinAIRR has determined that the signal starts. This information is used to position the Time Domain plot correctly in the record buffer.

The timing information in the Monitor box measures the delay between WinAIRR sending a buffer to the SoundCard electronics, and the sound being played. This information is used internally by WinAIRR, and is a gauge of how close the hardware and operating system are to being "real-time".

Unfortunately, Windows'95 and Windows/NT offer no guarantees of how quickly hardware devices respond to user software requests. This makes timing sometimes difficult, if not impossible, without using custom device drivers. Despite the use of gauges such as the Monitor information, the performance of WinAIRR is strongly coupled to how performant and resource-laden your machine and OS desktop are.

When running WinAIRR, it is thus recommended, for best performance, to

  1. close all other Windows applications
  2. stop all those little monitoring thingummies that you may have in your toolbar (e.g. CoolTalk watchdogs etc. etc.)
  3. ensure you have a decent amount of memory (e.g. > 32 MBytes)
  4. check that your machine is not a clunky old 386 ....

Sample Record Delay

The signal that WinAIRR records is stored in a software buffer which is subsequently used to feed the FFT, and hence derive the frequency or phase response. The Sample record delay slider allows you to move around in this buffer in order to position the recorded signal optimally. For example, it may be necessary, when in Pulse excitation mode, to position the recorded pulse as far to the left of the Time Domain plot as possible, so that all reverberations are included in the FFT analysis, or so that the Waterfall plot can span the region falling over the pulse. By moving the slider to the right, a larger and larger delay is inserted into the record buffer. You can also move the slider so as to insert a negative delay: meaning that the position of the signal will move towards the right of the Time Domain plot.

The text box at the bottom of the Sample Record Delay box shows the currently selected delay value, in milliSeconds.


Time Domain Cuts

In order to exclude parts of the Time Domain signal from contributing to the calculation of the frequency response, the Time Domain Cuts sliders allows you to window the desired portion of the signal. There are two main purposes for wanting to do this: one is to exclude an unwanted artifact somewhere along the pulse and the other is to exclude the part of the signal that is caused by the microphone picking up sound waves reflected from surfaces, rather than those emanating directly from the loudspeaker under test. It is this second possibility that allows the anechoic response of the loudspeaker system to be measured by WinAIRR.

For the anechoic measurement, there are two possibilities:

1) You average over many samples until you can see the first reflected pulse, or

2) You calculate the minimum distance a wave refelected off the nearest wall boundary travels, and divide this by the velocity of sound in air, yielding the time to travel. You then position the upper marker just before this calculated time.

As you move the Lower and Upper Time Cut slider bars, their position will be shown as lines on the Time Domain plot.

The Hanning window is an alternative to the "boxcar" window (which is the default window used by WinAIRR). The boxcar window is implemented simply by weighting each time domain datum by 1.0 prior to the FFT. The Hanning window applies a weight:

H = 0.5 + 0.5*cos(2*pi*(t-T/2)/T)

where T is the total length of the sample in seconds, and t is the elapsed time from the beginning of the sample, also in seconds.

The Hanning window should be used when it is required to measure one or more sine waves that are present in the sample. It has the effect of reducing the levels of spurious signals in the Frequency Domain plot, at the expense of decreasing the sharpness of the peaks at the detected frequencies.


Sample Rate

You may select the DMA rate that the SoundCard uses to emit the chosen excitation signal. There are four possible rates: 8000, 11025, 22050 and 44100 samples per second. Selecting one of these sample rate buttons programs the card for the inbuilt rate. The accuracy of the sample rate depends on the SoundCard electronics. For example, the Creative Labs SB16 cards use a 1MHz crystal down-counter to set the rate to one of 256 different values. The accuracy of the 1MHz crystal is reported to be +/- 2%.

By selecting a low rate, you can measure down to lower frequencies. The maximum rate of 44.1 kHz allows theoretically a response measurement up to a frequency of around 22kHz. However, the soundcard electronics will probably have rolled off well before then!


Sample Length

Samples from the SoundCard's ADC are collected in sets of N samples, which are then processed by the FFT (Fast Fourier Transform). The larger N is, the longer the sampling time, and the lower the frequencies which can be resolved. The shorter N is, the shorter the collection time. The Sample Length buttons allow you to select the number N. This is constrained to be a power of 2 (the reason this has to be a power of two is to do with how the Fast Fourier Transform is calculated).


Analysis Results

There are four possible ways offered for showing the WinAIRR analysis results: Standard, Waterfall (Cumulative Spectral Decay), Phase and Histogram.

Standard Plot

The Standard Frequency Domain plot is calculated by taking each of the (Sample Length) FFT components, calculating the corresponding frequency for that FFT point, then calculating the magnitude of the component. This magnitude is then converted to a dB value assuming a reference level of unity:

dB = 20 log10 ( FFTi * Const + Delta ) + Offset

where FFTi is the i'th component of the FFT, Delta is a term negligible compared with the others, and is used to avoid logarithms of 0, and the Const term is equal to the sample length. The Offset term is set using the Adjust dB slider and Edit box.

Use of the adjustment may be required when a region of the spectrum is to be normalised to the 0 dB line, for example, or if you want to move the current spectrum's position in relation to the captured spectrum.

Waterfall Plot

The Waterfall plot is a graphical means of showing the variation with time of the response of a loudspeaker. This is achieved by pulsing the loudspeaker as normal, and then analysing successively shorter portions of the pulse picked up at the microphone. To do this requires an FFT of the whole pulse, as normal, then an FFT of the whole pulse minus the first n microseconds, then an FFT of the whole pulse minues the first 2*n microseconds, and so on. Each FFT taken yields a new response curve, which is plotted at a different Z position on an XYZ plot whose XY axes are the normal frequency/amplitude.

This is rather time consuming, but can yield interesting features such as susceptibility of the loudspeaker to "ringing" or other resonance effects.

The recommendation is to invoke the Waterfall option only once a stable normal frequency response curve has been obtained by averaging over many samples. To extend the Waterfall plot to the lowest possible frequency, then a suitably large value for the Sample Length should be selected.

The Edit box next to the Waterfall button allows you to select the number of scan lines used for the Waterfall plot. The default value is 30. The slider allows you to position the point at which the FFTs are taken ... non-zero positions will be indicated by a white line that appears in the Time Domain plot.

Phase Plot

The Phase plot shows the phase of the frequency response, plotted between -pi and +pi radians. To obtain a smooth phase response plot (without many swings between -pi and +pi), try adjusting the Sample Record Delay.

Histogram Plot

The Histogram plot shows a breakdown into 100 bins of the frequency response, plotted on a linear frequency axis. This plot differs from the Standard frequency response plot in its linear axis, and in that it accumulates increasingly more frequency point measurements in each bin for larger frequencies. This emulates a "graphic equalizer" type display.


Mixer

The name of the Mixer being used by WinAIRR is shown in the upper area of the Mixer box. This name is encoded in the software drivers for the Soundcard you have installed in your system.

New in 4.01: If you have more than one SoundCard installed in your system, then a selection box will appear when WinAIRR starts. This will allow you to select which Mixer in the system you want WinAIRR to use.

The Sound Card includes an amplifier for both the MIC and LineIn inputs. The gain of each amplifier may be set under software control using the MIC and LINE vertical slider bars in the Mixer box.

It is worth experimenting with the gain in order to minimise distortion. The level of distortion generated by the LineIN amplifier can be readily evaluated by selecting the LineIN mode with excitation by pulses and observing the resulting shape of the pulse in the Time Domain plot. By reducing the gain the pulse can be nicely squared up.

The choice of which input (MIC or LINE) to use is achieved with the button controls.

New in 4.01: Note that, when WinAIRR starts, the existing Mixer settings are saved. When WinAIRR terminates, these settings are restored.

If you have trouble with the mixer settings, or if WinAIRR warns that it was unable to set the mixer correctly, try using the Windows mixer utility, available in Programs->Accesories->Multimedia->Volume Control to set the required levels.

In particular, when WinAIRR starts, if you see the following error window appear:

then start the Windows mixer utility (as described above), and make sure the settings look something like this:

i.e. with the Wave un-muted and the slider set non-zero, and the Volume Control unmuted and set non-zero. With these settings WinAIRR should work nicely, regardless of the error message.

 


Read from Disk

Used to load a previously saved set of frequency response data back into WinAIRR (see Save to Disk).

The saved data need not have been saved at the same resolution as the current WinAIRR collection imposes. If the resolutions are different, then AIRR will either interpolate between data points, or remove redundant data points as necessary (the original data in the file are unaffected).

The data loaded from the file (referred to as "kept" data) are plotted on the Frequency Domain plot in grey.

Once the kept data are loaded, they may be subtracted from the current data. This provides a method for correcting for microphone response, by keeping response data for a microphone in a dedicated file.


Save to Disk

Used to save the frequency response data for future use. The file specified in the edit box will then be written with (Hz,Value,Phase) triplets as ASCII text. The file may be reloaded using the "L" key. Note that the first (Hz,Value) pair indicates the average value of the measured input signal. The file can be used as input to the CALSOD program.

An extract from an example file is show below:

WinAIRR saved file

Samples per second 22050

Number of points 1024

Hz Amplitude Phase

10.767 5.32813 .00

21.533 3.42718 -1.44

32.300 4.86841 -1.54

43.066 6.38737 -1.48


(c) Copyright Julian J. Bunn, 1999. julianb@altavista.net