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 December 2009: APx API Wrapper for Vee and MATLAB, Measuring PSRR with APx

Created 21 Dec 2009

AP logo
Audio.TST December 2009

Notes from the Test Bench
Output
Sound Advice

Notes from the Test Bench

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

Well, I think everyone can agree on one thing: that no matter how you measure the results, that was one tough year.

It helped that R&D must go on regardless of economic conditions, and that we lead the industry with new tools for new challenges. Issues with HDMI or emerging digital audio formats and protocols simply can't be solved with a distortion analyzer, no matter how determined the engineer.

October marked our 25th anniversary, and since then there is every indication that our customers' ongoing R&D investment will pay off, as production lines come online in 2010. It's a welcome trend to observe.

So on behalf of us all here at AP, I wish you the best of the season, and here’s to a prosperous new year for everyone.

Bruce

Output: APx API Wrapper for VEE and MATLAB

AP's new API Wrapper resolves .NET limitations in VEE and MATLAB, allowing them to access the complete APx API for automation and systems integration.

The APx API (Application Programming Interface) supports the .NET framework, allowing extensive automation and data exchange using any .NET compatible programming language. Two of the popular languages that work with APx are VEE from Agilent, and MATLAB from The Mathworks. VEE is a graphical language designed to utilize interconnected hardware for measurement and analysis. MATLAB is optimized for computationally intensive tasks and has advanced graphing capabilities.

The APx API makes extensive use of .NET interfaces. In programming terms, an interface contains no functional code, but serves as a bridge between a program and the outside world. Although VEE and MATLAB can see these interfaces, their .NET implementation only enumerates a small subset of the properties and methods that are contained in them, leaving the others inaccessible.

To overcome this problem, AP software engineers have created a class wrapper—a dynamic link library (DLL) that wraps the APx API interfaces in classes, so that all the API objects become visible from within VEE and MATLAB. The wrapper is available as a separate download for APx 2.4, but starting with APx 2.5, it will be installed along with the APx application. We aren’t currently aware of any other programming languages that need the wrapper, but if any arise, the wrapper should accommodate them as well.

Block diagram.

Accessing the API directly vs. using the API wrapper.

Using the wrapper imparts no performance penalty, and it is essentially transparent—all you have to do is reference it at the beginning of your code. In a default installation, you would reference the API wrapper at:

C:\Program Files\Audio Precision\APx500 x.x\Api\AudioPrecision.API2.dll

where x.x is the version of APx500 you are running.


Using the APx API Wrapper with VEE

To use the wrapper in a VEE program, proceed as follows:

1) Open VEE and add references to both the standard and wrapper APx API .dll files.

.NET assembly references dialog box.

Adding references to the APx500 API and API wrapper to the VEE program.

2) Create an instance of the "APx500_Application" object. This is the API object contained in the new DLL. To do so, select a Constructor for the APx500_Application object under AudioPrecision.API2 in the Function and Object Browser.

Function and object browser.

Creating an instance of the APx500_Application object.

3) Once the instance of the APx500_Application object has been added, you can build your APx500 program by adding a series of .NET operation builders.

Selecting Device />Operation Builder, then “Select a Type” in VEE Express.

Adding a .NET operation to the VEE program.

A simple sample program written in VEE is shown below. It does the following:

  • Opens APx500 with the application window visible.
  • Turns off the signal monitors.
  • Selects the measurement named Frequency Response in Signal Path1.
  • When the Start button is clicked, it sets the start frequency, stop frequency, and analog generator level, and then runs the Frequency Response measurement.
 

VEE program shown in graphical interface.

Completed VEE program  (see larger version)  (view VEE code text file).

Using the APx API Wrapper with MATLAB

Our MATLAB code accomplishes the same tasks as the VEE example above. The first three lines reference the API wrapper.

Matlab code in matlab code editor.

MATLAB wrapper example  (see larger version)  (view MATLAB code text file).

Wrap Up

The API wrapper now gives VEE and MATLAB complete access to the APx API. That, along with our existing .NET connectivity and the APx LabView driver, makes it possible to integrate APx into virtually any test and measurement environment.


Related Downloads:
  • APx API Wrapper (for APx 2.4)

Sound Advice: AP Knowledge Base
Measuring PSRR (Power Supply Rejection Ratio) with APx

The new APx PSRR Measurement Utility joins our existing FM MPX-RDS, Damping Factor, and Speaker Impedance Measurement Utilities to further extend APx's flexibility and ease of use. This article is an excerpt from our new Technote 106 (available for download), which explores measuring PSRR in further depth.

