Audio Interface Frequency Response Measurement with Electroacoustics Toolbox

This article was originally published in the forums for version 2 of Electroacoustics Toolbox. Please visit the following link for an updated tutorial for version 3.

Frequency Response Measurement with Electroacoustics Toolbox 3

Measuring the Frequency Response of Your Audio Device

One of the most powerful tools in Electroacoustics Toolbox is the Dual FFT Analyzer, which is capable of measuring system transfer functions and even indicating the quality of the measurement. This tutorial focuses on using the Dual FFT Analyzer to measure the frequency response of the audio device that you use to measure other systems and devices. If you want to measure the frequency response, or impulse response, of a listening room for example, that measurement will be affected by the quality of the audio interface that you are using to make the measurement. Therefore, it is important to know how your measurements will be influenced by your audio interface.

When measuring the properties of some device, like its frequency response, that device is commonly referred to as the “device under test” or DUT. In this case, the DUT is actually the audio device that would normally be used to measure some other device or system.

Measuring Your Audio Device

  1. Connect your device to your Mac (if necessary, you may want to consult your device’s user guide or owner’s manual).
  2. Using a patch cable that is appropriate for the device you are using, connect one or more outputs of the device to one or more inputs of the same device. Figures 1 and 2 demonstrate the connections using an Echo Indigo io PCMCIA card interface and an Echo AudioFire4 FireWire interface, respectively. It is important to keep in mind that what will be measured in this tutorial is actually the combined frequency response of the input channel, the output channel, and even the patch cable between them.
    Figure 1: Stereo mini-plug patch cable

    Figure 1: Stereo mini-plug patch cable

    AF4

    Figure 2: 1/4″ plug patch cable

  3. Launch Electroacoustics Toolbox.
  4. Create a new project if one was not created automatically when the program launched.
  5. Click the Device IO button in the project window’s toolbar to open up the Device IO Setup window.
  6. In the Device IO Setup window, click on the name of the device you would like to measure in the Available Devices list. This will display the device’s properties in the lower portion of the window.
  7. Make sure the nominal sample rate is set high enough to capture the desired frequency range.
  8. Create a new Dual FFT Analyzer tool. This can be accomplished by clicking the “Add” button () in the Dual FFT Analyzer row of the project toolbox, selecting Dual FFT Analyzer from the Tools menu in the project window’s toolbar, or by selecting New Dual FFT Analyzer from the Tools menu.
  9. Select the DUT from the Input Device popup menu in the signal drawer of the Dual FFT Analyzer.
  10. In the Live Data Sources box, select the input and output channels corresponding to the physical channels connected in step 2. (Hold down the Command/Apple key to select multiple non-adjacent channels.)
  11. In the FFT tab of the Dual FFT Analyzer’s controls drawer, set the number of spectral lines to a value that will provide the frequency resolution you need. The frequency resolution of your measurement can be determined by the selected frequency span (which is dependent on the sample rate) and the number of spectral lines. You can calculate the frequency resolution by dividing the frequency span by the number of lines (if guardbanding is turned off). For example, if the selected frequency span is 24000 Hz, and the number of lines is 6000, the frequency resolution will be 24000/6000 = 4 Hz. You can also view the current frequency resolution of the analyzer inside the analyzer’s info drawer, which slides out of the right-hand side of the analyzer’s window.

    Figure 3: Dual FFT Analyzer FFT Parameters

  12. Click on the Function tab of the Dual FFT Analyzer’s controls drawer to set up the measurement. The number of individual measurements that appear in the Function table will be one less than the number of channels selected in the Live Data Sources box of the signal drawer (unless only 1 channel is selected, in which case they will be equal). For each input/output channel pair that is connected by a patch cable, the output channel should be selected in the Reference popup menu, and the input channel should be selected in the Source popup menu.
  13. The name of each measurement can be edited by double clicking on it within the Name column of the Function table.
  14. From the Function popup menu, select Transfer Function (H1) Mag to measure the magnitude of the DUT’s frequency response. Figure 4 shows the Function configuration for measuring the Echo AudioFire4.

    Figure 4: Dual FFT Analyzer Function Configuration

  15. If you are only using one output channel of the device, you can select that channel in the output channel popup menu in the Excitation tab of the Dual FFT Analyzer’s controls drawer. Then jump to step 21. Otherwise, follow steps 16 through 20 to configure as many Signal Generators as necessary to measure all the desired channels.
  16. Create a new Signal Generator tool.
  17. Select your DUT in the Output Device popup menu of the Signal Generator’s signal drawer.
  18. Select the output channels corresponding to the physical output channels that you connected in step 2. Select the first output channel in the Left Output Channel box, and the second output channel in the Right Output Channel box. If you have connected more than two output channels for a multichannel measurement, you will need to create a new Signal Generator tool for each pair of output channels to be measured.
  19. Click on the Swept Sine (Chirp) tab in the Signal Generator window to display controls for establishing a frequency sweep excitation signal. Configure the swept sine generator similarly to that shown in Figure 5. The Upper Frequency should be half the selected sample rate, which corresponds to the Nyquist frequency.
  20. Start the generator, either by clicking the start icon in the window’s toolbar, or by selecting Toggle Tool On/Off from the Control menu (or by typing Command-R).

    Figure 5: Signal Generator Log Sweep Configuration

  21. Go ahead and save the project now.
  22. Create a new Meter Bridge tool.
  23. Select your DUT in the Input Device popup menu of the Meter Bridge’s signal drawer.
  24. Start the Meter Bridge.
  25. Make sure the Peak level type is selected in the Meter Bridge’s controls, then look to be sure none of the input channels are in danger of clipping (colored red at the top of the meter bar). If any of the input signal levels are too high, reduce the level in the Signal Generator (or the Excitation tab of the Dual FFT Analyzer).
  26. Start the Dual FFT Analyzer and your measurement will be underway. After a few seconds, the measured curve will stabilize and you can stop the analyzer. Figure 6 shows a plot, created by the Dual FFT Analyzer, which shows the frequency response of the Echo AudioFire4. The frequency response of the AudioFire4 is quite flat between 20 Hz and 20 kHz.
  27. Now that the frequency response magnitude has been measured, other measurements are just a menu selection away. Go back to the Function tab of the Dual FFT Analyzer and take a look at the different functions in the popup menu. All the data necessary to compute the various functions has already been acquired, so there is no need to run the analyzer again to measure the phase response. Once you have measured one of those quantities, you have essentially measured them all. All that’s left to do is change the selection in the popup menu.
  28. Capture your measurement, either by clicking the capture button in the Dual FFT Analyzer’s toolbar, or by choosing Capture Data from the Control menu.
  29. Save your project so you can review your measurement or export the data at another time.

    Figure 6: Echo AudioFire4 Frequency Response

     

