Notes from the Test Bench
By Bruce Hofer, Chairman & Co-Founder, Audio Precision
While AP is always leading the way on new developments in audio with the latest digital interfaces and measurements, it's good to step back and consider some "old school" analog tricks. This month we have an article that details how to measure IMD in microphones and other devices using some decidedly analog thinking to negate distortion products generated by intermediate stages of tests, enabling measurements under conditions that would otherwise be nearly impossible.
Output: APx500 v3.1 Preview: Split Stimulus for IMD tests
In the next two issues of Audio.TST we will be highlighting new features and capabilities of our upcoming 3.1 version of APx500 measurement and control software, slated for release in October.
The testing and measurement of microphones presents a special set of issues. Specifically, since the source for any test signal must itself be generated by a loudspeaker, it is difficult to isolate distortion artifacts created by the loudspeaker from those generated in the microphone under test.
This is especially true for THD+N measurements, in which the DUT (device under test) is given one stimulus signal with which to make a measurement, invariably causing the loudspeaker's THD+N to be included in the result. However, by employing a technique based on intermodulation distortion (IMD) (which requires two tones), we create a method for eliminating the specific distortion products normally generated by a loudspeaker. This "Split Source" IMD measurement is described below.
Intermodulation Distortion (IMD) Tests and Loudspeakers
Intermodulation tests are normally conducted by stimulating a DUT with a pair of sine waves at differing frequencies and at a specific ratio of levels as prescribed by the standard being used (SMPTE, ITU-R, etc.). The response is then analyzed for the presence of signals that correspond to sum and difference frequencies of the stimulus, caused by the intermodulation distortion of the DUT.
While this works very well with electronic devices, such a test can be problematic when the DUT is a microphone, as shown below.
The microphone under test must receive an IMD stimulus through the air, and that stimulus must ultimately be produced by a loudspeaker. However, as a loudspeaker is itself an electro-mechanical device, it generates a substantial amount of IMD on its own. This renders our test largely invalid, especially since the IMD figures for loudspeakers are in general much greater than for typical microphones.
Our goal is then to eliminate the inherent IMD of the loudspeaker from our stimulus.
Split Source Acoustic IMD
If a loudspeaker plays only a single sine tone, then no IMD is produced. There may well be other distortion products, but these will not be correlated to any sum and difference frequencies of an IMD stimulus. We can take advantage of this fact to improve our measurements.
APx500 v3.1 supports a "Split" setting for all IMD measurements. Selecting this setting configures the generator to send each of the two IMD test signals to a different output channel, allowing you to eliminate IMD from certain intermediate devices in the test setup chain.
In this configuration, Frequency 1 will be present on Generator Channel 1, while Frequency 2 will be present on Generator Channel 2. These outputs are then sent to two separate channels of amplification, and then to two separate loudspeakers as shown below.
Under these conditions, the loudspeakers are unable to contribute any IMD as each is playing only a single sine tone. When the measurement is made, the two sine waves are effectively mixed together "in the air", allowing the IMD products of the microphone under test to be isolated.
Any APx audio analyzer can be configured to run this measurement with APx500 v3.1. The APx515 will require the SW-AML software option.
Note: This specific test, while able to isolate IMD products from loudspeakers and microphones, does not constitute a measurement that is recognized under any particular standard, such as SMPTE or ITU-R (CCIF). It is, however, a useful measurement that allows you to gain a better understanding the behaviors of microphones on a relative basis.
Isolating IMD in mixer stages
This same technique can be used when measuring audio products such as mixing boards or others with summing circuits. If two inputs are fed IMD stimulus using the "Split" setting, then any IMD that appears in results must be occurring in the mixing stage or further down the signal chain. When the "Split" setting is disabled, then the IMD measured will be the total IMD of the signal path, including the input stages. This can be a useful test in design or troubleshooting.
Sound Advice: Controlling APx from Matlab
Tom Kite, Audio Precision's Vice President of Engineering, contributes an article on controlling APx from Matlab.
Matlab is a popular software tool for research, engineering, and signal processing. It can manipulate large arrays easily and has extensive graphing capabilities. It is fully programmable, and in recent versions is capable of communicating with .NET applications. Since APx is built on .NET, Matlab is able to control it. In this article, we show how you can make APx do anything you want through Matlab.
We are using Matlab 7.12 (R2011a) and APx500 v3.0, but the code should apply to any recent version of Matlab and APx.
We’ll assume you have a working Matlab installation, and that you have installed APx500 v3.0 to the default location. First, we connect Matlab to APx and start the application:
apiPath = 'C:\Program Files (x86)\Audio Precision\APx500 3.0\API\';
There are a few things going on here. Let’s break it down by line of code:
APx starts up with six measurements in the navigator. Let’s switch to one of them and run it:
APx.ShowMeasurement('Signal Path1', 'Frequency Response')
Matlab’s command line interface includes IntelliSense. This feature searches the assembly for matches to what you are typing, so you don’t have to remember the entire API. The matching begins after you type the first dot and press the Tab key. You can narrow down the list of matches by typing some letters before you hit Tab. So for instance if you type at the Matlab prompt
and hit Tab, Matlab responds with a tooltip showing
from which you can choose what you want by using the cursor up/down keys and hitting Tab.
Getting data from APx
One of the main reasons for controlling APx via Matlab is that it allows you to run measurements, transfer the measurement data directly to Matlab, and further process it. This can be done without interacting with the APx UI at all.
Let’s continue from where we left off. The frequency response level data is showing in the APx UI. We’ll transfer the measurement data from the gain result to a Matlab vector and plot it.
gain = APx.FrequencyResponse.Gain;
Breaking this down by line again:
Adding and deleting measurements
The APx API supports adding and deleting measurements and signal paths from the project. You can do this through Matlab too. Here, we add a new measurement, run it, and get its result data:
Because dynamic range is a meter, rather than an x-y graph, the GetValues() call returns the data for all channels at once. Here we have specified a different unit from the default.
Next we add a new signal path, delete one of the default measurements from it, and then delete the entire signal path:
Depending on your application, you can build a project programmatically through the API, or you can instead build the project in the APx GUI, save it, and then load the entire project via the API:
Note that the .approjx extension is needed when opening a project. When saving a project, APx adds this extension for you.
The full APx API is available through Matlab. IntelliSense helps a lot with finding the functions you want. However, the information it provides is limited. The APx API Browser is an application that lets you browse the entire APx API by name. It includes descriptions of the calls and code examples. This can be found on our web site. And of course, tech support is always available to help you with Matlab interfacing or anything else.
Test Results: AP News & Events
© 2012 Audio Precision, Inc.