Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » Measuring Impulse Responses Using Golay Complementary Sequences and Swept Sinusoids

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Endorsed by Endorsed (What does "Endorsed by" mean?)

This content has been endorsed by the organizations listed. Click each link for a list of all content endorsed by the organization.
  • IEEE-SPS display tagshide tags

    This module is included inLens: IEEE Signal Processing Society Lens
    By: IEEE Signal Processing SocietyAs a part of collection: "Impulse Response Measurement Toolbox"

    Comments:

    "A clear explanation of estimating impulse responses in acoustic signals using Golay codes and swept sine waves."

    Click the "IEEE-SPS" link to see all content they endorse.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Measuring Impulse Responses Using Golay Complementary Sequences and Swept Sinusoids

Module by: Edgar Berdahl, Julius Smith. E-mail the authors

Summary: Two impulse-response measurement methods are demonstrated, with source code provided in Matlab and Pure Data (PD). The measurement technique using Golay complementary sequences is particularly robust to additive white noise, while the swept sine measurement technique is robust to a weakly nonlinear motor exciting the linear system being measured.

Introduction

Figure 1: Linear system to be measured
Figure 1 (linsystem2.png)

Figure 1 depicts a linear system characterized by an impulse response h(n)h(n), driven by an input signal s(n)s(n), and producing the output signal r(n)r(n). The system identification problem is to estimate h(n)h(n) given known input/output signals s(n)s(n) and r(n)r(n). This module illustrates the swept-sine and the Golay complementary sequence techniques for identifying finite impulse responses. The first example measures the impulse response of a highpass filter using the Golay method, and the second example measures the impulse response of a weakly nonlinear loudspeaker driver using the swept-sine method.

Summary Of Objectives

  • To provide a general framework for characterizing single-input, single-output linear systems.
  • To demonstrate how to measure the impulse response of a linear system using Golay complementary sequences.
  • To explain some of the limitations of making measurements using standard sound interfaces.
  • To demonstrate how to find the minimum-phase spectrum corresponding to a complex spectrum.
  • To explain how to measure the impulse response of a system even if the excitation source motor is weakly nonlinear. This measurement technique uses a sine sweep test signal.