iPhone Headset Input Options

One of the most obvious ways to get analog signals into an iPhone or 2nd generation iPod touch is through the headset connector. Several options exist for getting acoustic or electric signals into the headset input, which are discussed below. Any of these options will work with the iPhone, iPhone 3G, or iPod touch 2G. The original iPod touch does not have a headset connector with a mic input channel, so it is left out of this discussion.

When making a decision about what to use the headset input for, or what to connect to it, you may want to take a look at the frequency response measurements of the various iPhone OS devices.

Acoustic Signals

Acquiring acoustic signals requires some type of microphone. Several off-the-shelf options exist for attaching a microphone to the headset jack, as listed here:

Standard iPhone headsets can be used for basic sound level estimates with SignalScope ProSoundMeter or dB, without any further calibration. Using any other microphone (besides the iPhone’s built-in microphone) will require calibration before meaningful sound level measurements can be made. (dB does not support microphone calibration.)

Original iPhone users will be glad to know that the SwitchEasy ThumbTacks microphone will fit into the iPhone’s recessed headset jack. This is not true of the USBFever mic, however, so an adapter cable will be required for that mic. Another benefit that the original iPhone gains from using these mics is that the full audio sample rate will be available rather than being limited to 8 kHz, as it is with the built-in microphone.

Connecting either of the SwitchEasy and USBFever microphones will preclude the use of headphones, unless some special adapter cable is used (I’m not currently aware of an off-the-shelf solution).

Frequency response measurements of these microphones can be found here.

Electric Signals

Acquiring signals from some other source can be a little tricky for the following reasons:

  1. The headset microphone input is very sensitive (it expects a low-level microphone signal).
  2. A bias voltage is present on the headset input to power electret condenser microphone capsules (used by the afore-mentioned microphone accessories).
  3. The headset input expects to see a particular load in order to signal the OS that an external microphone is present.

