A technique using Golay complementary sequences is introduced for measuring impulse responses. Compared to the swept-sine method, it is more robust to additive white noise. Free, open-source software is provided in Matlab (or Octave) and Pure Data (PD) for carrying out impulse-response measurements using the sound hardware found on a typical personal computer.
Introduction
[link] depicts a linear system characterized by an impulse
response
, driven by an input signal
, and producing the
output signal
. The
system identification problem is to
estimate
given known input/output signals
and
. A
practical method for identifying finite impulse responses uses
Golay complementary sequences to excite the linear system as described below.
Maximum length sequences may be alternatively used for this type of measurement, as they are also noise signals consisting of 1's and -1's, but perfectly inverse filtering the measurement is more computationally intensive.
Golay complementary sequences
The length
bilevel sequences
and
are
Golay complementary sequences if
and only if the following condition holds, where
denotes the
autocorrelation operator
[link] :
and
is the Kronecker delta function. Many references in the audio signal processing literature refer to such sequences as Golay codes; however, to avoid confusion with Golay error-correcting codes used in digital communication, we call the sequences
Golay complementary sequences . Recall that
(
[link] ) can also be written using
, the convolution
operator:
Given that
and
are Golay, it turns out that
and
are also Golay. This means
that Golay complementary sequences can be constructed recursively given seedsequences such as
and
. See the
MATLAB /
Octave source code
generate_golay.m for details. Notice also that the resulting bilevel sequences consist
of only 1's and
's. This means that the signal contains the
maximum possible power level given that
.
This property is helpful for minimizing measurement noise.
Let
be the response due to the input
, and let
be the response due to the input
. Due to (
[link] ), the impulse response
may be
determined as follows:
Ensure that the patch is not in editing mode, and check the
“compute audio” box in the main pdwindow.
Adjust the “Output Volume” so that when you click on “Record
Response to Golay A”, the system under test is behaving linearly(i.e. not clipping), but so that the input signal to the sound
interface is not too noisy.
If there is an input volume on the sound interface, adjust it so
that the levels approximately match those shown in
[link] when you click on “Record Response to Golay A” and “Record
Response to Golay B.” If the sound interface has no input volume,then you will need to adjust the “Output Volume” accordingly.
Once you are satisfied with the results, click the “Write Responses
to Disk” button.
pd
will write the files RespA.wavand
RespB.wavto disk. Rename these files so that the names
match the measurement you just made. For instance, you might renamethem to
hpfRespA.wav and
hpfRespB.wav if they corresponded to the measurement of a high-pass filter.