You are on page 1of 26

PAPERS

Transfer-Function Measurementwith Maximum-Length Sequences*


DOUGLAS DRA Laboratories, D. RIFE VA 22170, USA

Sterling, AND

JOHN VANDERKOOY** Audio Research Group, University of Waterloo, Waterloo, Ont. N2L 3Gl, Canada

A comprehensive analysis of tranfer-function measurement based on maximum-length sequences (MLS) is presented. MLS methods employ efficient cross correlation between input and output to recover the periodic impulse response (PIR) of the system being measured. For perfectly linear noiseless systems, the PIR so obtained is shown to be identical to the system's response to a simple periodic square pulse. In the face of external noise and nonlinearities, the MLS approach is shown to be as robust as timedelay spectrometry (TDS). Like TDS, MLS methods are also capable of rejecting or selecting nonlinear (distortion) components when measuring weakly nonlinear systems. An MLS coherence function is defined that is not unlike the coherence function usually associated with dual-channel FFT analyzers. Finally, a new low-cost instrument based on the IBM-PC makes MLS measurements generally available and affordable.

0 INTRODUCTION The use of maximum-length sequences (MLS) to measure the impulse response of linear systems is not new; the basic idea can be traced back at least two decades [ 1]. Binary MLSs are periodic two-level pseudorandom sequences of length L = 2/v - 1, where N is an integer, which yield essentially an impulse under circular autocorrelation [2]. The basic idea is to apply an analog version of an MLS to a linear system, sample the resulting response, and then cross-correlate that response with the original sequence. The result of the cross correlation is essentially the system impulse response. Schroeder [3] used MLS methods to measure the impulse response of concert halls and also derived the reverberant decay curve by reverse-integrating the square of the measured response. Alrutz, as described in Ando [4], refined the technique by speeding up the cross-correlation calculation with an algorithm adapted from Hadamard spectroscopy [5]. More recently, Borish and Angell [6], independently of Alrutz, discovered * Presented at the 83rd Convention of the Audio Engineering Society, New York, 1987 October 16- 19;revised 1988 August 16. ** Member of the Guelph-Waterloo program for graduate work in physics,
J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

and published essentially the same cross-correlation algorithm. While these references show that MLS measurements are practicable and generally provide high noise immunity, they focus rather narrowly on either computational algorithms or specific applications such as room acoustic measurements. We feel that a wider view of MLS methods is called for. With the development of the first commercial MLS instrument by one of the authors (DR) [7], it became possible to perform many experiments which led to a wider and more comprehensive theoretical framework. The results convinced us that the MLS approach is not only viable but actually preferable for many applications over other techniques, including dual-channel fast Fourier transform (FFT), periodic pulse testing, and time-delay spectrometry (TDS) [8]. We show that, under ordinary conditions, the impulse response obtained from an MLS measurement is identical to that obtained directly by periodic pulse excitation, except that noise and distortion immunity is now comparable to TDS. Furthermore, with preemphasis and preaveraging techniques, we show that the overall noise immunity of MLS is actually superior to that of TDS for most applications. In periodicpulse testing, the impulseresponseis measured by applying a narrow pulse to the system. If
419

RIFE AND VANDERKOOY

PAPERS

the pulse is narrow enough, the system's impulse response is obtained directly without the need for further processing. But the narrow pulse has a very high crest factor and hence a very low energy content, and many repetitive measurements must usually be made and averaged together to obtain an acceptable signal-to-noise ratio. Thus, in practice, the pulse is made periodic to facilitate such averaging. Nevertheless, periodic pulse testing has become quite popular, because of both its conceptual simplicity and its low cost. For loudspeaker measurements, at least, the obtainable signal-to-noise ratio is not as low as might be expected because loudspeakers are typically power limited rather than peak limited, that is, they can tolerate a relatively high pulse amplitude due to the low average pulse power at low pulse repetition rates. Periodic pulse testing of loudspeakers is explained in detail in Berman and Fincham [9a], and many of their results and recommendations can be applied to the MLS method since, except for the superior noise and distortion immunity of MLS, we show that the two techniques are fundamentally equivalent for perfectly linear noiseless systems, For the periodic pulse method, however, any nonlinearity in the system directly modifies the shape of the measured response, and no amount of averaging can reduce the effects of distortion. Consequently, there is no way to separate the linear component of the response from the nonlinear components. TDS, in contrast, can track either the instantaneous fundamental frequency of the system's response to chirp excitation (linear component)while rejecting its harmonics (nonlinear components) or track the individual harmonics while rejecting the fundamental. We show that MLS methods can also distinguish between linear and nonlinear components of the measured response, although, unlike TDS, such discrimination takes place in the time domain rather than in the frequency domain, Despite the usual association of TDS with the energy-time curve, this curve is available to any technique capable of measuring the complete transfer function or equivalently the impulse response. The energytime curve is simply the envelope of the impulse response and, although its physical interpretation is controversial, the envelope has a precisemathematicaldefinition. We show how a smoothed version of the envelope can be efficiently computed directly from the measured impulse response, Similarly, the time-selective property of TDS, which rejects unwanted reflections, is available to any technique that can produce the system impulse response, In loudspeaker testing applications, for instance, TDS rejects reflections by means of its narrow-band tracking filter, but this is entirely equivalent to multiplying the measured impulse response by a suitable window function which isolates the initial "anechoic" portion of the response from the delayed room reflections. In most implementations of TDS, this window function, which corresponds to the tracking filter's effect, is Gaussian and is positioned in time according to the programmed delay. In contrast to TDS methods, MLS techniques
420

allow a wide variety of windows and delays to be applied as simple postprocessing operations after computation of the impulse response. Thus with the periodic pulse and MLS methods one simply selects the initial part of the impulse response by mu!tiplication with a suitable window function and then Fourier transforms the result to obtain a nearly reflection-free transfer function. Perfect isolation of the main response from the reflections is generally impossible, for there is always some overlap of the tail of the main response with the room reflections. Lowfrequency information is contained mostly in the tail of the main response, so it is generally not possible to accurately characterize the low-frequency anechoic response of a loudspeaker in a small reflective room using any method. Perfect elimination of reflection effects demands a sophisticated deconvolution operation basedon adetailedknowledgeofboththepolarresponse of the loudspeaker as well as the room's characteristics, knowledge that is generally unavailable. One must therefore delay and attenuate the unwanted reflections as much as possible, either by employing a large room with sound-absorbing walls or by performing the measurement out of doors and far from the ground. The main point here is that reflection effects depend on the geometry of the physical measurement setup and are independent of the particular measurement method employed. Thus a TDS measurement made in a small room has no advantage with regard to reflection elfects compared to an MLS measurement made in the same room assuming an equivalent window function is used. In dual-channel FFT analyzers the transfer function is often measured with random white-noise excitation and statistical computational methods. Because of the random nature of the excitation, long measurement times are required to reduce random effects. Such statistical methods require that both the system input and output be measured simultaneously, whereas with MLS, because the stimulus is deterministic and repeatable, only a single acquisition channel is required. Furthermore, dual-channel methods demand the use of data-tapering windows with their attendant compromises, whereas, with MLS, windows are not required as long as the cross-correlation calculation is performed over exactly one MLS period. Nevertheless, statistical FFT methods are important because the theory behind them is highly developed. We relate the MLS method to the statistical FFT methods and show that the coherence function-often used in dual-channel measurements to validate the transfer function in the face of external noise and nonlinearities--can be defined and computed for MLS measurements as well. Overall, we believe that the MLS approach has been too often ignored or at least associated only with room acoustics applications. While room acoustics measurements are important, MLS methods are actually quite general and mathematically elegant. They can be employed in any application in which the system impulse response or transfer function must be measured accuJ. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

rately in the minimum amount of time under adverse experimental conditions, 1 BASIC THEORY MLSs [2] are periodic binary sequences conveniently generated recursively by digital shift registers. Davies [1], not unlike other authors writing two decades ago, interpreted such sequences as piecewise discontinuous analog signals and applied analog signal theory to derive their properties. Today it is more precise and less confusing to treat them as the discrete-time periodic sequences they really are. Therefore, we first review some basic concepts of discrete-time analysis and consider fully discrete-time MLS measurements before making the application to continuous-time systems. Impulse

as the impulse response (IR) and h'(n) as the periodic impulse response (PIR). Although these terms are not mathematically correct for discrete-time analysis, they are convenient, and their exact meaning can always be inferred from the context in which they are used. Also all index arithmetic for periodic sequences is henceforth modulo L unless otherwise noted. The relationship of the PIR h'(n) to the IR h(n) can be determined by performing the linear convolution of _'(n) with h(n), +:_ _'_ g'(k)h(n k= -_c +:_ = _'_ h(n + kL) .
k= --_c

h'(n) =

k)

(5)

1.1 Time Aliasing

and the Periodic

Response The discrete-time version of the Dirac delta or impulse is the unit-sample sequence defined as

The operationsof Eq. (5)can be visualizedgraphically with the aid of Fig. 1. The periodic sequence h'(n) is constructed by shifting successive L-point segments of h(n) to the origin and summing them together. This form h'(n), is often called time aliasing in the signalprocess, which effectively wraps h(n) back on itself to processing literature. We also adopt this term to mean Eq. (5) for its brevity and convenience. if the IR h(n) decays to a negligible value over its first L samples, then time aliasing is avoided and the PIR h'(n) will closely approximate the first L samples of the IR. The relevance of time aliasing lies in the fact that, as we shall see, MLS methods necessarily measure the PIR and not the true IR. Hence it is essential to understand the time aliasing when performing and

_(n) =

1, 0,

n = 0 otherwise .

(1)

A linear time-invariant discrete-time system is eompletely described by its unit-sample response h(n) and the output sequence y(n) is related to an input sequence x(n) by discrete linear convolution, y(n) = x(n) * h(n)
+:c

_', x(k)h(n k=-:_

k) .

(2)

interpreting MLS measurements. Time aliasing can also be given a complementary frequency-domain interpretation. The z transform of

Consider now a periodic unit-sample sequence of period L,

a'(n) =

0,

otherwise .

(3)

an apostrophe to distinguish them from related aperiodic 1, n mod L = are 0 herein marked with Note that periodic sequences sequences. A linear system can also be characterized under periodic convolution by its periodic unit-sample response denoted by h'(n). For a periodic input x'(n), the periodic output y'(n) is given by periodic convolution defined as y'(n) = x'(n) h'(n) _h,(n)
h'(n)=

__%',,_ Lff" (a)

hl(n)+h2()n +h_(n)*.-

= _
k=0

x'(k)h' (n -

k)

(4)
n h2(n)

where the index (n -

k) is evaluated

modulo L and

(b) Fig. 1. Time aliasing of impulse response h(n) to form periodic impulse response h'(n) of period L.
421

where h'(n), y'(n), and x'(n) are all periodic sequences with period L. We will henceforth often refer to h(n)
J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

RIFE AND VANDERKOOY

PAPERS

an aperiodic

sequence

x(n) is defined as +:_ _ x(n)z-" n=-o_

adopt this mapping in the analysis that follows. Any MLS is periodic with period L, which is always one less than a powerof 2. Thus (6) L = 2N1 (8)

Z{x(n)} = X(z) =

where the variable z is complex and is often graphed on a complex plane called the z plane. When the z transform is evaluated for values of z that fall on the unit circle (Izl = 1), the result is the spectrum of the sequence, and the angle that a point on the unit circle makes with the real (horizontal) axis is interpreted as angular frequency. The spectrum of an aperiodic sequence is continuous (that is, it exists for every point on the unit circle). The z transform of h(n), denoted by H(n), is therefore continuous and is the discretetime transfer function of the system represented by h(n). While the z transform works nicely for aperiodic sequences, it does not converge for periodic sequences, The spectrum of a periodic sequence, however, does exist, as defined by the discrete Fourier transform (DFT), N-l X(n) = _ x'(k)e -2_jnk/N k=0 (7)

where N is an integer. The important property of an MLS is that its periodic autocorrelation is essentially a periodic unit-sample sequence. If s'(n) is a symmetrical MLS of period L, then

rbss(n) = s'(n)dps'(n) 1 L-1 -----_ s'(k)s' (k + n) L k=0 where dp denotes circular (bss(0) = 1 - 1 Cbss(n) , L correlation and (10) 0 < n < L . (9)

where j = X/W1. The spectrum of a periodic sequence is discrete (that is, it exists only for a finite number of frequencies), We now consider the relationship between the true transfer function H(z) = Z{h(n)} and the time-aliased transfer function H(n) = DFT[h'(n)]. It can be shown [10] that H(n) comprises discrete samples of ri(z) taken at uniformly spaced points (frequencies) on the unit circle. Ifil(z) varies slowly as we progress around the unit circle, the spectral samples will not "alias" H(z) and interpolating H(n) will represent a good approximation to H(z). However, if H(z) varies too rapidly, H(n) will be an "aliased" version of H(z). Thus the time-domain requirement that the IR h(n) decay sufficiently over its first L samples to be approximated accurately by the PIR h'(n) corresponds in the frequency domain to the requirement that H(n) comprise a sufficiently dense set of spectral samples to accurately represent the true transfer function H(z) on the unit circle. Otherwise (with time aliasing) we cannot represent all the spectral detail in the z transform of h(n) with the limited number of spectral samples provided by the DFT ofh'(n). This is how time aliasing manifests itself in the frequency domain. Note that time-aliasing effects can be made arbitrarily small by choosing a sufficiently long MLS period L. 1.2 MLS Measurement in Discrete Time

Thus the periodicautocorrelationof an MLS is unity for a zero shift and - 1/L for all other shifts. For clarity and convenience in the analysis it is desirable to normalize the autocorrelation by (L + 1) instead of the usual factorL shown in Eq. (10). This renormalization yields a slightly different expression for the autocorrelation sequence given by F/ss(n) = s'(n)dps'(n) L-1 5] s'(k)s'(k + n) L + 1 k=0 1

and now

(11)

L F/ss(O) L + 1 -1 F/ss(n) L + 1 0 < n < L . (12)

In this renormalized form, the peak-to-peak excursion of the autocorrelation is unity, and this permits _ss to be expressed as the sum of the periodic unit-sample sequence 8'(n) and a small dc component. 1 F/ss(n) = 8'(n) L+ 1 (13) Thus

Binary MESs are usually generated recursively with digital shift registers which produce a series of 0 and I digital bits. From the standpoint of using an MLS for transfer-functon measurement, the 1 state is usually mapped to a - 1 level and the 0 state to a + 1 level to produce a sequence that is symmetrical about zero. We
422

It is evident from Eq. (13) that as L becomes large, the second term approaches zero, and F/ss approaches the ideal aperiodic unit-sample sequence 8(n). It is very tempting to misinterpret this and conclude that MLS measurements are exact except for a small dc error. In fact, measurements using a symmetrical MLS
d. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

are virtually ac coupled; the dc response is almost totally rejected. This correct conclusion is not obvious from Eq. (13) but will be deduced from it. We show later that the dc component can be recovered using an asymmetrical MLS stimulus, If an MLS s'(n) is applied to a linear time-invariant system having a PIR h'(n), the system output y'(n) is expressed as the periodic convolution y'(n) = s'(n) (5) h'(n) L-_ = _', s'(k)h'(n k=0 To recover

k) .

(14)

the PIR, the system output y'(n) is cross-

correlated with theinput MLS s'(n). As for the periodic autocorrelation defined by Eq. ( 11), the periodic cross correlation is also normalized by (L + 1) rather than the usual factor L, as in _xy(n) = s'(n)_y'(n) L-I _ s'(k)y'(n L + 1 k=0 1 +k) . (15)

The second term in Eq. (I 8) is simply the mean value of the PIR and represents its dc component, The third term is the same dc component but scaled down by the factor 1/(L + l). The result of the circular cross correlation is therefore a virtually ac-coupled version of the PIR. This follows because the second term in Eq. (18) removes or subtracts the dc component from h'(n) while the third term only allows a small residual dc component to leak through. Thus the dc response is so attenuated as to be indistinguishable from the background noise in any practical measurement, for large L. It is therefore futile to recover it from this leakage term as attempted by Eq. (20) in Borish and Angell [6]. If the system represented by h(n) is ac coupled [the sum of h(n) over all n is zero], then the sum of h'(n) over one period is also zero, and both the second and the third terms of Eq. (18) vanish. Most audio systems are ac coupled and for these the circular crosscorrelation operation, when normalized by (L + 1) = 2 N, will yield the PIR without error. Moreover, any extraneous dc offsets will be attenuated by a factor of I/(L + 1) = 2 -N. For example, assuming L = 16 383 samples (N = 14), any dc offsets in the measuring chain are attenuated by a factor of 16 384, or by 84 dB. Now consider how an MLS measurement appears from a frequency-domain perspective. The power spectrum PS of a periodic sequence is defined as the DFT of its autocorrelation. Thus 1 L

Substituting Eq. (14) into Eq. (15) gives f_,-y(n) = s'(n)_[s'(n) = [s'(n)dps'(n)] h'(n)] Q h'(n)

