AP - The Recognized Standard In Audio Test

  • US/UK English
  • UK English
  • Deutsche
  • Korean
  • Spanish
  • Login / Register
  • Contact
  • Products
    • Products Home
    • 2700 Series
    • APx525 Family
    • APx585 Family
    • APx515
    • APx511
    • ATS-2
    • ATS-1
    • Accessories
  • Solutions
    • Solutions Home
    • Intro to Audio Test
  • Downloads
    • Downloads Home
    • 2700 Series
    • APx525 Family
    • APx585 Family
    • APx515
    • ATS-1
    • Accessories
  • Service & Support
    • Service & Support Home
    • Service & Support Offerings
    • About Calibration
    • Schedule Service / Request RMA
    • European Service
    • Knowledge Base
    • Audio.TST Back Issues
  • Sales
  • News & Events
    • News & Events Home
    • Press Releases
    • Analyzer Reviews & Contributed Articles
    • Seminar Schedule
  • About
  • Service & Support
  • Overview
  • Knowledge Base
  • Training
  • Solutions Partners
  • Service Offerings
  • Schedule Service
  • Calibration
  • Shipping Instructions
  • Downloads
  • AP Warranty terms and conditions
  • AP Calibration Services Datasheet

Print this page Save as PDF

Knowledge BaseHOME/SERVICE & SUPPORT/KNOWLEDGE BASE

Audio.TST August 2012: Microphone IMD tests, Matlab and APx

Created 28 Aug 2012

AP logo
Audio.TST August 2012

 

Notes from the Test Bench
Output: Split Stimulus for IMD tests
Sound Advice: Controlling APx from Matlab
Test Results: AP News and Events

Notes from the Test Bench

By Bruce Hofer, Chairman & Co-Founder, Audio Precision

Hello Firstname_Placeholder,

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.


I've recently returned from Copenhagen, having presented a Ph.D course about measuring audio in Class-D amplifiers at the Technical University of Denmark. Not only were many of the students already AP users, but several went out of their way to let me know that APx is far easier to use than competing solutions. That kind of feedback tells me that we are on the right track, helping engineers and designers to meet their goals quickly and accurately. That's why the engineering team at AP is putting the finishing touches on new software you'll be seeing in the following months, bringing new features and capabilities to our thriving APx family of audio analyzers.


Audio Precision is committed to helping you realize the full potential of your products. We look forward to hearing how you use AP audio analyzers in your work.

Bruce

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.

IMD Single Source

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.

Split checkbox

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.

Dual Source

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.

Introduction

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.

Getting started

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\';
NET.addAssembly([apiPath 'AudioPrecision.API2.dll']);
APx = AudioPrecision.API.APx500_Application;
APx.Visible = true;

There are a few things going on here. Let’s break it down by line of code:

  1. apiPath must point to the API folder of your APx installation. (On my machine, it’s in
    the "...(x86)" folder because it’s running 64-bit Windows 7.) Change this path to the correct location on your machine.
  2. We have Matlab load up the APx ‘API2’ assembly. Although there is an ‘API’ assembly, it won’t work correctly with Matlab, because of Matlab’s quirky .NET implementation. (For the more technically inclined, API2 consists of concrete instances of the API interfaces.)
  3. The APx500_Application call returns an object that is an instance of the APx500 application. As long as you hang onto this object in Matlab, you’ll be able to control APx.
  4. This line causes the APx application to start. If hardware is connected, it is booted. Finally, the application itself becomes visible. If you’d rather keep APx hidden, perhaps because you intend to write your own GUI in Matlab, you can start it up with APx.Visible = false instead.
Making measurements

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')
APx.FrequencyResponse.Start;


If the APx application is visible, you’ll see the frequency response of the device you have connected to the instrument. Let’s break this code down by line:

  1. This call switches the view to the measurement and signal path you specify. If you’ve changed the measurement or signal path name, you’ll need to change these strings.
  2. This starts the measurement, equivalent to pressing the ‘Start’ button in the UI. This call returns a 1 if the measurement succeeds. We suppress it with the semicolon.

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

APx.Fr

and hit Tab, Matlab responds with a tooltip showing

Frequency
FrequencyResponse

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;
x = double(gain.GetAllXValues(0));
y = double(gain.GetAllYValues(0));
semilogx(x, y)

Breaking this down by line again:

  1. Setting gain saves us typing later on.
  2. This API call gets all the x values from the gain result for the first channel index (0). Since .NET is zero-based, index 0 refers to Channel 1. The Matlab double() function converts the return object to a Matlab vector.
  3. Get the y values and convert to a Matlab vector. The x and y values are returned in the currently selected units. For the gain result, the defaults are Hz for x and dB for y.
  4. Plot the values. The graph should look very similar to the APx gain graph.
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:


APx.AddMeasurement('Signal Path1', AudioPrecision.API.MeasurementType.DynamicRange);
APx.DynamicRange.Start;
dnr = double(APx.DynamicRange.DynamicRange.GetValues('x/y'));

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:

APx.AddSignalPath;
APx.DeleteMeasurement('Signal Path2','THD+N')
APx.DeleteSignalPath('Signal Path2')

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:

APx.SaveProject('c:\Temp\Project')
APx.OpenProject('c:\Temp\Project.approjx')

Note that the .approjx extension is needed when opening a project. When saving a project, APx adds this extension for you.

Next steps

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.

—Tom Kite
VP of Engineering, Audio Precision

Test Results: AP News & Events

Events:

CEDIA

 

 

CEDIA Expo 2012
September 5-8, Indianapolis, IN, USA

AP's Jonathan Novick will be demonstrating AP analyzers at the Jensen Transformers booth

AES

 

 

AES Conference on Automotive Audio
September 21-23, Munich, Germany

AES

 

AES USA
October 27-29, San Francisco, CA, USA

AP is proud to be sponsoring the Product Design Track at AES San Francisco. Dr. Tom Kite, AP's VP of Engineering, will be presenting as part of the Technical Program, and AP also be hosting a technical presentation in the Exhibitor Seminar Area. Be sure to download the AES app from iTunes or the Android Store.

Bluetooth

 

 

Bluetooth Unplug Fest (UPF)
October 8-12, Barcelona, Spain

 

Electronica 2012

 

 

Electronica 2012
November 13-16, Munich, Germany,

back to top >

© 2012 Audio Precision, Inc.


Return to Knowledge Base home
Back To Top

Accredited by A2LA

Browse Products View Solutions Schedule a Demo Get Service Register

Audio Precision

Copyright © 2012 Audio Precision Inc. All Rights Reserved.   |   Privacy Policy