by Joe Begin, Audio Precision's Director of Technical Support

APx psrr measurement utility interface. showing graph of psrr, rising from about 100 db to about 145 db at 3 khz, then slight decline to 135 db at 20 khz.

Figure 1.  APx PSRR Measurement Utility  (see larger version).

Power Supply Rejection Ratio (PSRR) is a measure of a device’s ability to reject noise from the supply used to power it. It is defined as the ratio of the change in supply voltage to the corresponding change in output voltage of the device. PSRR is often expressed in dB (equation 1), where ΔVin is the change in voltage input and ΔVout is the change in voltage output. However, due to lack of standardization, the ratio is sometimes inverted, and the value in dB is sometimes expressed as a negative number.

Equation: psrr equals 20 log the quantity delta v in over delta v out................................................. (1)

PSRR measurements are typically made for ICs and other functional assemblies. To measure such a device’s power supply rejection, we need to insert an AC signal (ΔVin) in series with the DC voltage from the supply and examine the device’s output (ΔVout) for the presence of the signal. It is often desirable to measure PSRR over a range of frequencies and to produce a spectrum plot of PSRR versus test signal frequency.

The problem with conducting a PSRR test with a DC supply is that most signal generators (the generator in an AP audio analyzer included) cannot be connected directly in series with a DC power supply. First, the DC current drawn from the power supply to the device must flow through the signal generator, and this current could be substantial. In addition, the output impedance of most signal generators is likely to cause an excessive voltage drop, and very few signal generators can be floated to typical DC voltages.

There are three possible solutions to these problems:

  1. Build a transformer circuit to couple the AC test signal in series with the power supply.
  2. Use a special commercially available power supply that is capable of combining an arbitrary AC signal with DC power.
  3. Use a DC-coupled power amplifier.

Methods 1 and 2 are described below in further detail.

1) Transformer Circuit

By attaching a signal generator to a transformer primary, and running DC through the secondary, we can couple an AC voltage onto the DC supply. The test configuration is shown below.

Diagram: generator channel one out to transformer in, transformer out through power supply in series to device. analyzer channel one from power at device, channel two from device output.

Figure 2.  Connections for testing a DUT using the PSRR transformer test fixture  (see larger version).

For convenience, we built the transformer circuit into a project box with appropriate connectors on the input and output side.

Test fixture box, showing inputs at one end, outputs at other end, and transformer mounted inside.

Figure 3.  Completed PSRR test fixture.

The primary windings have been connected in series, to provide an input impedance of approximately 600 Ω. The secondary windings can be connected in series for a 1:1 voltage ratio, or we can connect one for a 2:1 step-down.

XLR, bnc, and banana inputs to split primary in series. split secondary to individual banana outputs.

Figure 4.  Schematic of the PSRR test fixture.

We selected a Jensen JT-123-BLCF transformer, due to its low distortion, flat frequency response, and split winding flexibility. One of the pitfalls of using a transformer for this application is that excessive DC current can saturates the core, causing the AC signal to distort. To determine its current capacity, we measured the distortion of a 20 Hz sine wave coupled to a DC voltage at a number of different current levels. As seen in Figure 5, the distortion begins to rise sharply as the current exceeds about 500 mA DC.

THD + n is around .05 to .2 until it rises starting at 500 ma to a peak of .6 at 1050 ma.

Figure 5.  Transformer saturation test results.
2) Power Supply with DC and AC Output Capability

A special power supply with the ability to add an AC signal to its DC output is used. One example in this category is the Kepco BOP series, a high-powered operational amplifier / power supply with outputs capable of both sustained DC and arbitrary AC waveforms. Additionally, the outputs can operate as a sink as well as a voltage and current source.

Diagram: generator channel one out to power supply audio in, power supply out to device. analyzer channel one from power at device, channel two from device output.

Figure 6.  Connections for testing a DUT using the DC + AC Power Supply  (see larger version).

After selecting the required DC voltage, we connect the signal generator output of an audio analyzer to the Voltage Programming Input on the front panel of the power supply. The input has a fixed gain of 2.0 to 20.0, depending on the model. This gain must be considered when selecting the audio analyzer generator voltage.

This article continues in Technote 106. Download Technote 106 for complete instructions in using the utility, examples, and a comparison of results between the two methods.


Related Downloads:
  • Technote 106: APx PSRR Measurement Utility
  • APx PSRR Measurement Utility

Other Recent Knowledge Base Articles:
  • AUX-0025 Input Impedance

 

back to top >

©2009 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