Measuring Complex Impedance with AP2700 Series Instruments

Created on 2008-07-11 13:01:00

Linear passive circuit elements are characterized by their impedance. Impedance is a complex quantity consisting of a real part, known as the resistance, and an imaginary part, known as the reactance. The reactance is frequency dependent and can take two forms: inductive, in which the voltage waveform leads the current waveform, and capacitive, in which the voltage lags the current. Since impedance is frequency dependent, a variable frequency generator and AC level and phase meters are required to measure it. This makes the SYS-2722 ideal for making audio-frequency impedance measurements.

This article shows how to make impedance measurements using SYS-2722, a test jig, and a supplied macro. The jig can be simply cables and a fixed resistor; AP tech support equipped a project box with connectors to make the job easier. The macro presents a user interface to set the measurement parameters. The results are shown in graphical form in the software.

Test Setup

Here,  Rfixed is a fixed resistor of known resistance, Z is the impedance under test (IUT), and  Zin is the input impedance of the SYS-2722 analog input.

As the frequency of the generator is varied, the frequency dependence of the IUT causes the measured level at input B and the measured phase between input B and input A to vary. This allows Z to be computed at each frequency.

Circuit diagram of the test jig

Derivation of impedance

From the circuit above, using the potential divider equation, we see that

Vb / Va = Ztot / (Ztot + Rfixed )                      (1)

where Va and Vb are the complex levels at inputs A and B respectively, Rfixed is the known test resistance, and Ztot is the parallel combination of Z and Zin. Therefore

Ztot = Rfixed (Vb / Va) / (1Vb / Va) .

We also know that

Ztot = Z • Zin / (Z + Zin)

And therefore we arrive at

Z =Zin Ztot / (Zin Ztot ) .                           (2)

Calibrating Zin

The unbalanced input of the SYS-2722 has an impedance of 100 kOhm in parallel with 185 pF. However, the test jig and cables used to connect the fixed resistor and the IUT may add to this. In particular, long cables are likely to add capacitance comparable to the input capacitance of the SYS-2722. For accurate measurements, it is necessary to account for this extra capacitance.

The macro in this article provides a calibration cycle for this purpose. When performing a calibration cycle, the IUT must be removed from the circuit, leaving the jig and cables otherwise untouched. Once the calibration has been performed, the IUT is returned to the jig and the measurement is made. If the jig is not changed, the code can be updated with the measured value of the input impedance, so a further calibration cycle is not needed.

Complex numbers

Because impedance is a complex quantity, we need complex mathematics to compute it. In equation (1) above, Va, Vb, and Ztot  are all complex quantities. To use a SYS-2722 to measure complex impedance, we need to tackle two problems:

  1. SYS-2722 does not natively return complex values for measured levels.
  2. AP Basic does not natively calculate with complex values.

Polar vs. rectangular representation

SYS-2722 has a level meter for each input channel, and a phase meter that measures the phase difference between input A and input B. If the generator signal is fed to input A, then the phase meter measures the phase of input B relative to the generator. This gives us a magnitude-phase, or polar, representation of the signal on input B. This can be converted to a complex value with the identity

Vb= V cos(ø) + jV sin(ø)

where Vb is the complex voltage at input B, V is the measured level on input B, ø is the phase meter reading in radians, and j= √-1. This is known as a rectangular representation. It is entirely equivalent to the polar representation, but is preferred here because it is easier to perform complex math in the rectangular representation.

Complex math in AP Basic

AP Basic calculates using real arithmetic. Special code must be written to perform complex arithmetic. This article uses a small library, Complex.lib, to handle complex numbers. The library defines a new data type as follows:

Type Complex
re As Double
im As Double
End Type

A constructor allows a new Complex to be created, and math functions take Complex parameters and produce Complex results. For example:

Function Times(a As Complex, b As Complex) As Complex = * – * = * + *
End Function

Two complex numbers can then be created and multiplied with the following code:

Dim a As Complex, b As Complex, c As Complex
a = Complex(1, 2)
b = Complex(3, 4)
c = Times(a, b)

giving the complex result in c ( = –5, = 10). AP Basic does not provide fully object-oriented classes and operator overloading, so code that makes use of the Complex library can be difficult to read at first.

Supplied macros

The easiest way to get started with impedance measurement is to use the supplied macro Impedance UI.apb. This macro was written by Audio Precision technical support, and presents a user interface to allow impedance measurements to be made easily. It also interacts with the Windows registry to store settings like the measured input impedance of your 2722.

Impedance UI.apb interacts with Impedance.apb. This macro contains the core functions which calculate the IUT impedance and the instrument input impedance from measured sweep data.
A ‘#Uses Impedance.apb statement should be included if you want to make use of these functions in your own code.

Impedance example.apb also uses the functions in Impedance.apb, but does not present a user interface. This macro is provided to show how to use these functions in your own code.

Using the macros

Both Impedance UI.apb and Impedance example.apb calculate the impedance of the IUT by running a sweep over the audio frequency range, measuring the channel A level, channel B level, and phase at each point. They then call Impedance.apb, which applies equations (1) and (2) above at each frequency to calculate the IUT impedance. The following figures are calculated and graphed:

  • Impedance magnitude (Ohms)
  • Impedance phase (degrees)
  • Resistance (Ohms)

The code can easily be changed to plot other commonly used parameters such as reactance, admittance (reciprocal of impedance), conductance (reciprocal of resistance), or susceptance (reciprocal of reactance).

Some measured results

10 kOhm resistor

DAC Input Impedance


  • “Agilent Technologies Impedance Measurement Handbook”, July 2006, Agilent Technologies. Retrieved from


AP2700 Complex Impedance Macros (185.89 KB)

Includes instructions and discussion.