Installation

  1. Install a sound card, sound interface, or other full-duplex data acquisition card.
  2. Consider testing the data acquisition card viewing the soundcard set-up instructions.
  3. Install either MATLAB or Octave.
  4. Install pd. (Alternatively, you may use other software that is capable of recording a system's output for a given input excitation signal. The software should also be capable of reading and writing WAV files. For example, any multitrack recording software should be fine.)
  5. Download tf_meas.zip and unzip the contents into a conveniently located local directory.

Linear System

Consider the causal, single-input single-output (SISO) system shown in Figure 2. For simplicity, we will take the system to be linear and discrete-time, so that it is characterized by its impulse response h(n)h(n) or equivalently its transfer function H(z)H(z), which is the zz transform of h(n)h(n).

h ( n ) H ( z ) h ( n ) H ( z )
(1)

We will assume that both h(n)h(n) and H(z)H(z) exist so that we can discuss measuring them interchangeably. We will further assume that h(n)h(n) has finite length so that we can measure the response to an input signal in a finite amount of time. The goal of this document is to explain how to excite the system with a signal s(n)s(n), measure the response r(n)r(n), and use s(n)s(n) and r(n)r(n) to determine h(n)h(n) (and equivalently H(z)H(z)). In particular, it is useful to pick a signal s(n)s(n) that contains a large amount of energy so that measurement noise will not significantly corrupt the measurement results.

Figure 2: Linear system
Figure 2 (linsystem.png)

Limitations Of Sound Interfaces

Sound cards and sound interfaces are not designed for making transfer function measurements. They merely provide a cost-effective solution since almost all computers have sound cards. We demonstrate these weaknesses given measurements made on a PreSonus Firepod sound interface. The output from channel 1 was directly connected to the line input on channel 1, and the sampling rate was fS=44.1fS=44.1kHz.

  1. Sound interfaces attenuate frequencies near DC and near half of the sampling rate fS/2fS/2. Figure 3 shows the measured magnitude response of the sound interface. Ideally it would be constant for all frequencies. However, Figure 3 shows that the -3dB point for the DC blocker lies near 5Hz. The anti-aliasing filters cause the magnitude to roll off sharply such that the high frequency -3dB roll-off point is about 20.9kHz.
    Figure 3: Magnitude response of the PreSonus FirePOD sound interface when the channel 1 output is directly connected to the channel 1 line input
    Figure 3 (direct2Mag.png)
  2. The same sound interface filters cause the phase response measurement to be incorrect as well. Although ideally the phase response would be 0 radians for all frequencies, Figure 4 reveals that the phase measurement is distorted in roughly the same regions where the magnitude measurement is distorted.
    Figure 4: Phase response of the PreSonus FirePOD sound interface when the channel 1 output is directly connected to the channel 1 line input
    Figure 4 (direct2Phase.png)
  3. Even when a computer is programmed to pass an input signal flowing into the sound interface input out of the sound interface output as fast as possible, there is a delay or latency. This delay is typically on the order of tens of milliseconds. Figure 5 shows the impulse response measured on the PreSonus card. The latency is approximately 62ms. The latency could have been decreased some by adjusting software settings in pd . The impulse response also rings noticeably due to the anti-aliasing filters.
    Figure 5: Impulse response of the PreSonus FirePOD sound interface when the channel 1 output is directly connected to the channel 1 line input
    Figure 5 (direct2ImpResp.png)
    For reference, we provide the measured impulse response shown in Figure 5.

Minimum Phase Systems

One further consequence of the delay is that determining the phase response of the measured system is more complicated. The delay is responsible for a linear phase term since δ(n-k)e-j2πfk/fSδ(n-k)e-j2πfk/fS. If the delay is known (or measured), then it may be removed by multiplying the measured spectrum by ej2πfk/fSej2πfk/fS. However, if the system being measured is known to be minimum phase, then the folded-cepstrum method may be applied to find the minimum phase frequency response corresponding to the measured frequency response.

The transfer function measurement toolbox assumes that the system being measured is minimum phase. This is a valid assumption in many cases. For instance, all strictly positive real transfer functions are minimum phase. Dissipative systems are strictly positive real (and therefore minimum phase) if the appropriate quantity is measured and the sensor and motor are collocated. For example, if s(n)s(n) controls a motor exerting a force on a dissipative system, and r(n)r(n) is the velocity at that same point, the corresponding transfer function will be minimum phase. This holds for other dual variable pairs such as torque and angular velocity, voltage and current, and pressure and fluid flow.

For systems that are not minimum phase, such as systems involving a transmission delay between the input and output quantities, the phase plotted by the transfer function measurement toolbox is not the system phase response, but rather the minimum phase response corresponding to the measured system phase response.

High Pass Filter Measurement

The circuit shown in Figure 6 was measured using the Golay complementary sequence method to show how the sound interface non-idealities affect a measurement. VINVIN was connected to the output of channel 1 of the PreSonus sound interface, and VOUTVOUT was connected to the line input of channel 1 of the interface.

Figure 6: High pass filter electrical circuit
Figure 6 (hpf.png)

The analog transfer function H(f)H(f) can be determined analytically using the voltage divider rule:

H ( f ) = V O U T ( f ) V I N ( f ) = R R + 1 j 2 π f C = j 2 π f R C j 2 π f R C + 1 H ( f ) = V O U T ( f ) V I N ( f ) = R R + 1 j 2 π f C = j 2 π f R C j 2 π f R C + 1
(2)

In this case, R=1R=1kΩΩ and C=0.47μC=0.47μF, so the -3dB point is about f3dB=12πRC340f3dB=12πRC340Hz. Figure 7 and Figure 8 show that the frequency response is accurately measured in the range of about 10Hz to about 9fS/209fS/20.

Figure 7: Measured magnitude response of the high pass filter
Figure 7 (hpfMag.png)
Figure 8: Measured phase response of the high pass filter
Figure 8 (hpfAngle.png)

The ringing in the measured impulse response distracts from the more subtle characteristics of the ideal high pass filter impulse response. For transfer functions that pass large amounts of energy at high frequencies, it may be more instructive to inspect the frequency domain measurement results.

Figure 9: Impulse response
Figure 9 (hpfImpResp.png)

Sine Sweep Measurement of a Weakly Nonlinear Loudspeaker Driver

To exeraggerate the nonlinearity of a loudspeaker, we cut the cone of a mishandled driver as shown in Figure 10. We monitored the sound pressure several centimeters in front of the dustcap using an Audio Technica AT4049a microphone, which has a flat magnitude response to within 3dB from 100Hz to 5kHz. The output from channel 1 of the PreSonus sound interface was connected to the speaker via a power amplifier, and the microphone was connected to the microphone input of channel 1 on the sound interface. The following results are typical of sine sweep measurements to show how with a weakly nonlinear motor.

Figure 10: Mishandled driver with additional cuts in the cone
Figure 10 (bsn.png)

Inverse filtering the measured response results in Figure 11, which is a plot of nonlinear2ImpResp.wav. The linear contribution corresponds to the spike at the beginning, while the weakly nonlinear terms are clustered closer to the end of the response.

Figure 11: Full-length response
Figure 11 (nonlinear2FullLength.png)

The main linear contribution is cut out and plotted in Figure 12. The measurement was not made in an anechoic chamber, so there is a reflection about 15ms after the main impact.

Figure 12: Linear impulse response term
Figure 12 (nonlinear2LinearTerm.png)

The nonlinear terms are shown magnified in Figure 13. The lower order nonlinear terms toward the right have larger magnitude but overlap less in time (see Figure 13). Note that (Reference) implies that the overlapping could be reduced by increasing the total length TT of the sweep excitation signal.

Figure 13: Nonlinear response terms
Figure 13 (nonlinear2NonlinearTerms.png)

The magnitude and phase responses corresponding to the linear impulse response term from Figure 12 are shown in Figure 14 and Figure 15 in blue. For comparison, another sine sweep measurement was made at a lower level so that the speaker behaved approximately linearly. Decreasing the level also resulted in more noise and even some systematic error, as is evidenced by the red curves in Figure 14 and Figure 15. This comparison demonstrates that making measurements at larger levels can reduce the effects of noise, while nonlinear motor effects can be overcome with the sine sweep measurement technique.

Figure 14: Proportional to magnitude response of h(n)h(n)
Figure 14 (nonlinear2Phase.png)
Figure 15: Phase response of h(n)h(n)
Figure 15 (nonlinear2Mag.png)

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks