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, is the impedance under test (IUT), and Z is the input impedance of the SYS-2722 analog input.Z_{in} 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 | Circuit diagram of the test jig |

### Derivation of impedance

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

* V_{b }*/

*=*

**V**_{a}*/ (*

**Z**_{tot}*+*

**Z**_{tot}**) (1)**

*R*_{fixed} where * V_{a}* and

*are the complex levels at inputs A and B respectively,*

**V**_{b}**is the known test resistance, and**

*R*_{fixed}*is the parallel combination of*

**Z**_{tot}*and*

**Z***. Therefore*

**Z**_{in} * Z_{tot}* =

**(**

*R*_{fixed}*/*

**V**_{b}*)*

**V**_{a}*–*

**/ (1***/*

**V**_{b }*.*

**V**_{a})We also know that

* Z_{tot}* =

**Z •***/*

**Z**_{in}

**(****Z +****Z**_{in}**)**And therefore we arrive at

* Z* =

**Z**_{in}

**•****/**

**Z**_{tot}**. (2)**

**(***–***Z**_{in}**Z**_{tot}**)**### **Calibrating ***Z*_{in}

*Z*

_{in}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, * V_{a}*,

*, and*

**V**_{b}*are all complex quantities. To use a SYS-2722 to measure complex impedance, we need to tackle two problems:*

**Z**_{tot}- SYS-2722 does not natively return complex values for measured levels.
- 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

*V _{b}= V cos(ø) + jV sin(ø)*

where ** V_{b}** is the complex voltage at input B,

**is the measured level on input B,**

*V***is the phase meter reading in radians, and**

*ø***. This is known as a**

*j= √-1**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

Times.re = a.re * b.re – a.im * b.im

Times.im = a.re * b.im + a.im * b.re

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 (c.re = –5, c.im = 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**

### Reference

- “Agilent Technologies Impedance Measurement Handbook”, July 2006, Agilent Technologies. Retrieved from http://cp.literature.agilent.com/litweb/pdf/5950-3000.pdf.