Of the three issues, the third one is perhaps the most difficult. To be sure the iPhone OS will select your input signal, you can place a suitable resistor in parallel with your input. One user reported that a 3.3 kOhm resistor dropped the bias voltage from 2.7 to 1.9 VDC. When connecting the headphone output directly to the headset input for some basic frequency response measurements, I have had good success with a 670 Ohm resistor. I have also had success connecting external measurement microphones and accelerometers, using a constant-current power supply, without using an additional resistor.

The best adapter cable I have found for connecting to the headset input is a standard A/V cable, which has a four-conductor mini-plug on one end (for connecting to the iPhone) and three RCA plugs on the other end. To work with the original iPhone, the A/V adapter cable needs to have some of the plastic carved off around the mini-plug, or another adapter cable is required to fit the iPhone’s recessed headset jack.

Sometimes, connecting external signals to the iPhone’s headset jack is the most convenient, portable solution. However, working with dock connector input devices allows for up to two input signals without the complicating issues of the headset input.

It should also be noted that the iPhone 3G rolls off the low frequency response of it’s headset input below 100 Hz.

Dock Connector Audio I/O

Several options exist for getting audio signal into and out of iPhone OS devices via the dock connector. However, not all accessories are compatible with all iPhone OS devices. So, we put together this compatibility chart, based on our own tests with SignalScope/Pro and SignalSuite.

Dock Audio Accessory Compatibility

These devices were chosen for their ability to accept stereo audio input from external sources. Some dock connector devices simply feature built-in microphones, which are of limited use for test and measurement applications. It’s also important to remember that the iPhone OS automatically selects the current route for input audio signals (built-in mic, headset, dock connector, etc).

iPhone iPhone 3G iPod touch iPod touch 2G
Alesis ProTrack In/Out(1,2) In/Out(2) Out(3) In/Out(2)
Belkin TuneTalk Stereo In(1) In In(3,4) In
Griffin iTalk Pro (5) In(5) In(5) In(3,4,5) In(5)
MacAlly iVoice Pro In/Out In/Out In/Out In/Out
Tunewear Stereo Sound Recorder In(1) In In(3,4) In
  1. Even when using the dock connector for input, if the receiver or built-in speaker is the current output device on the original iPhone, the sample rate will be limited to 8 kHz (for input and output). Connecting headphones, or an adapter cable, like a stereo mini-plug to RCA adapter, will cause the headphone output to be selected and push the sample rate back up to 48 kHz.
  2. In SignalScope Pro (or SignalScope) the Alesis ProTrack appears as an input only device, so output signals are not routed to the ProTrack’s headphone out connector. The ProTrack’s headphone output does work with SignalSuite.
  3. Using a dock connector input with the original (1st generation) iPod touch appears to require that something be plugged into the headphone jack, unless the dock connector device also supports audio output (like the Macally iVoice Pro, which, ironically, is one of the few devices that is narrow enough to allow you to simultaneously plug your headphones into the bottom of the iPod).
  4. When using the original iPod touch with standard dock connector input devices, like the TuneTalk or the Tunewear device, a dock extender, like the SendStation device, will be required in order to also plug in headphones. You need to be sure your dock extender supports audio (some do not).
  5. The Griffin iTalk Pro that we tested did not work consistently–sometimes it wouldn’t be selected for input by the device. For now, the iTalk Pro is not recommended.

Frequency response measurements of these devices can be found here.

iPhone OS Audio Routes

Getting audio signals into and out of an iPhone OS device can sometimes be a bit tricky. The information presented below outlines the available means for getting audio signals into and out of each iPhone OS device.

Available Input Routes

Built-in mic Headset input Dock input
iPhone Yes(1) Yes Yes
iPhone 3G Yes Yes Yes
iPod touch No No Yes(2)
iPod touch 2G No Yes Yes
  1. The built-in microphone of the original iPhone appears to be routed through a speech-processing codec, which limits the sample rate to 8 kHz and significantly degrades the frequency response.
  2. Using a dock connector input with the original (1st generation) iPod touch appears to require that something be plugged into the headphone jack, unless the dock connector device also supports audio output (like the Macally iVoice Pro, which, ironically, is one of the few devices that is narrow enough to allow you to plug your headphones into the bottom of the iPod).

Available Output Routes

Receiver Speaker Headphones Dock
iPhone Yes(1) Yes(1) Yes Yes
iPhone 3G Yes Yes Yes Yes
iPod touch No No Yes Yes
iPod touch 2G No Yes Yes Yes
  1. Even when using the dock connector for input, if the receiver or built-in speaker is the current output device on the original iPhone, the sample rate will be limited to 8 kHz (for input and output).

Links to additional information:

1 8 9 10