Audio Test Set Help
Audio Test Set Help
This program is copyright © InterFlex Systems Design Corporation, California USA & David J Taylor,
Edinburgh Scotland. See the InterFlex web site for purchase or upgrade details.
Audio Test Set turns a sound-equipped PC into an Audio Oscillator, Sweep Generator and Real-Time
Analyser. Without other audio test instruments, you can make frequency response measurements. Audio
Test Set uses the sound card in your PC to produce sinewaves that are mathematically correct almost to
CD quality, indeed it's more likely that the quality of your PC sound card will be the limiting factor rather
than the code in Audio Test Set. However, on the analysis side, it is critical that you calibrate the ADC
offset on your audio card for highest accuracy.
This document set provides a brief overview of Audio Test Set and some details about the generation,
analysis and frequency response functions. This is really for clarification, as I hope that most controls are
easy to understand. The program has the ability to analyse response as well as generate. Installation and
system requirements are covered below.
Safety Notice
Playing a continuous tone at a high level might damage your amplifier, speakers,
or hearing. Please exercise sensible precautions!
Operating modes
Audio Test Set has three operating modes, signal generation, signal analysis, and frequency response
measurement which combines generation and analysis.
Not all of these modes may be available on your version of the program, you may wish to upgrade to
fuller functionality.
Installation
From version 2.0.2 onwards, the Audio Test Set comes as a set of files which can fit on to two floppies.
Double-click on SETUP.EXE from disk 1, and insert disk 2 when requested. You can also copy the files
from both disks into a single folder and install from there. Alternatively, you may be able to download zip
archives from the web of the required files, which will contain destination location details.
A small calibration file, calibration.dat, is included in the archive. This is simply intended to show the
format required. The file must be named calibration.dat to be read by the program.
If you have the component parts, the following older instructions may apply.
Extract AudioTestSet.exe from the Zip file to a suitable location, and run it! Note that you will need to
check the Enable analyser box on the generator form to enable simultaneous generation and analysis.
You will be presented with a dialog box that is, I hope, self-explanatory. The program source, and some
extra HTML documentation are provided in other Zip files in the archive. Audio Test Set will save the
current settings in the registry each time a sweep is started, thus allowing you to save personalised
settings.
If you don't already have Borland's run-time library, you will also need to download the file VCL40.zip from
any site offering it. For example: http://www.user.globalnet.co.uk/~hermes02/Freeware/VCL40.zip Extract
the file VCL40.BPL from this archive and copy to your Windows System folder (e.g. \Windows\System or \
WinNT\System32).
If you register with Intel, you may download the Intel Signal Processing Library. Audio Test Set will benefit
substantially benefit from this library which is highly optimised and allows very fast FFTs, for example. You
only need the DLLs (spldll.exe 2.8MB), and you may wish to see the Adobe Acrobat documentation
(spl40man.pdf 2.4 MB). Even though this is a big download, it is well worthwhile if you are making serious
use of Audio Test Set. Robert Rossmair wrote the Delphi interface to the Intel library - you would need this
to recompile Audio Test Set. I offer a limited subset of the Intel libraries at:
http://www.user.globalnet.co.uk/~hermes02/Freeware/NSPdll.zip which can be copied to the same folder
as Audio Test Set.exe, but would recommend that you download the full Intel set if at all possible, and
install these to your Windows system folder.
System requirements
Because of the specialised nature of Audio Test Set, there are a few requirements you should check
before committing to this product.
Drivers
For simultaneous generation and analysis, you will require full duplex sound drivers for your sound card.
The standard Microsoft Sound Blaster drivers do not currently provide full-duplex operation, which will
restrict the program to one function at a time - i.e. either generation or audio oscilloscope. You may need
to visit your sound card manufacturer's Web site to obtain updated drivers. For example, I needed to visit
the Creative Labs Web site for updated Sound Blaster drivers for my card.
Processor
The program is both graphics and CPU intensive, and requires both fast integer and floating pointing
operations from the CPU. It has been tested on an Intel Pentium 166 MMX processor, and the most CPU
usage is using the faster scope modes, when about 30-35% of the CPU is used (including generation). It
should work on faster processors, but has not yet been tested on non-Intel chips. User reports are that
the analysis function may struggle even on a 486 DX-4 processor, so a Pentium is recommended. The
program includes libraries that can use the processor's MMX instructions, but an MMX-enabled processor
is not required.
Memory
The program is not memory intensive, but does use about 5 audio buffers of 1.5 seconds duration which,
together with other buffers and ancillary requirements totals about 2MB of physical memory.
Mixer Settings
The mixer control panel (on the taskbar, right click the speaker icon and choose Open Volume Controls)
allows setting the gain and various other parameters for your sound card. Note in particular that you can
choose to enable the microphone (or have a non-zero gain setting) for the playback (Options, Properties,
Adjust volume for Playback) as well as recording. Typically, you will have the playback connected to your
loudspeakers, so you do not want sound being picked up by the microphone to be fed back to the
speakers. To ensure that this doesn't happen, ensure that in the playback settings, the microphone is
either not selected, or is muted (I have seen both ways of switching channels off). When you touch the
microphone, you should not hear a sound from the speakers.
If you are trying to measure a loudspeaker response, though, you will quite likely want the sound being
heard by the microphone to reach the analyser part of Audio Test Set - this means getting the recording
settings correct. To make this happen, whilst viewing the Options, Properties, Adjust volume for
Recording panel, ensure that the microphone is selected and set to a non-zero gain level. Another
setting that might be worth checking is that the microphone AGC (automatic gain control) is turned off.
Otherwise there is a chance that the quieter sounds indicating an inadequate response at a particular
frequency will be brought up in level - and the frequency response measurement will be compromised.
Libraries
The program requires Intel Signal Processing Library.
Signal Generation
Generation controls have been split into three categories according to whether they are common controls,
tone generator controls, or sweep generator controls.
Generator common controls
{bmc GenCommon.shg}
There will be a brief delay between selecting a new output level and the actual output changing since, the internal sinewave lookup table has to be
recomputed, the output buffers refilled, and sent to the Wave device. There is also a deliberate delay to avoid many quick changes being
processed since this is aurally rather distracting.
Channels
There are three choices for the Channels box.
· In phase The two channels are fed the same amplitude of audio at the same phase. If the frequencies are the same, as will normally
be the case, this is the equivalent of sending a mono signal through a stereo signal path.
· 180° phase The two channels are fed the same amplitude of audio but with the phase of the right channel being 180° displaced from
the left channel. This is useful for channel phasing checks.
· Independent Each channel can have a different amplitude. This unlocks the linkage between the left and right channel output level
controls.
The Lock L + R frequencies check box allows the left and right channels to have their frequency set independently. This box can be checked and
unchecked while the manual sweep is running.
Choosing the waveform
There are twp drop-down list boxes that allow you to choose what waveforms will be generated by the left and right channels.
· Sinewave
· Triangle wave
· White noise - uniform noise from 0 to half the sampling frequency
· Pink noise - white noise filtered by a 3dB/octave low-pass filter
· 1/3 Octave noise - select centre frequency using the track bars
Sweep generator controls
{bmc GenSweep.shg}
Stepped Sweep
When checked, the frequency changes as a series of jumps, rather than in a continuous way. This can be useful in the fast sweep mode for
determining the frequency on the display, as typically 20 different frequencies are shown across the width of the display.
Log Sweep
Audio Test Set can progress a frequency sweep in two ways, linear and log. These have different uses, with Log being nearer to how the ear
perceives a gradually rising frequency.
· In Linear mode, the frequency increases uniformly from the start frequency to the end frequency. This is most useful for testing
narrow-band filters.
· In Log mode, each frequency is a constant ratio higher than the previous frequency so that the same time is required for each octave
swept.
Declick Sweep
By checking the Declick check box, the envelope of the waveform is smoothed at the start and end of sweep resulting in a more audibly pleasing
sound.
Slow Speed Sweep
You have a choice of two types of sweep, fats and slow. Fast sweeps are designed for use with an oscilloscope to view the response of a system to
the stimulus provided by Audio Test Set. The sweep lasts about one second, with a quarter second retrace silence included to allow the 'scope to
retrace and re-trigger.
The slow mode is designed to allow a frequency response to be measured more accurately and is a single sweep lasting about 45 seconds with
about 4 different frequencies per second, resulting in a total of 180 frequencies. Typically used in loudspeaker or tape recorder frequency
response measurements.
Sweep Duration
Here you can choose how long the slow seep is to last. Note that if you choose too short a duration the steps may become too short for the
computer to output sucessively, and if the duration is too long there may not be enough space within the program for the individual steps to be
recorded. The program attempts to warn against such problems.
Signal Analysis
{bmc AnalyserTabs.shg}
There are six types of analysis that can currently be carried out - frequency response triggered by the
generator where output is displayed against frequency, two waveform analysis functions - vectorscope,
oscilloscope, and three spectral analysis functions (spectrogram, spectrum analyser and 1/3 octave
modes) whuch are chosen from the tabbed dialog box. For example, the Scope function is shown
selected in the screen shot above.
Channel selection and DC offset measurement are provided by the input signal conditioning functions.
Waveform Analysis
Waveform display is provided by the Oscilloscope function.
Using the oscilloscope
{bmc ScopeDisplay.shg}
Oscilloscope mode provides a plot of the signal from the selected source against time. The maximum
sweep speed is 1 millisecond per division which allows every sample per scan to be displayed. In the
trace above, the left channel is in blue, and the right in red. The source was a small personal stereo
radio/cassette, and the very slight thickening of the trace is caused by a small amount of residual 19 KHz
signal on top of the main audio, subsequently confirmed by a spectrum analysis using the linear
frequency scale. The Y-axis has been left in the units of the digital sound signal itself, 16-bit samples
occupying the numerical range -32767 .. +32767. To save space this is abbreviated as -32K .. 32K. As a
gain of X2 is in effect, the displayed range in the screen shot above is -16K .. 16K.
Effective Bandwidth
Please note that except on the fastest timebase setting, a number of adjacent samples are averaged
together to form one display sample. This has the effect of reducing the bandwidth as the timebase is
made slower. To see a signal at full bandwidth, be sure to use the fastest timebase setting.
Controls
In Scope mode, there is a gain control for the Y-axis, and a timebase range control for the X-axis. To limit the amount of data to be processed,
not more than ten updates per second are allowed. If the scope cannot keep up with the data rate, the LED will be observed to flash red. The
slowest speed, 100ms/div requires a whole second to capture the data, thus there will be only one update per second. In the fastest mode, the
display has been cunningly arranged to be exactly 441 pixels across, and thus exactly accommodate the 441 samples that will happen in the 10ms
span of the screen. I.e. at maximum speed all samples captured will be displayed. At the slower speeds, the displayed sample is the average of the
2, 5, 10 or more samples that occur in a single pixel period.
Trace Offset
The left channel is plotted in blue, and the right channel in red, but with the two traces overlaid it may be difficult to distinguish one from the
other. To alleviate this problem, you can optionally separate the traces either by a slight amount or by half the screen height. The upper trace is the
left channel.
Spectral Analysis
Three spectrum analysis tools are provided:
· FFT spectral analysis
· 1/3rd octave spectral analysis
· Spectrogram
{bmc FFTcommon.shg}
Common controls
There are a number of controls that are in common for all spectral analysis functions, controlling signal
source, filtering etc.
Mode
You can present the results of a spectrum analysis in a variety of ways - normally you plot amplitude
versus frequency, but you can choose to have a log or linear frequency axis. Alternatively you can collect
cells of energy together in adjacent frequency bands, if these bands are each one thrid of an octave wide
the resulting display is known as a one-third octave analysis. Yet another way of displaying the
information is to plot amlitude as brightness, frequency as the vertical component, and let the resulting
display drift to the left with time. This is known as a spectrogram.
The mode drop down list box allows you to choose the operating mode:
· 1/3 Octave (31 Hz .. 16 KHz)
· Log (20 Hz .. 20 KHz)
· Linear (0 .. 22 KHz)
· Linear (speech) (300 Hz .. 3300 Hz)
· Linear (user) (according to user programmed sweep range)
· Spectrogram (log) (80 Hz .. 15 KHz)
· Spectrogram (linear) (0 .. 10 KHz)
· Spectrogram (speech) (300 .. 3300 Hz)
Cursor
Displays the frequency and amplitude corresponding to the current cursor position.
Load Calibration
Allows a calibration file to be loaded.
Hum Filter
When checked, provides reject of frequencies in the 50..60Hz region.
High Resolution
When checked, makes the frequency resolution of the spectrogram higher at the expense of update
speed.
Moving Average
When checked, averages responses over time. This provides a smoother display, but will miss short
transients.
Channel In Select
Controls what signal is fed to the spectrum analyser. As a single channel of analysis is provided, you can
choose between left and right channels, or the sum or difference of left and right.
Using the spectrogram
The spectrogram display plots a time map of the frequencies present in a signal. The amplitude present is
converted to brightness so that brighter parts of the display represent higher energies. A single tone such
as a steady whistle will appear as a horizontal line at a height corresponding to the frequency.
Plotted above is a spectrogram from a cello playing music with alternating higher and lower notes. You
can quite clearly see the different frequencies, and that there appears to be more energy (brighter trace)
in the lower notes than in the higher notes. You can also see that some of the traces appear to have a
slight pattern, this is the vibrato or frequency modulation that artists use to enhance an otherwise
monotonous sound.
At about two thirds along the trace you can see a vertical line, occupying almost the full height of the
display. This is typical of broadband noise, here perhaps transients from the cellist's bow at the start of a
note.
Using the spectrum analyser
FFT (Fast Fourier Transform) mode provides an analysis of the input signal by frequency component. It
allows the signal to be split up into different bands or cells each corresponding to a particular frequency
range. In this program, the cells are about 21Hz wide (44100 Hz / 2048 samples - or you can choose
higher resolution). Whilst a linear X-axis frequency display corresponds to the mathematical output of the
FFT, the ear works in log frequency terms - a doubling of frequency produces an octave change in pitch.
Since log and linear display are both useful, both are provided.
In Spectrum Analyser mode, the signal plotted on the Y-axis is the RMS value of the input signal,
converted into dB (decibels).
You can also see the effect of the hum filter in operation.
Using markers
This section shows how to use the marker facility in TestSet. We are looking at a two tone signal being
received over a radio link, and we would like to know the frequency and amplitude separation of the two
tones. Ideally, the two tones should have been at the same amplitude, but variations in the atmospheric
propagation and the non-flat frequency response of the receiver have made the amplitudes different.
{bmc Marker1.shg}
{bmc Marker2.shg}
{bmc Marker3.shg}
Measuring Differences
The program further extends its measuring capability by comparing the current peak with the previous
peak. The user next clicks below the higher frequency peak, which the program measures as 2363 Hz
and -51.3 dB. The frequency and amplitude difference between this peak and the previous one is
displayed above the trace. Here it shows a 866 Hz frequency difference and an 11 dB amplitude
difference. By clicking over the peak or delta measurement display, you can clear the current
measurement.
Using the 1/3 octave analyser
The 1/3 octave analyser extends the FFT analyser by combining the output into frequency bands
corresponding approximately to the way the ear resolves frequencies. These bands correspond to one
third of an octave each. In this program, the bands are computed as the sum of the RMS outputs from the
FFT cells, with a weighting factor for the number of cells contributing to each band compared to the
expected bandwidth of each band.
However, a drawback is that the low frequency values are only made from on or two FFT samples, and
given the spread in FFT output that results from windowing, the low frequencies are very blurred - they
spread into each other. A better third-octave algorithm would be welcome!
Phase Analysis
Phase analysis is provided through the Vectorscope function
Using the vectorscope
The Vector Scope mode plots the left signal against the right signal, with the axes rotated by 45°. This
makes it very easy to see certain signal characteristics - a mono signal is vertical, left and right-only
signals appear purely along their axes and so forth.
{bmc VectorDisplay.shg}
In Vectorscope mode, there is only a single control other than the start-stop button, and that is the AGC
checkbox. This controls whether the signal level is automatically increased to make a more legible
display. The AGC has fast-attack and slow release characteristics, and is limited to an arbitrary maximum
gain of 26 dB (or you simply see the noise...).
Here you see a stereo radio program fed to the vector scope. The display shows that there was a speaker
who was talking slightly left of centre. The display isn't a straight line because of noise and reflection from
the acoustic environment.
AGC
Click to enable or disable Automatic Gain Control (AGC)
Frequency Response
{bmc ResponseDisplay.shg}
The trace above is what you might typically expect in this mode. It shows the overall response of the
microphone and loudspeaker on my computer system, and shows one problem caused by a high
background noise level (actually 50Hz mains pick-up) - in that the responses at very low and very high
frequencies should approach zero but appears to be some -30dB. resonances at 200Hz and 2KHz can
clearly be seen. This is just as likely to be caused by microphone placement as by actually response
errors - my computer is not in an anechoic chamber!
The response mode is triggered when you have checked the Enable Analyser check box from the
Generator screen, it cannot be started by the user. In this mode, the signal is converted into RMS values,
and plotted against frequency. It is actually plotted against time, and it is the synchronisation between
generator and analyser that accurately maps time to frequency. In the fast sweep modes, the display is
updated once per sweep, i.e. just less than once per second. In the slow sweep mode, you will see the
display build up as the generator frequency gradually changes. You can alter the appearance of the
display with the controls on the Response tab, shown below.
Note that if the Enable Analysis function is selected when other than a repetitive sweep is chosen, the
analyser will start up in 1/3 octave mode.
Measuring a frequency response
In Frequency Response mode, the signal plotted on the Y-axis is the RMS value of the input signal,
converted into dB (decibels). You can choose the scaling and the offset for the Y-axis, by a dB per division
control (scaling) and the offset (marked Display Gain). The 0 dB reference point is the full scale of the A/D
converter, with a full scale sine wave input. You can improve the resolution by changing the dB per
division setting and restarting the sweep.
{bmc ResponseControls.shg}
Smoothing: Typically, frequency response plots do not appear as smooth as you might like, because of
external noise or other effects. The program provides two options to improve the appearance of the
display, Trace smoothing and Moving average. The Trace smoothing functions by averaging adjacent
response points, with a choice of one either side (Smooth) or two either side (Smooth more). In both
cases, it is not just a simple average that is used. Moving average allows successive traces to be
averaged, so if the problem is external noise, this might be expected to average out over a few
successive runs. Try it and see how it works for you. Moving average is not available in the slow speed
sweep mode.
Bandwidth Measurement: To help you measure frequency responses, the program can scan along a
response curve that you have measured and determine the values at +/- 3dB or a limited range of other
values. This works by first determining the maximum response value, and then scanning in from low and
high frequencies to determine where the response is within 6dB (or whatever) of the maximum. This
works reasonably well with a normal response with a maximum around middle frequencies, falling at high
and low frequencies. Peaks and troughs within the nominally flat area are ignored. If there is sufficient
demand, I might add a bandstop rather than a bandpass measurement.
Calibration: Finally, you may wish to calibrate errors out of the system. For example, if you know that a
microphone has a particular frequency response, you can subtract that response from the frequency
response of a loudspeaker measured using the known microphone to get a better estimate of the true
frequency response of the loudspeaker. the program will read a frequency response file, and can subtract
the response read from file from the measured response if the Use
File box is checked. The program will automatically load a file named Calibration.Dat if one is present in
the same folder as the executable program, and the Auto-load box is checked. The Calibrate display will
only be visible if valid calibration data has been read during the program's initialisation. An alternative to
calibration from file is to feed a reference signal to the left channel, and the output from the unit under test
to the right channel. This is achieved by checking the Left is Reference box. A further offset of +/- 40dB
is available in this case to allow for the reference signal being similar in amplitude to the test signal.
Calibration file format: consists of an optional header (text lines which don't translate correctly into
numbers are ignored), followed by lines containing two or three numeric entries in floating point format,
the frequency in Hz, the left channel response in dB, and the right channel response in dB. If the right
channel is not specified, it is assumed to be the same as the left channel. A simple calibration file is
supplied in the Zip archive with the name calibration.sam.
Offset: Please note that in the fast sweep modes, where the sweep is preceded by about one third of a
second of silence, the offset of the ADC is measured during the silent interval, rather than being taken
from the registry entry of a previous measurement.
Reference
A book that I have found invaluable on digital audio is:
Soundcheck Productions, Sound Check Alan Parsons & Stephen Court, 1993
available as RS number 245-376, Soundcheck tel: UK +44 1753 833524
(pink noise plus many other signals and test tracks)
Input Conditioning
{bmc InputControls.shg}
You can select which channel of your audio card will be used for signal analysis. The names of the
channels are derived from information supplied by the card driver driver software.
I have now met two types of card, the SoundBlaster card where multiple channels can be mixed together,
and a cheaper "S3" PCI-based card where the input selector is more of a switch rather than a mixer. At
present, the switch type of cards must be controlled from the Voume Controls rather than the Audio Test
Set program.
ADC Offset
A common error with sound cards is a small residual DC offset when no signal is present. This error is
normally inaudible as the frequency response of human hearing does not extend down to DC! However,
when making measurements at low levels the offset can contribute a large error.
The program can measure this offset and improve the accuracy of low-level signal measurements by
subtracting the DC offset value from the measured signal. Allow the mouse to hover over the Measure
Offset button to see what the measured values actually are for your sound card.
Please note that on the S3 card I mention above, I have seen that the offset varies with gain control
setting and input selector (yes, this was a very cheap card!), so you are advised to measure the offset
prior to making any critical measurement.
Release notes
V2.0.8 Make user name check case-sensitive
Move registry entries to HKCU\Software\InterFlex Systems\
Contact InterFlex Systems Design Corporation, California USA, web address www.interflex.com to
upgrade your licence.