DSPRelated.com
Forums

Finding impulse response using cyclical white noise

Started by Gerry May 12, 2006
In a project at Dartmouth College many years ago, my classmates & I
measured lumped head-related-transfer-functions (HRTF) + room reverb.
In the process, we came up with a pretty neat way to measure impulse
responses.

I'm curious whether anyone else has used or read about this technique,
and if so what it's usually called, as I haven't found any descriptions
of quite the same approach.

Some background... the classic way of measuring room response is to
fire a gunshot and record the resulting sound.   This gives you the
impulse response in the most literal sense!  It's got a lot of
downsides though:
- Even a gunshot isn't a pure impulse, so the measured impulse response
will have some undesired coloring.
- You're bound to pick up some background noise (e.g. air conditioner
noise), especially during the "tail" of the reverb
- It's quite likely you'll get clipping during the recording
- It's bloody loud!

One possible solution is to play an impulse through a loudspeaker, and
record the response to it - and repeat many, many times.   Since the
background noise is unlikely to be correlated with the impulses, if you
average out all the recorded impulse responses, the
impulse-signal-to-background-noise ratio will go up.

Playing impulses through loudspeakers is of course problematic - the
impulse must have some finite length (and therefore doesn't have a flat
spectrum like a pure impulse), and the energy in each impulse has to be
pretty limited to avoid driving your speaker into highly non-linear
behaviors (and if you don't want to blow your speaker).

The solution we came up with was to use what I call "cyclical white
noise".   Basically you take a flat magnitude spectrum, randomize the
phases, and convert to a time domain signal, and loop it.  Next, play
this cyclical noise through a loudspeaker, and record the response to
it over many periods of the cyclical noise.   Finally, average those
many cycles, convert to frequency domain, adjust the phases (to exactly
compensate for how the phases were randomized to create the cyclical
white noise), convert back to the time domain, and bingo: you've got
the impulse response.

Has anyone come across this method before?

I put the project report on my website many years ago:
http://gbeau.com/audio/hrtf/hrtfproj.htm

The most relevant excerpt is shown below.

-Gerry Beauregard


>>>>>>> >From http://gbeau.com/audio/hrtf/hrtfproj.htm
The Cyclical Noise Method (Berman and Fincham's 1977) method described above works well for measuring speaker impulse responses in part because the sound does not have to travel far. The speaker to microphone distance they used is under a meter, and therefore the speaker and microphone can be placed in a small, dead room. In measuring room responses, the speaker-microphone distance can easily be 10m or more. At that distance we cannot expect to get clean recordings of impulse responses since there are physical limits on the size of impulse one can put through a loudspeaker without damaging it. One way to improve matters is to use a source signal which has the same flat Fourier transform as the impulse, but in which the power in the signal is spread over a longer time. One such signal is white noise. Clearly the response to such noise will not be the impulse response, but the impulse response can be obtained by deconvolution. In a linear system, with impulse response h(t), the system output is related to the input by: so(t) = si(t) * h(t) where * is the convolution operator. Taking the Fourier transform of both sides gives So(w) = Si(w) H(w) The Fourier transform of the impulse response can therefore be obtained by dividing the transform of the output by the transform of the input. H(w) = So(w) / Si(w) h(t ) = F^-1{ So(w) / Si(w) } If the signal processing is done with discrete time (i.e. sampled) signals, as is the case if a digital computer is used, then the above relationship becomes H[k] = So[k] / Si[k] h[n] = IFFT ( H[k] ) where H[k], So[k], and Si[k] are the FFTs of the discrete time signals h[n], so[n] and si[n]. By dividing the FFT of the output by the FFT of the input, we are in effect doing a deconvolution of so[n] and si[n]. One interesting property of multiplying the FFTs of two signals is that it performs circular convolution of the two signals (Oppenheim 1975). Dividing FFTs therefore performs the inverse operation of circular deconvolution. This property can be used to advantage if as input to the system we use cyclical noise, i.e. noise that repeats at regular intervals. After the first period of the noise, the system output will also be periodic, and averaging can therefore be performed on the output in the time domain as in (Berman and Fincham's 1977) method (see Figure 4). Dividing the FFT of the output signal, averaged over several periods, by the FFT of one period of the input signal will give the FFT of the impulse response, which can then be inverted to obtain the impulse response proper. For this method to work, the period of the cyclical noise must be at least as long as the impulse response. In addition, the period must be a power of two number of samples long (this is a requirement of the FFT). <<<<<<<<<<<<<<
Gerry wrote:
-- snip --

> > Some background... the classic way of measuring room response is to > fire a gunshot and record the resulting sound. This gives you the > impulse response in the most literal sense! It's got a lot of > downsides though: > - Even a gunshot isn't a pure impulse, so the measured impulse response > will have some undesired coloring. > - You're bound to pick up some background noise (e.g. air conditioner > noise), especially during the "tail" of the reverb
I would expect that you'd also have some artifacts from the falling plaster. :D -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
Gerry wrote:

> The solution we came up with was to use what I call "cyclical white > noise". Basically you take a flat magnitude spectrum, randomize the > phases, and convert to a time domain signal, and loop it. Next, play > this cyclical noise through a loudspeaker, and record the response to > it over many periods of the cyclical noise. Finally, average those > many cycles, convert to frequency domain, adjust the phases (to exactly > compensate for how the phases were randomized to create the cyclical > white noise), convert back to the time domain, and bingo: you've got > the impulse response.
there is an analytic method to generate something that is cyclical and white and sounds like white noise called "Maximum Length Sequences" or MLS. sometimes called pseudo-noise (PN) Sequences, shift register sequences, GF(2) (for "Galois Field" base 2). for the purpose of acoustic measurement, i wrote a little tutorial about it at: http://www.dspguru.com/info/tutor/mls.htm there are complaints about the method. linearly swept frequency measurements seem to be coming back.
> Has anyone come across this method before?
take a look at: www.fesb.hr/~mateljan/arta/papers/im-aaaa2003.pdf r b-j
Gerry wrote:

> In a project at Dartmouth College many years ago, my classmates & I > measured lumped head-related-transfer-functions (HRTF) + room reverb. > In the process, we came up with a pretty neat way to measure impulse > responses. > > I'm curious whether anyone else has used or read about this technique, > and if so what it's usually called, as I haven't found any descriptions > of quite the same approach.
[skipped description of MLS based measuring technique]
> Has anyone come across this method before?
The following papers describe the method and its advantages and shortcomings: - Douglas Rife: "Transfer-Function Measurement with MLS", in Journal of AES, June 1989 - W.T.Chu: "Impulse-Response and Reverbereation-Decay Measurements Made by Using a Periodic Pseudorandom Sequence", in Applied Acoustics Nr. 29/1990 - John Vanderkooy: "Aspects of MLS Measuring Systems", in Journal of AES, April 1994 There are several measuring systems based on this method available, both commercially (e.g. http://www.mlssa.com/) and based on open source. Together with two friends I also have written small command line based programs to create MLS audio files (gensig) and to process the results with the convolution by fast hadamard transform (mlscorr). (http://www.huennebeck-online.de/software/download/src/index.html) bye Andreas -- Andreas H&#4294967295;nnebeck | email: acmh@gmx.de ----- privat ---- | www : http://www.huennebeck-online.de Fax/Anrufbeantworter: 0721/151-284301 GPG-Key: http://www.huennebeck-online.de/public_keys/andreas.asc PGP-Key: http://www.huennebeck-online.de/public_keys/pgp_andreas.asc
Thank you Robert and Andreas for your rapid responses to my query, and
for the excellent references!

Tim Wescott said:
> I would expect that you'd also have some artifacts from the falling plaster.
In our first round off research, funded by the NRA, we used handguns with live rounds, but found it gave erroneous "double impulse responses". We reckon that the first response was from the gunshot itself, the second from the impact of the bullet hitting the ceiling. If the bullet hit a steel beam in the ceiling, we actually got a triple response - the gunshot, the ricochet off the steel beam, and finally the impact of the bullet lodging itself into the floor. The ricochet was particularly problematic, as it resulted in a highly pitched "ringing" effect. What's more, the tail of the response was often contaminated by the muffled cries of a fellow graduate student injured by falling concrete. In later Air Force funded research, the impulse responses were even less clean - more like rolling thunder than a typical room impulse response - as the air strike missed the auditorium entirely and blew up a nearby cultural centre instead. Eventually we realized that we could get cleaner impulse response measurements, and fewer hassles with campus security, if we used blanks instead of live ammo ;-)
in article 1148127479.907480.291020@j55g2000cwa.googlegroups.com, Gerry at
g.beauregard@ieee.org wrote on 05/20/2006 08:18:

> Eventually we > realized that we could get cleaner impulse response measurements, and > fewer hassles with campus security, if we used blanks instead of live > ammo ;-)
that was worth a giggle. i just got contacted by Ivo Mateljan who did that multisine paper i sorta referred to. if you're interested in contacting him, lemme know. maybe you already have. i dunno. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."