PS[b'(n)] = DFT((baa) = flss(n ) h'(n)

(19)

L-IE

_ss(n)h t(n -

k)

(16)

PS[s'(n)]

= DFT(4)ss) =

k=0 which states that periodiccross correlationof output with input equals the convolution of the autocorrelation sequence flss with the system's PIR. Next, using Eq. (13) in Eq. (16) we obtain fl.,.,.(n) = _s_(n) "Q h'(n)

t
--fl

(L + 1) L '

otherwise (20)

The power spectrum of b'(n) is a constant 1/L at all frequencies, while the power spectrum of the MLS s'(n) is 1/L at dc but has a constant value of (L + 1)/ L at all other frequencies. Therefore, ignoring the dc component, a symmetrical MLS delivers L + 1 = 2N times the signal power of a periodic unit-sample seaccounts given quence for the same high peak noise amplitude. immunity This of MLS high mearatio surements.

= [ b'(n)

L + I I I . t7,(i0
L-1

= h'(n)

I _ h'(k) L + I k=0

(17) as the sum of

The phase spectrum given as O[x'(n)]

of a periodic

sequence x'(n) is (21)

where the second term can be expressed two terms, 1 L-I f_.,.,.(n) = h'(n) L k_'_ =0 h'(n)
L-I

= Arg {DFT[x'(n)]}

and for 8'(n) we have O[8'(n)l = Arg {DFT[8'(n)]} = 0 . (22)

Thus the phase spectrum (18)

of 8'(n) is zero at all fre-

1 5', h'(n) . + L(L + 1) k:0


J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

quencies, but this is not true for s'(n). Fig. 2 shows the phase spectrum of a 4095-point MLS computed
423

RIFE AND VANDERKOOY

PAPERS

digitally using a 4095-point DFT. The phase varies pseudorandomly with frequency and has a uniform probability density over its range of + _r to - ,r. We can think of an MLS generator as a bank of mutually incoherent sine-wave generators of identical amplitudes whose outputs are summed together. The cross-correlation operation can be similarly modeled in the frequency domain as a bank of synchronous quadrature demodulators, each of which is in phase with its corresponding sine-wave generator, This frequency-domain model of an MLS measurement, illustrated in Fig. 3 for a seven-sample MLS, agrees with the earlier interpretation of H(n) = DFT[h'(n)] as spectral samples of H(z) = Z[h(n)] at evenly spaced points on the unit circle. The sevensample MLS (L = 7) effectively excites the system at three discrete frequencies (excluding the dc component) represented by the three discrete-time sine-wave gerterators shown in the figure. The generator outputs are summed and applied to the system. If the unknown system is linear, its output will contain the same three input frequency components, but their amplitudes and phases will, in general, be modified by the system, The three quadrature demodulators recover the real and imaginary parts of the output frequencies relative to the respective phases of the excitation frequencies to yield the system transfer function. In general, an Lpoint MLS will excite the system at (L - 1)/2 (excluding dc) discrete frequencies spaced bf = 1/(Lgt) hertz apart, where 8t is the sample interval in seconds. In practice, of course, the demodulators are effectively implemented in the time domain by the cross-correlation algorithm. But Fig. 3 also models a measurement made with a seven-sample periodic unit-sample sequence g'(n) if we allow that the phases of the three sine-wave generators are now identical. In fact, the only essential difference between a measurement made with s'(n) and one made with _'(n) is in the excitation phase distribution. Both s'(n) and b'(n) have perfectly flat magnitude spectra (except at dc), but the MLS exhibits an erratic phase spectrum while the periodic unit-sample sequence shows perfectly uniform phase. Differences in phase alone fully account for large differences in
Phase radians

the crest factors of the two signals. Because of its uniform phase, all the energy in b'(n) is compressed into one brief time epoch consisting of a single sample while, due to its erratic phase, the energy in the MLS is distributed uniformly in time over all L samples. 1.3 Minimum Measurement Time Because an MLS is periodic it must theoretically exist for all time but, obviously, no real test signal can exist for all time. However, if the true impulse response decays to a negligible value over the first M samples, then applying at least M samples of the MLS will stabilize the system output after which an additional L samples of the MLS must be applied while the system response y'(n) is being measured. Hence, the minimum measurement time is Tm = (M + L)bt seconds, where gt is the interval between samples in seconds. In most cases, in order to avoid time aliasing, we will choose L _> M, resulting in a minimum measurement time of 2Lbt seconds. In other words, we normally would apply one full MLS period to the system to stabilize it and then apply another full MLS period to actually perform the measurement. 1.4 Dc Coupled Systems Here we show that if a constant sequence of - 1 is added to s'(n) before application to the system, then the correct dc component of the system can also be recovered. Let So(n) be such an offset MLS defined as so(n) = s'(n) 1 . (23) as a periodic

The system output y'(n) is now calculated convolution given by y'(n) = So(n) (5) h'(n) L-l = s'(k) h'(n) _ h'(n k=0

k) .

(24)

The second term in Eq. (24) is simply the dc component of the response which we can denote by H(0). Next,

0. 000

0. 250

0. 500 Frequenc9 rac

0. 750

!. 000

Fig. 2. Phase spectrum of 4095-point MLS from direct current to Nyquist frequency computed by 4095-point DFT. Each dot represents a phase angle in the range of -_r to +_ rad.
424 J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

the system output y'(n) is cross-correlated original symmetrical MLS s'(n) as


_"_sy(/'l) =

with the

s'(n)dP[s'(n) h'(n) - H(0)] h'(n) s'(n)rbH(O) L-I _ s'(n) . L + 1 k=0 (25) H(0)

= [s'(n)dPs'(n)]

course, many systems and devices operate in continuous time, and measurements of these require that the MLS be converted to analog form. The conversion of any discrete-time sequence to an equivalent analog signal is performed in a way that maps the z transform onto the continuous Fourier transform. This mapping ensures that the spectrum of any signal is invariant between continuous and discretetime domains and allows us to use discrete-time cornputation to measure continuous-time systems. This mapping is performed by a train of delta functions spaced _t seconds apart, called a comb function. Fig. 4(a) shows the comb function comb(t) and Fig. 4(b) shows its spectrum COMB(f). If each delta function in comb(t) is multiplied, in 1:1 correspondence, by a given discrete-time sequence, the spectrum of this modified comb function is also periodic and agrees exactly with the z transform of the original sequence evaluated on the unit circle. Exact conversion from discrete to continuous time is illustrated in Fig. 5(a) for two periods of a seven-point MLS. Unfortunately, the weighted delta functions in Fig. 5(a) are physically unrealizable. There are several possible solutions to this realization problem, but the most common one is to convolve the unit pulse function defined as r 1, p(t) = t0, 0 < t < _t otherwise

L-l = _ f_ss(n)h' (n k=0

k)

Because all symmetrical MLSs have (L + 1)/2 negative 1 states but only (L - 1)/2 positive 1 states [2], the summation of s'(n) over all L samples must always be -1 and the second term in Eq. (25) must therefore reduce to H(O)/(L + 1). The first term of Eq. (25) is expanded according to Eq. (17) to yield the final result L-_ H(0) 1 _ h'(k) + -L + 1 k=0 L + 1 H(0) + -H(0) -L + 1 L + 1 (26) 1 to the stimulating

_sy(n)

h'(n)

= h'(n)

= h'(n) . Thus, by adding a dc component of-

(27)

MLS we can recover the complete PIR, including the dc component. For ac-coupled systems and for dc-coupled systems in which the dc response is irrelevant, however, adding this offset is undesirable because it may tax the dynamic range of the system or the crosscorrelation algorithm without providing any useful information. Consequently, in most audio and acoustic applications we will not need or want to offset the driving MLS. 1.5 Continuous-Time Systems It is now clear that an MLS can determine of linear time-invariant discrete-time

with the weighted comb function [see Fig. 5(b)]. The boxcar signal that results [see Fig. 5(c)] is easily gencrated by a 1-bit digital-to-analog (D/A) converter which holds its output constant over each sample period. Hence, the unit pulse p(t) is often referred to as the

the PIR Of comb(t}

systems.

r
.llI.l_,

;
Im[H{I)]

;lttlI _q,, k
RetS(z)] ,m[H(2)]

lftlll o
(a)

' _

--

( _'

-_ Im[H(3)]

...... f

Hlz}

--_

_t

(b)

Fig. 3. Discrete-time frequency-domain model of MLS mcasurement for seven-point MLS.


J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

Fig. 4. (a) Comb function of spacing factor gr. (b) Fourier transform of (a) is also comb function of spacing 1/gr.
425

RIFE AND VANDERKOOY

PAPERS

zero-order hold function. Convolution with p(t) has, however, introduced the familiar aperture loss usually associated with D/A conversion. The MLS spectrum has been modified by the sinc(f) spectrum ofp(t) and is no longerperiodic.Thus while the MLSspectrum is perfectly flat in discrete time, its continuous-time counterpart follows a sinc(f) function when the MLS is realized by a zero-order hold. Note, however, that other continuous-time realizations of an MLS are possible which do not necessarily result in a sinc(f) continuous-time spectrum. To measure a continuous-time linear system we convert the MLS to an analog signal using a 1-bit D/A converter and a zero-order hold and apply it to the system whose impulse response is a(t) and whose output is band-limited by an anti-aliasing filter with impulse response b(t). Finally, sampling the anti-aliasing filter's output (that is, evaluating it at the points t = ngt, where n is an integer) returns us back to discrete time and the whole process is expressed as
* b(t)]t=n_t

yield h'(n) = [{8'(n) comb(t)} p(t) a(t)


* b(t)]t=na t

(29) which can be simplified by recognizing that the analog form of the periodic unit-sample sequence _'(n) is simply the periodic unit-pulse function denoted by p'(t) (Fig. 6) and is expressed as p'(t) = {g'(n) comb (t)} * p(t) . Using Eq. (30) in Eq. (29) gives h'(n) = [p'(t) * a(t) * b(t)]t=,a t (31) (30)

which expresses the equivalence of the MLS method with periodic pulse testing when the MLS is realized with a zero-order hold and a(t) is ac coupled. To see this, consider how periodic pulse testing is usually performed. A square pulse is applied to an analog systern, but this pulse is also normally made periodic in order to facilitate the averaging required to obtain an acceptable signal-to-noise ratio. The system output is then band-limited by an anti-aliasing filter and sampled to yield an approximation to the impulse response. But this is precisely what is expressed by Eq. (31). The fictitious signal p'(t) is just such a periodic square pulse
_(n)comb (t)

y'(n) = [{s'(n) comb(t)} * p(t) * a(t)

(28) We know from previous analysis that cross correlating y'(n) with s'(n) will yield the overall periodic unitsample response h'(n). The measured h'(n) can therefore be found by substituting 8'(n) for s'(n) in Eq. (28) to

$'(n) comb(t) +1-

o,11 lltlllllll!
_;t

.,T
(a)
+1 t _ P(t) t

,l

(a)

+1

p(t)

(b)
{s'( n ) comb(t)} p(t)

(b)
p_(t= ) {_;'(n )comb(t)} p(t)

'"
-I

"-I
(c) (c)

Fig. 5. Analog realization of seven-point MLS via 1-bit D/A converter and zero-order hold. (a) Comb function weighted by MLS. (b) Unit pulse function. (c) Convolution of(a) and (b).
426

Fig. 6. Analog realization of periodic unit-sample sequence 5'(n) as periodic pulse p'(t). (a) Comb function weighted by 5'(n). (b) Unit-pulse function. (c) Convolution of (a) and (b).
J. Audio Eng. Soo., Vol. 37, No. 6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

of width _t and period LSt. Hence audio engineers familiar with periodic pulse testing of loudspeakers [9a,b] can switch to MLS methods and gain a vast improvement in noise and distortion immunity without having to make a significant conceptual adjustment since both methods measure the system's PIR. Of course, the finite pulse width of p'(t) and the presence of the anti-aliasing filter b(t) introduce systematic errors into the measurement, but these errors will be exactly the same for either method. Both of these systematic errors can be conveniently corrected in the frequency domain based on a reference measurement in which the system represented by a(t) is replaced by a wire. Moreover, if this system can be relied upon to effectively band limit the signal, then the anti-aliasing filter b(t) can be omitted, leaving only a simple correctable sine(f) aperture loss error due to the finite pulse width ofp'(t). Time-aliasing effects are also identical for both methods. Impulse testing of loudspeakers in a particular room, for example, might reveal that a pulse repetition period of, say, 0.20 s results in a certain time-aliasing error due to room reverberation. If this is so, then it follows directly that an MLS measurement, when performed in the same room under the same conditions, must show an identical time-aliasing error when the sequence period is also 0.20 s. Practical and theoretical knowledge of this sort applies equally to both methods, Choosing the unit pulse function p(t) to realize s'(n), while convenient from an engineering standpoint, is not dictated in any fundamental way. We could have chosen a pulse that is narrower or wider than p(t) or even a function that is not a pulse, assuming the resulting convolution can be realized. To show that this is useful we will realize an MLS without a zero-order hold.

Most transducers in audio are continuous-time bipolar devices (such as loudspeakers, microphones, and phono pickups) capable of continuously responding to both positive and negative signal excursions. There exist, however, other useful transducers, including spark gaps and hammers, which respond only to unipolar discretetime trigger events but produce continuous-time output signals. Spark gaps, for example, are used for microphone calibration and in acoustic scale modelingwhile hammers are often used to stimulate vibrations in mechanical equipment (such as turntable platters). By appropriate modification of the signal, MLS measurements can be made using triggered transducers. To do so we first return to the discrete-time domain and add a constant sequence of unity to the original bipolar MLS. This produces a sequence which now toggles between 0 and + 2 rather than between - 1 and +1. This asymmetrical MLS is converted to analog form by weighting a comb function as was done for the symmetrical sequence. The result is a train of identical but irregularly spaced delta functions shown in Fig. 7(a). There are only half as many impulses as for the symmetrical case, but each is now double strength. This irregular impulse train can be realized as an acoustic signal simply by interpreting each impulse as a trigger signal to a spark gap or other triggered transducer. Clearly, if g(t), illustrated in Fig. 7(b), is the spark gap's acoustic trigger response, then the spark gap's response to the impulse train is simply the convolution of Fig. 7(a) and (b). If the spark gap's periodic trigger response is denoted by g'(t), we can rewrite Eq. (31) for spark gaps in particular and for unipolar transducers in general as h'(n) = [g'(t) * a(t) * b(t)]t=nat . (32)

{s'(n )+1} comb(t)

+z_

The dc offset introduced into the discrete-time MLS will generally have no effect because nearly all acoustic measurementsare madewith at least one ac-coupled MLS measurements are theoretically available to triggered transducers. We should point out, however, that this analysis assumes repeatability and linearity in the device in the signalpath. Thus, all the advantages of trigger response of a spark gap in the presence of an irregular trigger signal. It may therefore be necessary to redesign the high-voltage driver electronics and use lower power levels when driving spark gaps for MLS measurement purposes. In principle, the same basic idea can be applied to any triggered transducer. 2 NOISE IMMUNITY 2.1 PDF of a Filtered MLS

[ (a)

g(t)

_--"_

_ (b)

Fig. 7. Analog realization of offset seven-point MLS using a spark gap. (a) Comb function weighted by offset sevenpoint MLS. (b) Acoustic trigger response of spark gap. Spark gap trigger response to offset MLS is convolution of (a) and (b).
d. Audio Eng. Soc., VoL 37, No. 6, 1989 June

The MLS stimulus is binary in the sense that it can take on only one of two values (+I or - 1 for a symmetrical MLS). Its probability density function (PDF) is, therefore, everywhere zero except at + 1 and - 1, where it is an impulse of area 0.5. Passing an MLS through a linear filter, however, usually results in an output having quite a differentPDF.Becauseof the
427

RIFE AND VANDERKOOY

PAPERS

random character of an MLS, the central limit theorem implies that under fairly broad conditions, the PDF of a filtered MLS tends toward a Gaussian, a fact that has been experimentally verified many times. Specifically, if the sequence period is large and the impulse response of the linear filter is more than a few samples in duration, th filter output will be approximately Gaussian or quasiGaussian. There are two special filters, however, which will not produce a quasi-Gaussian output PDF. The trivial case is the identity filter [h'(n) = g'(n)] and the other case is the matched filter. A filter that is matched to the sequence s'(n) has an impulse response given as s'(-n) [that is, a time-reversed version of s'(n)]. Consider now the response r'(n) of such a matched filter to an arbitrary input sequence x'(n), r'(n) = s'(-n) x'(n)

are often made on the basis of the crest factor (ratio of peak to rms) of the excitation signal. Low crest factor signals are desirable because they contain more signal power for a given peak level. For instance, it is well known that the crest factor of a chirp is 1.414, or 3 dB--a fact often cited to explain the high signal-tonoise ratios possible with TDS. The crest factor of a symmetrical MLS realized by a 1-bit D/A converter and zero-order hold is 1.0, or 0 dB, which is 3 dB lower than with TDS. What really matters, however, is the crest factor of the signal present at the node having the lowest saturation level, not the crest factor of the input excitation itself. Therefore, we must consider how the excitation crest factor is modified by its passage through the system. A more realistic criterion for comparing obtainable signal-to-noise ratios is to compare output crest factors. This is especially true for loudspeakers which typically saturate at the output due to the mechanical limits on driver excursion. When an MLS passes through an "ordinary" linear systemits PDF tends toward a Gaussian and its crest factor therefore evolves from 0 dB at the input to a nominal 11 dB (for a Gaussian at 0.1% probability level) at the output. Fig. 8, for example, shows the PDF of the signal from a B&K type 4133 microphone placed 0.5 m from a Quad ESL-63 electrostatic loudspeaker, when fed with a 16 383-point MLS at a 50kHz clock frequency. The nearly Gaussian shape of the PDF indicates that the crest factor is close to the expected 11 dB. Although signal peaks exceeding 11 dB may occasionally occur, they will usually have negligible effect because of the distortion-rejecting properties of the MLS method (see next section). Table 1 shows the output crest factor for an eight-pole Butterworth filter driven by a 16 383-point MLS. The output crest factor is tabulated against filter cut-off frequency expressed as a fraction of the MLS clock frequency. Thecrestfactorreachesapeakofll.9dB at a bandwidth of 1/2o the clock frequency but is generally much lower than the nominal 11 dB.

L-_ = Y, s'(-k)x'(n k=0


L-1

k)

= Z x'(k)s'(n k=0

[-k])

L-] = _ x'(k)s'(n + k) . k=0

(33)

Eq. (33) shows that a matched filter is actually acorrelator. Thus, the cross-correlation operation that recovers h'(n) from y'(n) can be thought of as a matched filter, which is matched to the MLS. Passing the sequence s'(n) through its matched filter results in the autocorrelation of s'(n), which is essentially the periodic unit-sample sequence g'(n) and which obviously does not have a quasi-Gaussian PDF. Nevertheless, "ordinary" linear systems having an impulse response of more than a few samples in duration will produce an output having a quasi-Gaussian PDF when driven by an MLS. In fact, for some linear filters, very good approximations to a Gaussian can be obtained. In [11] Keele shows that a pink-noise filter produces a nearly Gaussian PDF when excited by an MLS. It must be emphasized, however, that the particular PDF produced by filtering an MLS in no way changes the previous analysis given for recovering h'(n) by cross correlation. 2.2 Excitation Crest Factor signal-to-

I-

PDF

In an overall rms sense, the maximum

ited by the saturation characteristics of the system being measured. At some signal level, a physical system will either fail or be driven into saturation. This maximum level limits the obtainable signal-to-noise ratio over a noise ratio obtainable with any excitation signal is limgiven measurement interval. Predicting the saturation level is difficult for systems containing many internal nodes (such as active filters) because the only node of consequence is the one having the lowest saturation level. Comparisons between measurement techniques
428

J_ff _'%'M, : -5

._ o

'_m { VOLTS

, *5

Fig. 8. Amplitude PDF of Quad ESL-63 electrostatic loudspeaker when driven by MLS and with no intervening filters in signal path.
J. Audio Eng.Soc., Vol.37, No.6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

The crest factor evolution of a chirp, in contrast, is highly dependet on the magnitude of the system's fiequency response. For systems with a perfectly flat response, a chirp's crest factor remains unaffected by its passage through the system while any deviation from flatness will increase the output crest factor above the initial 3 dB (see, for example, [ 12, fig. 13]). Therefore, the maximum signal-to-noise ratio obtainable with TDS (or any method employing a chirp stimulus) is at most 11 - 3 = 8 dB higher than the MLS method, but in practice this rarely occurs. In measuring a wide-band eight-pole Butterworth filter, for instance, TDS has roughly a 3-dB advantage over the MLS method, but if the filter contains significant response peaks, the advantage of TDS is reduced further. For example, if the magnitude of the frequency response contains a peak that rises a mere 3 dB above the rms level, both methods have approximately equivalent signal-to-noise ratios. This is because the system output will rise momentarily by 3 dB when the chirp sweeps through the response peak while the MLS output crest factor will hardly be affected by such response anomalies. For systems with large response variations, MLS methods have a significant advantage over TDS. Hence we do not regard TDS or MLS methods as having a distinct noise-immunity advantage, since this depends strongly on the particular system being measured, 2.3 Preemphasis Thus the PDF of a filtered MLS approaches a Gaussian regardless of the magnitude response of the particular system being measured. This fact suggests that preemphasis can be effectively employed to further increase noise immunity in an MLS measurement. Preemphasis is advantageous when the interfering noise spectrum is not fiat. This is the case for most acoustic measurements because room noise is rich in low-frequency energy due to both indoor and outdoor noise sources, Indoor sources include heating/cooling systems and appliances while outdoor sources include traffic and aircraft. Moreover, low-frequency sounds penetrate walls much more readily than high frequencies, Low-frequency noise rejection can be improved by applying low-frequency preemphasis to the MLS stimulus and then equalizing the response before digitization and cross correlation. Alternatively, equalization can Table I. Output crest factor for eight-pole Butterworth filter excited by 16 383-point MLS. Cutoff frequency is expressed as a fraction of MLS clock frequency. Cutoff frequency 0.50 0.45 0.40 0.35 0.30 0.25 0.20 0.15 0.10 0.05 0.0125 Output crest factor 1.81 1.72 1.67 1.94 2.02 2. 09 2.50 2.78 2.78 3.917 3.57 Crest factor (dB) 5.2 4.7 4.4 5.8 6.1 6.4 7.9 8.9 9.8 11.9 11.1

also be performed by software means after digitization. If a pink-noise filter is used for preemphasis, it will not only increase the low-frequency noise immunity substantially but will also provide a nearly Gaussian PDF excitation signal whose spectrum (-3 dB-peroctave rolloff) is ideal for subjective sound System evaluations. The crest factor of an MLS passed through a pinknoise filter is about 12 dB, which is only 1 dB in excess of the theoretical crest factor for a Gaussian PDF for a 0.1% probability level. At - 3 dB-per-octave rolloff, the prefiltered excitation power falls 33 dB over the approximately 11-octave span from 10 Hz to 20 kHz. Furthermore, it can be shown that the excitation power level in the lowest octave is boosted about 10 dB above the average level. Thus a 10-dB signal-to-noise ratio improvement can be made at low frequencies which more than compensates for the nominal 8-dB advantage of TDS over MLS without preemphasis. Note again that preemphasis does not help TDS much because the crest factor of a filtered chirp increases nearly as much as the low-frequency boost thus negating any possible improvement in signal-to-noise ratio. 2.4 Preaveraging Averaging several periods of the measured response before computing the cross correlation is a simple method which further improves the signal-to-noise ratio. For instance, given a sequence period of 0.328 s, averaging 16 periods takes 10.5 s assuming every other period is skipped to sum the data. The signal-to-noise ratio is thus improved by 12 dB. 2.5 Transient Noise Immunity The maximum obtainable rms signal-to-noise ratio, while important, does not completely characterize noise immunity. Of particular interest are the effects of transient noises. The cross-correlation operation was shown to be equivalent [except for a scale factor of 1/(L + 1) to a matched filter having an impulse response given by s'(- n). The problem is then to determine the response of this matched filter to a transient noise signal. A transient noise signal can be modeled as the impulse response of an "ordinary" linear system (that is, one that is not a matched filter). If the impulse response of this system is nt(n) and its output is applied to the matched filter, the output r'(n) is expressed by the simple convolution r'(n) = nt(n) * s'(--n) = s'(--n) * nt(n) .

(34)

Because convolution is commutative, the response of the MLS cross-correlation operation to the transient nt(n) is identical to the response of the linear filter nt(n) to the time-reversed MLS s'(-n). A time-reversed MLS is also an MLS [2], so the output will have a quasi-Gaussian PDF if nt(n) is of nontrivial duration and is not itself a matched filter. However, even in the
429

J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

RIFE AND VANDERKOOY

PAPERS

case where nt(n) = _(n) (the ultimate transient), the output of the cross-correlation operation is just the pseudorandom sequence s'(-n) attenuated by the factor 1/(L + 1). Consequently, MLS methods are highly immune to noise transients of all kinds. Clicks, pops, footsteps, coughs, and the like will all be transformed into benign noise distributed evenly over the entire PIR. 3 NONLINEAR EFFECTS 3.1 Modeling Weak Nonlinearity The presence of weak nonlinearity in an otherwise linear system can be modeled accurately by the nonlinear transfer function method [ 13] depicted in Fig. 9. The nonlinear system is represented as the sum of a firstorder (linear) transfer function H(f), a second-order transfer function H(fl, f2), and continuing to an nthorder transfer function H(fl .... , fn). The meaning of these high-order transfer functions can be explained by considering the second-order case in detail. H(fl, f2) gives the output magnitude and phase at frequency fl + f2 resulting from the pair of input frequencies fl and f2. If two real sinusoids at frequencies fa and fb are applied to the system, then the actual system excitation consists of the four frequencies fa, fb, -fa, and -fb- in this case there are 10 possible second-order intermodulation mixes, (fa + fa), (fb + fb), (-fa -fa), (--fb --fb), (fa + fb), (fa --fa), (fa --fb), (fb - fa), (fb - fb), and (-fa - lb), some of which are redundant and recognizable as dc and second harmonies of fa andfb. The magnitude and phase of each second-order intermodulation output frequency is related to the magnitude and phase of the two input fiequencies by the second-order transfer function H(fl, f2). The same idea applies to the higher order intermodulation mixes. The third-order intermodulation

frequency mixes, for example, are enumerated by forming all possible linear combinations of the input frequencies taken three at a time. Thus even for a moderate-length MLS, the number of possible second- and third-order intermodulation mixes is enormous. Moreover, even simple second-degree (x 2) nonlinearities require second-through sixth-order nonlinear transfer functions to modelaccurately. 3.2 Phase Randomization Because an MLS contains frequencies at evenly spaced intervals of _f = 1/L_t, the intermodulation frequency mixes of any order must always fall exactly upon some frequency in the original spectrum (except for dc). In other words, weak nonlinearity cannot produce frequencies that fall between the cracks in the original MLS spectrum. Each quadrature demodulator depicted in Fig. 3 will therefore respond to an intermodulation component falling on its frequency in the same way it responds to its corresponding signal generator. Individually, the demodulators cannot distinguish between linear and intermodulation components, both of which may be present in the output at the same frequency. Thus frequency-domain methods for extracting harmonic and intermodulation components common in conventional distortion analyzers clearly cannot be applied to MLS measurements. The essential difference between the first-order (linear) and the higher order transfer functions depicted in Fig. 9 is that the latter produce new frequency eomponents not present in the generating frequency mixes. Note that there are exceptions for certain odd-order frequency mixes such as the third-order mix (fa fa + fa) that generates the same intermodulation frequency fa- Nevertheless, an intermodulation frequency will usually be detected by a demodulator whose frequency differs from all those frequencies comprising the generating frequency mix. And due to the highly erratic nature of the MLS phase spectrum, this dethose phases comprising the generating frequency mix. Thus while the intermodulation products are indeed detected and must therefore contribute to the measured by the cross-correlation The linear commodulatoralso operates atoperation. a phase differs fromall PIR, they nevertheless appear to bethat phase randomized ponents, in contrast, are not phase randomized because they are always detected by a demodulator which is necessarily in phase with the generating input frequency. mixes involve a single frequency and must therefore In frequency-mix terms, the first-order frequency always generate the same all frequency as output. We conjecture that the effect of weak nonlinearity in an MLS measurement can be modeled as phase randomization of some unknown signal d(t) representing the sum of all orders of intermodulation products present [ 14] assures us that randomizing phase process of an arbitrary inthe system output (see Fig. 9). the Random theory signal results in a stationary random signal. Such a signal is persistent in the sense that its mean and variance are time invariant. Therefore the energy in a phaseJ. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

H_l Lineor

'

H(_ / 2nd-order

i_t_' -'

Ut_f_ 3rd-order

H(fi.._ nth-order Fig. 9. Nonlinear transfer-function model for weakly nonlinear systems,
430

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

randomized version of d(t) should be distributed uniformly over the entire period of the measured PIR. There are certain thought experiments, however, which seem to flatly contradict the phase randomization conjecture. For example, consider a system consisting of a memoryless cubic (x 3) nonlinearity followed by a perfectly linear filter and driven by a unity amplitude binary MLS. Because the stimulus is binary, the cubic nonlinearity will have absolutely no effect since 13 = 1 and (- 1) 3 = -- 1. Clearly there will be no evidence of nonlinearity in the measured impulse response since the linear filter sees the original driving MLS. Thus the system will paradoxically appear to be quite linear, although it is actually quite nonlinear. We surmise that this effect is due to the periodic phase spectrum of an infinite-bandwidth MLS. If the driving MLS is bandlimited to less than its clock rate, the paradox disappears because a band-limited MLS canot be binary and the cubic nonlinearity will be excited by a continuous range of instantaneous input levels. Evidently, the key to preventing such problems is to prefilter the MLS to produce a stimulus which has a quasi-Gaussian PDF and therefore excites the nonlinearity over a wide range of input levels. 3.3 Separability of Linear and Intermodulation Components Partial separation of intermodulation and linear components can be accomplished by regarding the initial portion of the PIR as the linear component and the tail of the PiR as the intermodulation component. Such time-domain discrimination is possible because the impulse response of an ordinary linear system is transient in nature: most if not all of the linear PIR energy is concentrated into a finite-time epoch. The energy in a phase-randomized intermodulation signal, in contrast, is distributed more or less uniformly over the entire period of the PIR and becomes more diluted in time as the MLS period increases. Consequently, complete separation of the intermodulation and linear components is only theoretically possible in the limit as the MLS period L goes to infinity, Note that, in principle, MLS-based distortion measurements are possible based on the separability of the linear and intermodulation components in the measured PIR. The tail of the PIR contains both noise plus distortion but the random noise component can be reduced by preaveraging without affecting the fixed-pattern noise caused by the nonlinearities.

erence the PIR without distortion is shown in Fig. 1l(a). The expected distortion-induced noise is quite visible in the tail of the measured PIR, but note also that this noise has a lumpy character due to the presence of several prominent peaks. This lumpiness in energy distribution is somewhat inconsistent with the stationary random signal model but the MLS phases are not truly random, and this probably accounts for the observed deviation from theory. Nevertheless, the noise energy is still largely spread out over time and becomes more thinly distributed as the MLS period increases. This can be seen in Fig. 11 (c), which shows the measured PIR of the same system but with a 16 383-point MLS. The visible character of the noise has not changed but now there are more and smaller peaks than for the 1023-point measurement. The impulse response of the bandpass filter alone decays rather quickly. Thus a 1024-point FFT applied to the initial portion of the measured PIR will yield the linear portion of the system transfer function. For reference, Fig. 12(a) shows this computed transfer function without any intentional nonlinearity present in the measuring chain, that is, it was computed from Fig. 1l(a) using a 1024-point FFT. Fig. 12(b) shows the effect of adding 25% distortion but without any time-domain separation of linear and nonlinear components. This transfer function was obtained by performing a 1024-point FFT on the distorted 1023-point PiR shown in Fig. 11(b). Note that the broad noisy section of the magnitude has risen over 30 dB at low frequencies when compared to the distortionless case. Obviously, for this particular nonlinearity, the spectrum of the intermodulation components is weighted heavily toward low frequencies, but this fact does not contradict the phase randomization conjecture because a random signal can be stationary quite independently of its power spectral density. Thus the phase randomization theory makes no prediction as to where in the spectrum the effects of nonlinearity will be most annoying, but it predicts only that the total intermodulation power in the measured transfer function will decrease as the ratio of sequence period to analysis window width is increased. Normally we choose the analysis window width based on the desired frequency resolution. Thus, for a given frequency resolution, we can always reduce nonlinear effects simply by choosing a longer period MLS. Partial time-domain rejection of the spurious nonlinear components is accomplished by applying the same

3.4 men tal Verifica tion ToExperi test the phase randomization conjecture we performed several experiments on continuous-time systems exhibiting a controlled amount of nonlinearity. One such experiment, illustrated by Fig. 10, employed an analog multiplier to introduce a controlled amount of second-degree nonlinearity into the measurement of a 14-- 18-kHz bandpass filter. With a 25% distortion level and a relatively short 1023-point MLS the measured PIR of this system is depicted in Fig. 1l(b). For refJ. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

X_

_ MLS

r------n I /"-_ ! _4-Js kH, 21kH,

IL

Fig. 10. Experimental setup for measuring nonlinear effects in MLS measurements.
431

RIFE AND VANDERKOOY 1024-point FFT to the initial portion of the distorted 16 383-point PIR of Fig. 1l(c). We would therefore expect a 16-times or 24-dB reduction in spurious frequency levels compared to using the distorted 1023-point PIR for the transfer function calculation. The actual result, depicted in Fig. 12(c), shows almost exactly 24 dB less spurious

PAPERS response at low frequencies. In principle, the spurious response can be reduced as much as desired simply by selecting a sufficiently long MLS. Thus MLS methods suppress distortion provided that the analysis window is small compared to the MLS period. The degree of suppression might seem less than

Is: 51286 _#6 to 6.23 as

(a)

Fs: 51286 Fro. 6 to 24,92 ns

(h)

Fs: 51289 Fron 9 to 24,92

(c) Fig. 11. Effect of second-order distortion on measured PIR of 14- 18-kHz bandpass filter. (a) Initial portion of PIR with no nonlinearity in signal chain. (b) PIR measurement with 1023-point MLS after addition of 25% second-order distortion. (c) PIR measurement with 16 383-point MLS also with addition of 25% second-order distortion. 432 d.Audio Eng.Soc., Vol.37,No.6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

for TDS methods, but TDS has not been analyzed carefully in this respect. A common misconception is that TDS excites the system with a single pure frequency which can give rise only to harmonic components in a weakly nonlinear system. However, a pure Fourier frequency which also sweeps is a contradiction in terms, neu IR: D[p_I: a:

In fact, a chirp is actually a broadband signal which can also stimuate intermodulation frequencies and some of these may fall within the tracking-filter passband and corrupt the measurement. Hence TDS rejects distortion entirely only in the limit as the sweep rate approaches zero and the measurement time goes to infinity,

Harm........

+pi -pi

-59 dB

__/_ 8 'l_z ..........

L[I_iI'

_ (a)

'

'

-_1_ ' 2111_1 Hi

'

+pi

neu IR: D[#]: 6 : Hann ....

-pi 9

-tO9 dB

a Hz

LI[I_AR' _ (b)

_-Iil_ Hi

*pi

new IR: D[M]: 9 : Hann ' '

'

'

'

'

'

'

'

-pi

-59 dB

__/ L_HF. qR' FREQ (c) ' ' '

-190 dB 9 Hz

Fig. 12. (a) Transfer function of 14- 18-kHz bandpass filter with no nonlinearity in signal chain. (b) Transfer function with 1023-point MLS, 1024-poim FFT, and 25% second-order distortion. (c) Transfer function with 16 383-point MLS, 1024point FFT, and same distortion as in (b).
J.Audio Eng. Soc., Vol. 37,No. 6, 1989 June 433

RIFE AND VANDERKOOY

PAPERS

not unlike the MLS method which rejects distortion entirely only in the limit as the MLS period L goes to infinity. In any event, our examples have used a gross amount of distortion, and the problem would normally not exist for either method. Finally, we speculate that a more accurate model for nonlinear effects in an MLS measurement may lie in chaos theory which has successfully modeled l/f noise and burst errors in communications systems, 4 MLS COHERENCE FUNCTION

These operations result in the sets of transforms [Xi(n)] for the input time record and fYi(n)] for the output time record. Estimates of the cross and auto spectra are obtained from

Sxy(n) -

I M NMbt _ Xi (n)Yi(n) m

(35)

Sxx(n)

NM_t i_'_ =1 Xi(n)Xi(n)


M

(36)

4.1 Statistical Methods Statistical approaches to signal analysis and system identification have evolved from the pioneering work of Wiener [15] and statistical thinking currently dominates the design of dual-channel FFT analyzers. Statistical transfer function measurements using stationary white-noise excitation are explained in detail in Bendat and Piersol [16] and in Gardner [17]. Gardner [17] has also introduced a novel statistical system identification method based on cyclostationary random excitation, This new method is especially advantageous when the input measurement is corrupted by noise and interference. Unlike the deterministic MLS method, all statistical methods require that both the system input and output be measured simultaneously. We note in passing that many dual-channel statistical analyzers employ an MLS or a similar pseudorandom sequence generator as the test noise source. This MLS generator, if present, serves only as a substitute for white noise, that is, the circular autocorrelation property of the MLS is not exploited by the analyzer. In the MLS method, however, the driving MLS is precisely synchronized to data acquisition of the system response and the circular cross-correlation operation is performed in the time domain over exactly the same period as the driving MLS. Thus the MLS method is fully synchronous and employs phase-coherent (matched filter) processing while statistical methods are neither synchronous nor phase coherent. For them, a free-running MLS generator serves only as a convenient approximation to white noise and no attempt is made to utilize the circular autocorrelation properties of the MLS. While statistical methods are essential when the excitation is truly random, uncontrollable, or both, they introduce additional computational complexity and require longer measurement times for a given accuracy than methods based on deterministic excitation. Nevertheless, it is both interesting and instructive to find relationships between the statistical methods and the deterministic MLS approach, In dual-channel statistical FFT analyzers, the measured input and output time records are typically sectioned into manageably sized segments, usually 1024 points in length, which are individually tapered by a window function to reduce spectral leakage effects and then transformed into the frequency domain by the FFT. (The sections are also often overlapped to improve accuracy, but this is not essential to our present purposes.)
434

Syy(rt) -

1 _ Y_(n)Yi(n) NM_t i=_

(37)

where 5t is the sampling interval in seconds, M is the number of sections, and N is the section length; N is also usually the FFT size. The tildes in _qxy(n), _qxx(n), and Syy(rt) indicate that they are estimates of the limit spectra Sxy(n), Sxx(n), and Syy(rl), which ensue as both N and M increase without limit. Such ideal measurements would have infinitesimally narrow frequency resolution but, in practice, actual frequency resolution equals _f = Wc/N_t hertz, where Wc is a constant equal to the normalized main lobe width of the Fourier transform of the data-tapering window function w(t). Furthermore, reliable (low-variance) estimates require that many segments (M >> 1) be averaged together when using random excitation. Suppose that a random stationary excitation signal x(t) is applied to a linear system, which in turn generates the random output y(t). In that case, the transfer function can be identified as Sxy(f) S_x(f)

Hxy(f)

(38)

which Wiener originally proved [15] and which represents the best possible estimate of the system transfer function in the sense that it minimizes the mean square error between y(t) and x(t) * hxy(t). In other words, if the actual system is noisy or exhibits nonlinearities, Hxy(f) is the best-fit linear approximation to the actual system behavior, and the coherence function, defined as
2

[Sxy(f) [2 Sxx(f)Syy(f) (39)

'rxy(f) -

expresses the degree to which the input and output signals are linearly related by Hxy(f). The coherence function ranges from 0 to 1, and a coherence value of 1 at frequency f means that the output is not contaminated with any energy not related to the input. Coherence measures the fraction of the output power that is attributable to the input signal. It is a useful measure that can validate a statistical transfer-function measurement in the face of external noise or nonlinearities in the measured system. Using Eq. (38) in Eq. (39) the coherence can also
O. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

be expressed as 2 ?xy(f)
--

iHxy(f)l 2 Syy(f)/Sxx(f) (40)

each section with the same window function used for the transfer function calculation and computing the set of DFTs, the frequency-decomposed total PIR energy is calculated by adding the squared magnitudes of the DFTs. This result corresponds to the quantity Syy(f)/ Sxx(f) in Eq. (40) for statistical measurements. Under this definition, MLS coherence is unity at all frequencies if and only if all the energy of the PIR is concentrated in the analysis window. Of course the denominator of Eq. (40) could be calculated directly for MLS excitation using Eqs. (36) and (37), but note that Sx_ is constant at all frequencies for an MLS. Furthermore, since the cross-correlation operation is essentially a matched filter with a flat magnitude response, then Syy can be computed from the PIR instead of from the raw system output data. Thus applying Eq. (37) to the PIR in an MLS measurement gives the phase-blind transfer function Syy(f)/Sxx(f) needed to compute the coherence function according to Eq. (40). Note that, in practice, the sections of the PIR would be overlapped to improve accuracy. One might object to this definition by asserting that the MLS coherence depends on the experimenter's particular choice of the PIR segment for the transfer function calculation and therefore cannot have the same meaning as the statistical coherence. But this argument ignores the fact that the statistical coherence, as well as Wiener's optimum transfer-function theorem, are exactly valid only in the limit as both the number of sections M and the FFT size N in Eqs. (35), (36), and (37) go to infinity. But, in fact, the limit MLS coherence does not depend on the experimenter's choices. Let the experimenter choose any initial N-sample PIR segment and any MLS period L > N. The total number of N-point segments in the PIR is then M -- L/N. Now if the length of the analysis window is expanded first backward to t = 0 and then forward toward t -- o% increasing N in the process and simultaneously increasing M and choosing L = MN, it can be seen that the limit MLS coherence is independent of the initial choice for the analysis window since eventually N will be large enough to contain any arbitrarily long impulse response. Of course, the limit MLS coherence can never be reached in practice, but neither can the limit statistical coherence since the FFT size N and the number of sections M in a statistical measurement must always be finite as well. Thus the statistical and MLS coherence are not as different as they might first appear and their similarities can be amplified by considering the effects of specific phenomena. Consider now a system, shown schematically in Fig. 13, consisting of a delay, a low-pass filter, and a highpass filter. This configuration approximately models the behavior of many two-way loudspeaker systems if one accepts that the low-pass filter is a woofer, the high-pass filter a tweeter, and the delay represents time misalignment between them. For a large delay, the measured PIR of this system might look something like the one shown. By selecting segment A for the transfer function calculation, the MLS coherence will be high
435

This expression for the coherence is more transparent than Eq. (39), for the denominator of Eq. (40) can be interpreted as a phase-blind version of the transfer function since Sxx(f) is the input power spectral density (PSD) and Syy(f) is the output PSD. 4.2 MLS Coherence Function How can an estimate of the coherence

function be

made in an MLS measurement which is essentially a single-channel deterministic evaluation of the impulse response? More fundamentally, is the coherence function even meaningful for deterministic measurements? The second question can be answered by noting that the coherence function arises in the context of an overdetermined measurement in which it is possible to search for a best-fit transfer function. A critically determined MLS transfer function measurement occurs when the DFT of the full L-point PIR is computed. In that case the coherence is meaningless since the original raw measurement data can always be recovered exactly by reversing the DFT and periodic cross-correlation operations. We do not usually transform the entire PIR, however, but select a small interesting segment (typically but not always the initial segment) and calculate the transfer function using a data-tapering window and the DFT. We say that this selected segment falls into our analysis window. In this typical case when the selected segment is shorter than the full PIR, the transfer function is overdetermined because we have discarded information contained in the unused portions of the PIR and cannot necessarily recover the original raw measurement data. Moreover, the convolution theorem assures us that truncating and tapering the PIR effectively smooths the transfer function although at the expense of degrading the frequency resolution. Smoothing the transfer function is essentially a best-fit operation although not necessarily one that minimizes the mean square error. But at least under these overdetermined conditions, it becomes possible to define and calculate an MLS coherence function, We now define the MLS coherence function for an MLS transfer-function measurement as the frequencydecomposed ratio of the energy contained in the analysis window to the energy contained in the PIR as a whole, The frequency-decomposed energy in the analysis window is simply the squared magnitude of the calculated transfer function which corresponds to the quantity IH_y(f)[ 2 in Eq. (40) for statistical measurements. The frequency-decomposed energy in the entire PIR is more difficult to calculate because of the need to maintain a consistent frequency resolution in the coherence ratio. This requirement can be met by following the statistical procedures and dividing the entire PIR into equal-length sections each of which being exactly as long as the analysis window. After tapering
J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

RIFE AND VANDERKOOY

PAPERS

at high frequencies and low at low frequencies. By selecting segment B we get the opposite situation: high coherence at low frequencies and low coherence at high frequencies. Clearly, the coherence function in both cases is physically meaningful. The coherence is high at high frequencies for segment A because that segment comes primarily from the tweeter whereas segment B comes primarily from the woofer. Finally, choosing segment C will yield near-zero coherence at all frequencies, reflecting the obvious fact that the DFT of segment C is a totally erroneous estimate of the actual transfer function, It should now be clear that system nonlinearities will cause the MLS coherence function to fall. As previously demonstrated, intermodulation products caused by system nonlinearities get phase randomized by the crosscorrelation operation and appear in the computed PIR as fixed-pattern noise which is more or less uniformly distributed over the entire length of the PIR. This spurious energy gets increasingly diluted in time as the MLS period L increases while the linear response energy remains localized to a particular region of the PIR. Thus only a small proportion of the spurious energy will appear in a sufficiently small analysis window and the MLS coherence will fall when nonlinearity is present. Similarly, energy from uncorrelated noise, including transient noise, is also evenly distributed over the entire PIR by the cross-correlation operation. Thus noise and interference will, as expected for statistical measurements, result in lower coherence values, Although reverberation is a purely linear effect, it will cause the MLS coherence to fall when the analysis window is shorter than the reverberation time, but this anomaly also occurs in dual-channel instruments when the reverberation time exceeds the FFT size N. In the limit, however, as the analysis window is widened, reverberation will influence neither the MLS nor the statistical coherence, as would be expected for any purely linear effect, 4.3 A Comparison Methods of Statistical and MLS

geometry of the measurement setup and the result programmed into the instrument. If this initial time-delay estimate is in error, the measurement must be repeated with a new value until the desired segment is located. The MLS method, in contrast, recovers a long-time PIR in a single measurement, and the desired segment can be located by simple inspection of the PIR with appropriate graphics software. Location of the desired segment is enhanced by displaying the envelope of the PIR on a logarithmic (decibel) amplitude scale. It is theoretically possible to recover a long-time impulse response of, say, 65 536 points using statistical methods, but one would need an equally long FFT for the estimation procedures. Perhaps several hundred windowed 65 536-point FFTs would need to be eomputed and averaged to obtain reliable estimates of Sxy(n), Sxx(n), and Syy(n). The MLS method requires but a single 65 535-point cross-correlation operation to recover the long-time PIR without averaging and without data-tapering windows. We conclude that the MLS coherence function can be given an interpretation not unlike the statistical coherence function for system identification purposes. But because the MLS method easily recovers a longtime PIR, there is less practical need for the coherence functionin MLS measurements.Moreover,we have introduced a way of thinking about coherence which involves the distribution of energy in the measured PIR: a time-domain interpretation that enhances our understanding of both MLS and statistical system identification methods. 5 A COMPARISON OF TDS AND MLS METHODS

Dual-channel FFT measurements of the transfer function usually involve many averages over short time segments using noiselike excitation. Both TDS and MLS techniques usually employ excitations of long duration, say, 1 second, and do not need averaging to achieve similar signal-to-noise ratios. In addition, both methods are in practice capable of better frequency resolution partly because of the limitation of FFT ana-

Unlike dual-channel statistical FFT measurements, the MLS method easily recovers a long-time periodic impulse response. One can always inspect the tail of the PIR directlyto detectreverberationor other effects whereas typical dual-channel instruments estimate and display only a 1024-point segment of the actual impulse response and must therefore depend more directly on the statistical coherence function to validate the measurement. This 1024-point limit can complicate dual-channel

the actualimpulseresponse whichis displacedfar from the initial section and surrounded by reverberant clutter. This is the case, for instance, whenattemptingto meameasurements when one is interested in a segment of sure the transfer function of an acoustic surface in a reverberant room. With statistical analyzers, an appropriate time delay must be calculated based on the
436

I! 1._B

_ L. c J _

Fig. 13. Model of two-way loudspeaker and expected impulse response.


J.Audio Eng. Soc., Vol. 37, No. 6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

lyzers using fixed-point transforms of typical length 1024samples. A tremendous benefit of MLS over traditional TDS techniques is the long, wide-band PIR that is recovered by the cross correlation. One such stored measurement may later, with appropriate windowing, be analyzed to recover the quasi-anechoic transfer function or the transfer function of any selected reflection or reflections, with any desired acoustic delay to represent the phase correctly. In addition further analysis can reveal the reverberant decay in any desired frequency band by digitally filtering the PIR before calculating the decay curve. In contrast, many TDS sweeps would be necessary to delineate such measurements, and some of them could not even be performed in a practical way. An MLS measurement of sequence length L and sampling ratefs has frequency resolutionfs/L, leading to (L - 1)/2 complex frequency points (excluding dc) in the transfer function up to the Nyquist frequency fs/2 if the whole impulse response is transformed. A linear chirp swept from zero frequency to fs/2, constructed digitally so that it has two samples per oscillation at its highest frequency, and having a total of L samples, has a time duration of L/fs, which is identical to the sequence period in the MLS approach. The two approaches would have comparable total noise rejection, In principle one could take the demodulated TDS signal and achieve frequency resolutionfJL by postprocessing with appropriate deconvolution [12], [18]. However, normal TDS methods employ an output filter of optimum bandwidth B, chosen so that B 2 -- S, where S is the chirp sweep rate, here given by S-- f2/L. The effective frequency resolution is given by the reciprocal of the time taken for the chirp to sweep through the output filter bandwidth, resulting in a resolutionfs/X/_, much poorer than the MLS method, which has a resolution offs/L. The TDS resolution may be adequate, of course, but it cannot match the MLS technique, given the same total measurement time. Suppose we use a sample clock of 50 kHz and a 16 383-point MLS. The Nyquist frequency then is 25 kHz, and analyzing the complete impulse response would yield 8192 complex frequency points separated by 3.05 Hz. To achieve such a frequency resolution with a chirp whose highest frequency is 25 kHz, using B 2 --- S, requires a sweep rate of 9.31 Hz/s, leading to a total measurement time of 2684 s, or almost 45 min. In contrast the MLS repeats in 0.328 s. If in addition the response at or near direct current is required in TDS, then two chirps must be used, one in phase quadrature, and each must be swept through zero frequency, It is true that TDS demodulates and filters the signal to produce the transfer function directly. No other processing overhead is required, whereas the MLS technique demands the cross-correlation computation. On the other hand, TDS techniques are often used to give a time-domain response, such as the impulse response or its envelope. In such cases an inverse FFT must be performed, and to achieve comparable time resolution and record length, the inverse FFT required takes longer
J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

than the cross-correlation computation. In conclusion, although TDS processing speedsmay be adequate for the purpose, they cannot match the resolution and total measurement-time characteristics of MLS methods. 6 REVERBERATION PERIOD TIME VERSUS SEQUENCE

The cross-correlation algorithm recovers a PIR from an MLS measurement. We normally assume that the response has decayed to a negligible value, say 60 dB below the peak, within one MLS period. But we should analyze this requirement more fully, since longer sequence lengths require more processing time. Suppose we are measuring a basically broad-band system (a loudspeaker) and normalize our analysis so that the average level of the transfer function is 0 dB. The impulse response of such a system will be very narrow, extending over only a few points, for the main spike must transform to a more or less flat response. In our measurement lab, with an RT6o of 0.7 s, a 16 383-point sequence and a sampling rate of 50 kHz mean that the reverberant energy has only decayed by 28 dB during the 0.328-s sequence period assuming exponential reverberant decay. This does not mean, however, that the peak of the impulse response will be 28 dB above the reverberant background signal. Let us assume for our typical room placement ofloudspeaker and microphone that the direct and the reverberant sound energies are about equal. Since the direct sound response is very compact (that is, localized to a few initial samples for a broad-band system), then its amplitude far exceeds that of the reverberant signal. If the reverberant energy is also broad-band (normally it would be somewhat down at high frequencies), then it will act like a noisy background signal in the tail of the impulse response, which will overlap the initial portion due to time aliasing. The direct-sound portion of the impulse response, being only a few points wide, has an amplitude that is larger than a noise signal having the same total power by a factor of up to _/L. In our example X/L represents 42 dB, so the peak of the impulse response may be up to 42 + 28 = 70 dB higher than the reverberant aliasing. Hence the time domain is exceptionally clear of reverberant clutter, even though the sequence length is relatively short and the reverberant energy has not decayed fully. It is thus possible to "see" reflections that are far below the 28-dB level expected from the reverberant decay. Fig. 14(a) shows a portion of the impulse response of a Quad ESL-63 measured in the lab. At a 10-fold expansion of the normal vertical scale, Fig. 14(b), the time-aliased reverberant clutter plus lab noise are just barely visible in the initial timedelay gap. Another factor comes into play as well. An impulse response of length L would, if transformed, give a broad spectrum having an interfering reverberant signal at each frequency approximately equal to the direct sound spectrum. We do not normally transform the
437

RIFE AND VANDERKOOY whole sequence, but only the initial "anechoic" portion. Typically a 1024-point FFT might be used. This vastly improves the quality of the measurement so that only the time-aliased portion of the reverberation compromises the result. The direct sound energy is very compact and most of it can reasonably be expected to fall within an analysis window 10 ms wide. Exponential reverberant decay means that the reverse integral of the square of the true impulse response (that is, with no time aliasing) expressed in decibels is a straight line [19]. Integrating from t = +oc to t = 328 ms gives the time-aliased component of the reverberant energy. Integrating from t = +oo to t = 328 + 10 ms (that is, stopping just short of the analysis window) gives the time-aliased reverberant energy exclusive of that which falls in the window. _If T60 = 0.7 s, the first integral is -28 dB (relative to total reverberant energy), the second integral is

PAPERS -28.86 dB, and the difference of 0.86 dB represents the time-aliased reverberant energy falling within the analysis window. Thus the time-aliased reverberant noise in the analysis window is given by Rw _ 10 log(10 -28/] 10-28'86/]) = -36 dB . (41)

Thus within a 10-ms analysis window the time-aliased reverberant energy is 36 dB down from the total reverberant energy. Since direct and reverberant energy are about equal here, the signal-to-noise ratio is 36 dB. Note that Eq. (41) gives the reverberant noise for only the first "fold" in the time aliasing, but since the second "fold" is another 28 dB farther down, the error is negligible. This analysis is generalized to 60T Rw = Rt - -+ 10 log(1 T60 where Rt = ratio of total reverberant (dB) to total direct sound

10 -6t/T6)

(42)

[ We are ignoring the initial time-of-flight delay to simplify the analysis. The analysis window is assumed to begin at t = 0 but might actually begin 10-20 ms later. We are also ignoring the time-delay gap between the direct sound and thebuildup ofreverberation.

Fs: 5LZ89 FL, on t,93 to 6,N Ms

(a)

's: 5L28B Fto , N 9 to 24,92 i_s

(b) Fig. 14. MLS measurement of Quad ESL-63 electrostatic loudspeaker in lab with 0.7-s reverberation time. A 16 383-point MLS repeating every 0.328 s was used with an on-axis microphone placed 1 m away. (a) Initial portion of impulse response. (b) Vertical scale has been expanded by a factor of 10 making the time-aliased reverberant clutter and lab noise just barely visible in the initial time-of-flight gap near zero time. Initial room reflections are visible in tail of main response. 438 J. Audio Eng. Soc., Vol.37,No.6, 1989 June

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

Rw = ratio of reverberant window (dB)


r60 ----

to direct sound in analysis

simply its magnitude


e2(t) = Ja(t)l 2 =

]a(t) l given by
h2(t) + //2(t) .

T t

reverberation time (s) = MLS period (s) = analysis window width (s)

(44)

The analytic form, a(t) where e(t)

signal can also be written in exponential

To calculate Rw we must know the overall ratio of direct to reverberant sound Rt. Fortunately R t can be estimated from the measured PIR. Specifically, we square the entire measured PIR, sum the points in the analysis window to estimate the direct energy, and sum the remaining points to estimate the reverberant energy; the ratio, expressed in decibels, is an estimate of R t . which lead to larger transfer Room In general there will be effects function other thanerrors. time aliasing reflections in a typical quasi-anechoic measurement come in after 5-10 ms, and unless gated away, can lead to spurious roughness on the transfer function, Even then the removal of such reflections often leads to a truncation of the oscillatory tail of the PIR, leading to errors in the low-frequency behavior. In general, however, the reverberation of a room does not give a significanterror even if a moderate-lengthMLS is used. 7 ENVELOPE CALCULATION 7.1 Energy-Time Curve The mathematical concept of the envelope of a signal has been around in modulation theory for many decades but was not used for audio measurements until Heyser introduced the envelope of the impulse response as the "energy-time curve" [20]. In [21] Duncan showed that this envelope, as normally defined, must be acausal (nonzero for negative time) even when the impulse response itself is causal. We are forced to conclude therefore that the energy-time curve cannot be an exact measure of acoustic energy density, although it does have useful properties for loudspeaker and room acoustics applications. Mathematically it is relatively easy to show that, based on the second shifting theorem of the Fourier transform, the envelope of any waveform is invariant under both phase and frequency translation. A practical consequence of this phase invariance is that phase reversals accompanying acoustic reflections will not distort the envelope, and this is one reason why the energy-time curve is effective in locating room reflections. While the impulse response itself can reveal such reflections, its interpretation can sometimes be more difficult because it usually contains zero crossings and oscillations. The envelope of the impulse response, in contrast, is always positive and can therefore be plotted on a decibel scale, To find the envelope we first form the analytic signal from the impulse response h(t) and its Hilbert transform h(t), as in a(t) = h(t) + jh(t) The analytic . and the envelope (43) is

= e(t)e jd'(t)

(45)

= envelope

(b(t) drb(t)/dt

= instantaneous = instantaneous

phase,

= a tan [h_J

frequency

or it can be expressed as a convolution of the analytic impulse and the impulse response h(t), a(t)
=

ga(t) * h(t) [' l) *

= h(t) * b(t) + j_h(t)

= h(t) + j h(t) _t where the analytic


ga(t) =

{ '}
impulse is defined as

(46)

_(t) + j/wt

(47)

Eq. (46) clearly shows that the acausal aspect of the envelope arises from the convolution of h(t) with the function 1/_t, which is nonzero for all negative time. The analytic signal's spectrum A(f) is zero for all negative frequencies, and this property can be exploited to compute the envelope when the transfer function is in discrete form. The procedure is simply the negative frequencies in the transfer then perform an inverse FFT. The result version of the analytic signal which yields to eliminate function and is a sampled the envelope

according to Eq. (44). While working with TDS, Heyser and others discovered that energy-time curves resolve acoustic reflections better when an additional window is applied to the positive frequencies prior to computing the analytic signal via the inverse FFT. The effect of using a Hann window, for instance, is to make the doublet fall off as 1/t 3 rather than 1/t shown in Eq. (46). This in turn suppresses the acausal precursor of the envelope and decreases the leakage between "energy" peaks, making them easier to resolve but at the expense of removing the influence of both the very low and the high frequencies. Most implementations of TDS produce the transfer function directly. Computation of the envelope therefore involves, by the method given, only a single inverse FFT calculation. In contrast, the computational costs would seem to be much greater when using the MLS method because the transfer function must first be
439

signal is complex

O.Audio Eng. Soc., Vol. 37, No. 6, 1989 June

RIFE AND VANDERKOOY

PAPERS

computed from the PIR using an additional FFT computation. If, as in acoustic measurements, a long-dbration envelope curve is required, a very large initial FFT computation must be performed to obtain the transfer function. To avoid this problem, a method for computing the analytic signal directly from the PIR was devised, 7.2 Analytic Signal from PIR via Convolution We first define the unwindowed analytic impulse in discrete time as Re{Ha(n)} = fl, 0, n -- 0, elsewhere (48) 2 Im{ga(n)} = _
eot

2. The real and imaginary parts both fall off at roughly the same rate and outside the 15-sample range shown, both are negligible (92 dB down relative to +0.1793756 at n =-0). If the sequence is truncated to 15 points, its spectrum exhibits -92 dB of leakage into the negative frequencies. This leakage represents an error that is insignificantin practice. Thus a 15-point discrete convolution can recover a Blackman-Harris smoothed version of the envelope directly from the PIR. Fig. 15(b) and (c) shows Blackman-Harris smoothed energy-time curves of a loudspeakerin a typical living room measured over a 10-kHz bandwidth. These curves were computed directly from the PIR by the 15-point discrete convolution. A linear-phase Bessel anti-aliasing filter was used to avoid the time smearing, which would occur with a typical anti-aliasing filter (such as Chebyshev or ellipticfilter).Notethat this energy-timecurve and others using similar windows have no contributions from frequencies near direct current nor the Nyquist frequency. In addition to the envelope, many other curves for audio and acoustic applications can also be derived from the measured PIR. Mosts of these are discussed in detail in a comprehensive paper by Lipshitz et al. [23]. 8 MLS INSTRUMENTATION

(,m/N) N , n odd n even .

[ 0,

As in the continuous-time case, the imaginary part falls roughly as l/n, resulting in a strong acausal precursor in the envelope. Duncan in [21] gives an exact expression for an analytic impulse smoothed by applying a Hann window to the positive frequencies from direct current up to the Nyquist frequency. The result is
n

0 +2 (49) Many implementations of the MLS method are possible. However, the main design goals of one author (DR) were to maximize flexibility and minimize cost. To achieve these goals, the first commercial MLS instrument was designed around an IBM-PC or compatible can serve as hosts except those with the new IBM mipersonal computer crochannel bus. A (PC) proprietary [7]. All program IBM compatible performs PCs the required cross-correlation calculation in software, thus eliminating the added expense of specialized high-speed DSP hardware. Executing on an 80386 Intel microprocessor with a 20-MHz clock rate, the cross-correlation. algorithm completes in only 1 s for a 16 383-point sequence and in 3.5 s for a 65 535-point MLS, execution times that are quite acceptable for most applications. Furthermore, a PC-based design results in performHarris window smoothing.

Re{_alHann(n)} =

IV2, _ -1/4, 0,

n =

elsewhere

Im{_alHann(n)} = _n(n 0,

-4 + 2)(n -

2)'

n even odd

In Eqs. (49) the imaginary part falls off as 1/n 3, but the real part is slightly wider when compared to the unsmoothed case, Eq. (48). Now we consider what happens when a modern optimal window is applied. One such window is the minimum four-term man-Harris window [22] defined as Black-

w(n) = ao -

al cos
(2_)

Table 2. Analytic impulse: Blackman-

n + 62 cos -(4Nn) 63 cos -(6Nn) (50) -6 -7 -5 -4 -3 -2 -1 0 +1 +2 +3 +4 +5 +6 +7

Real -0.0029195 0.0000000 0.0000000 +0.0353204 0.0000000 -0. 1220720 0.0000000 +0.1793756 0.0000000 -0. 1220720 0.0000000 +0.0353204 0.0000000 -0.0029195 0.0000000

Imaginary 0.0000000 +0.0003269 -0.0125058 0.0000000 +0.0740520 0.0000000 -0.1631111 0.0000000 +0.1631111 0.0000000 -0.0740520 0.0000000 +0.0125058 0.0000000 -0.0003269

where a0 = 0.35875 a_ = 0.48829 62 = 0. 14128 63 = 0.01168 . Blackman-Harris smoothing of the analytic impulse was obtained digitally and the results are given Table
440

J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

PAPERS

TRANSFER-FUNCTION

MEASUREMENTS

ance improvements that automatically follow PC technology improvements. When personal computers based on Intel's new 80486 processor become available, performance improvements will automatically follow suit. A PC-based design also allows user programmability for specialized applications, including production quality assurance, and permits instrument portability via a portable host PC. All the computational, storage, and display facilities of the host computer are utilized
File: Impulse B; 0. 020 LROOM.TIH Response (18/15/87) volts

to the maximum extent to minimize cost and maximize utility. The hardware portion of the instrument is contained on a single printed circuit card that plugs into the expansion bus of the IBM-PC, IBM-AT, or compatible PCs. The hardware is capable of sampling and digitizing analog data at any rate up to 150kHzat 12-bit resolution. This level of analog input resolution is more than adequate for MLS measurements because of the beneficial

0.010

0. 000 -0.010 -0.02;0

0,000

i 12. 500

25. Time (a)

i 000 msecs

3?,

i 500

50.

000

File: Envelope ml o.o -5. o

LROOM.TIM dB

(18/15/87) (Blacknan-Haz, ris smoo_hing)

-10

.O

-15; .0

_.o.o
O, OOO 12. 500 25. Time OOO - msecs

[ JlJ
37. i 500 50, OOO

(b)
File: Envelope LROOM.TIN dB (11t/15/87) (Blackman-Harris smoo%hing)

- 10.0 -20.0

-30.0 -40.0 -50. O

0,000

75,000

150. 000 Time - msecs (c)

225,000

300,000

Fig. 15. Deriving envelope, or energy-time curve, directly from impulse response. (a) Initial portion of impulse response of dynamic loudspeaker in living room, measured using 16 383-point MLS. Measurement bandwidth is 10 kHz and sampling rate is 40 kHz. (b) Envelope of initial portion of PIR with Blackman-Harris smoothing. (c) Envelope of entire measured room response.
J. Audio Eng. Soc.,Vol.37,No.6, 1989 June 441

RIFE AND VANDERKOOY

PAPERS

effects of analog dither [24]. Rms dither of 0.3 to 0.5 LSB is provided on board for an effective resolution of 16 bits during and after cross-correlation processing. The hardware also includes a programmable MLS generator that provides 4095-, 16 383-, 32 767-, and 65 535-point sequences. The symmetrical analog output is low-pass filtered by a 50-kHz Butterworth filter to moderate the transition slew rate, and the output level is programmable from 0 to -+5 V. The MLS is also output as a TTL logic signal for triggering spark gaps or other circuits, The hardware also includes a fully programmable eight-pole anti-aliasing filter. The same physical filter can be programmed to act as a Bessel, Butterworth, or Chebyshev filter under software control. Filter cutoff frequency is variable from 1 kHz to 50 kHz and passband gain is variable from 0.2 to 500. The programmable gain feature permits software to perform autoranging during signal acquisition, The programmable anti-aliasing filter allows various tradeoffs to be made between different measurement parameters. For instance, measurement bandwidth can be reduced to increase the PIR duration. At a 50-kHz sample rate and a 16 383-point sequence length, the MLS period is 0.328 s in duration. However, by programming a 5kHz filter bandwidth, the sample rate can be safely reduced to 16 kHz, thus increasing the MLS period to 1 s. Furthermore, using the same sample rate and filter bandwidth, a 65 535-point sequence can measure impulse responses up to 4 s in duration, which might be required for characterizing very reverberant rooms, At the opposite extreme, acoustic scale modeling requires ultrasonic measurement bandwidths, but impulse-response durations are relatively short due to rapid air absorption at high frequencies. For such applications, a filter bandwidth of 50 kHz and a sample rate of 150 kHz can be selected, Another tradeoff involves the rolloff rate and phase distortion exhibited by different filter types. An eightpole Chebyshev filter with 0.5 dB of passband ripple has a high useful rolloff of 76 dB per octave but exhibits pronounced ringing in its impulse response, which may be objectionable for some measurements. Although this ringing is due to phase distortion that can be corrected in the frequency domain, doing so requires a substantial amount of computation if a time-domain result is required. An alternative is to program a Bessel filter that exhibits very little phase distortion and shows no ringing in the time domain. Menu-driven software is included, which enables the user to perform a wide variety of important loudspeaker and acoustic measurements. Nevertheless, fully custom software can be written for more specialized applications, 9 CONCLUSIONS The maximum-length sequence (MLS) method has been shown to be a viable alternative to time-delay spectrometry
442

Unlike TDS and FFT methods, however, MLS necessarily measures the periodic impulse response (PIR). The PIR can be considered identical to the true impulse response provided only that the MLS period equals or exceeds the duration of the system impulse response. Otherwise time aliasing occurs, and formulas were given to predict time-aliasing errors for loudspeaker measurements. The minimum measurement time for MLS was shown to be two full MLS periods provided that the MLS period is long enough to render time-aliasing effects negligible. The MLS method largely rejects the dc component of the PIR, and this is considered a desirable feature since extraneous dc offsets in the measuring chain are substantially attenuated. Nevertheless, the dc eomponent can optionally be recovered by adding a large dc offset equal to minus the MLS amplitude prior to applying the MLS stimulus to the system under test. When realized with a zero-order hold function, the MLS method was shown to yield a measured PIR identical to that obtained directly by periodic pulse excitation for perfectly linear noiseless systems. Furthermore, because of the binary nature of the MLS stimulus, triggered transducers such as spark gaps can be included in the measurement train when appropriate modifications are made to the driving MLS signal. Although an MLS has a crest factor of unity, or 0 dB, passing such a signal though ordinary linear systems such as loudspeakers or filters causes the crest factor to approach a nominal 11 dB. Hence, without preemphasis, MLS noise immunity is slightly worse than TDS, but with preemphasis and preaveraging noise immunity will exceed that of TDS under typical measurement conditions in which low-frequency noise predominates. Prefiltering the MLS stimulus with a pink-noise filter gives nearly optimum preemphasis for such enhanced low-frequency noise immunity. The lowfrequency boost can be equalized either in hardware with an inverse filter or by software means. Pink-noise prefiltering also results in a nearly Gaussian probability density function (PDF), which is desirable from the standpoint of rejecting distortion components due to nonlinearity. An excitation signal having a Gaussian PDF and a pink-noise spectrum is also desirable because it excites the system over a wide range of amplitudes and slew rates just as real program material does in a sound or acoustic system. Transient noise immunity of MLS is very high. Clicks, pops, and other interfering transient noises were shown to result in benign noise, which is distributed uniformly over the entire measured PIR. Hence the transient energy is dissipated and is much less of a problem than for the periodic pulse method. Nonlinearity in an MLS measurement was shown to cause quasi-stationary fixed-pattern noise to appear in the measured PIR due to phase randomization of the intermodulation components. The nonlinear component of the response can be partially separated from the linear response by choosing an MLS period that is long
J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

(TDS), FFT, and periodic pulse methods,

PAPERS

TRANSFER-FUNCTION MEASUREMENTS

compared to the analysis window duration. The analysis window essentially selects the initial portion of the PIR that contains predominantly the linear response while rejecting the nonlinear components that reside largely in the tail of the measured PIR in the form of fixed-pattern noise. In principle, MLS distortion measurements are also possible based on this separability of linear and distortion components in an MLS measurement. An MLS coherence function was defined which corresponds to the statistical coherence function defined for dual-channel statistical FFT analyzers. The MLS coherence function can validate an MLS transfer function measurement in the presence of external noise and nonlinearities just as the statistical coherence function validates a dual-channel measurement. However, because the MLS method easily recovers a long-time PIR, the MLS coherence function is not generally required in practice. An efficient method was disclosed which computes a Blackman-Harris smoothed version of the analytic impulse response from the measured impulse response via a 15-point discrete complex convolution. The envelope, or energy-time curve, is easily obtained as the magnitude of the analytic impulse response. MLS methods quickly and accurately measure a wideband PIR of extended duration. Because such a measurement is essentially a complete description of a twoport linear system, exhaustive analysis of the stored PIR can be commenced at any time, even long after the actual physical measurement was performed. This archival property of MLS methods proves to be very helpful in practice--especially for room acoustics evaluations--since new "measurements" can be invented after the fact and then carried out by postprocessing the stored PIR. 10 ACKNOWLEDGMENT This research was supported in part by a grant from the Natural Sciences and Engineering Research Council of Canada to one ofthe authors (JV). JV also acknowledges stimulating discussions with his colleague, Stanley Lipshitz. 11 REFERENCES [1] W. D. T. Davies, "Generation and Properties of Maximum-Length Sequences," Control (1966 June, July, Aug.). [2] S. W. Golomb, Shift Register Sequences (Aegean Park Press, Laguna Hills, CA, 1982). [3] M. R. Schroeder, "Integrated-Impulse Method Measuring Sound Decay without Using Impulses," J. Acoust. Soc. Am., vol. 66 (1979 Aug.). [4] Y. Ando, Concert Hall Acoustics (Springer, New York, 1985), pp. 103-109. [5] A. Lempel,Appl. Opt., vol. 18, pp. 4064-4065 (1979). [6] J. Borish and J. B. Angell, "An Efficient Algorithm for Measuring the Impulse Response Using Pseudorandom Noise," J. Audio Eng. Soc., vol. 31,
J. Audio Eng. Soc., Vol. 37, No. 6, 1989 June

pp. 478-488 (1983 July/Aug.). [7] D. D. Rife, "Maximum-Length Sequences Optimize PC-Based Linear System Analysis," Pers. Eng. Instrum. News, vol. 4 (1987 May). [8] R. C. Heyser, "Acoustical Measurements by Time Delay Spectrometry," J. Audio Eng. Soc., vol. 15, p. 370 ( 1967 Oct.). [9al J. M. Berman and L. R. Fincham, "The Application of Digital Techniques to the Measurement of Loudspeakers," J. Audio Eng. Soc., vol. 25, pp. 370384 (1977 June). [9bi L. R. Fincham, "Refinements in the Impulse Testing of Loudspeakers," J. Audio Eng. Soc., vol. 33, pp. 133-140 (1985 Mar.). [10] A. V. Oppenheim and R. W. Schafer, Digital Signal Processing (Prentice-Hall, Englewood Cliffs, NJ), pp. 96-98. [11] D. B. Keele, Jr., "The Design and Use of a Simple Pseudo Random Pink-Noise Generator," J. Audio Eng. Soc., vol. 21, pp. 33-41 (1973 Jan./Feb.). [ 12] J. Vanderkooy, "Another Approach to TimeDelay Spectrometry," J. Audio Eng. Soc., vol. 34, pp. 523-538 (1986 July/Aug.). [13] D. D. Wiener and J. F. Spina, SinusoidalAnalysis and Modeling of Weakly Nonlinear Circuits (Van Nostrand Reinhold, New York, 1980). [14] W. A. Gardner, Introduction to Random Processes (Macmillan, New York, 1986). [15] N. Wiener, Extrapolation, Interpolation and Smoothing of Stationary Time Series (Technology Press of M.1.T. and Wiley, New York, 1949). [16] J. S. Bendat and A. G. Piersol, Random Data, 2nd ed. (Wiley, New York, 1986). [17] W. A. Gardner, Statistical SpectralAnalysis: A Nonprobabilistic Theory (Prentice-Hall, Englewood Cliffs, NJ, 1988). [18] H. Biering and O. Z. Pedersen, "Comments on

'Another Approach to Time-Delay Spectrometry,' "and author's reply, J. Audio Eng. Soc. (Letters to the Editor), vol. 35, pp. 145-146 (1987 Mar.). [19] M. R. Schroeder, "New MethodofMeasuring Reverberation Time," J. Acoust. Soc. Am., vol. 38, pp. 329-361 (1965); vol. 40, pp. 549-551 (1966). [20] R. C. Heyser, "Determination of Loudspeaker Signal Arrival Times, Parts I, II, and III," J. Audio Eng. Soc., vol. 19, pp. 734-743 (1971 Oct.); pp. 829-834 (1971 Nov.); pp. 902-905 (1971 Dec.). [21] A. Duncan, "The Analytic Impulse," J. Audio Eng. Soc., vol. 36, pp. 315-327 (1988 May). [22] F. J. Harris, "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform," Proc. IEEE, vol. 66 (1978 Jan.). [23] S. P. Lipshitz, T. C. Scott, andJ. Vanderkooy, "Increasing the Audio Measurement Capability of FFT Analyzers by Microcomputer Postprocessing," J. Audio Eng. Soc., vol. 33, pp. 626-648 (1985 Sept.). [24] J. Vanderkooy and S. P. Lipshitz,"Resolution Below the Least Significant Bit in Digital Systems with Dither," J. Audio Eng. Soc., vol. 32, pp. 106-113 (1984 Mar.); correction, ibid., p. 889 (1984 Nov.).
443

RiFEANDVANDERKOOY

PAPERS

THE AUTHOR

Doug Rife was born in Ohio in 1949. He attended Case Western Reserve University, majoring in physics, After a stint in the U.S. Air Force, he spent much of his career designing first analog, then digital, and finally microcomputer-based electrooptical instruments. Combining a long-time interest in audio with his instrumentation and signal-processing background, he

started DRA Laboratories in 1985 to develop instruments based on novel signal-processing niques.

audio tech-

Dr. Vanderkooy's March issue.

biography

was published

in the

444

J. AudioEng.Soc.,Vol.37, No. 6, 1989June

You might also like