Figure 1 depicts a linear system characterized by an impulse
response h(n)h(n), driven by an input signal s(n)s(n), and producing the
output signal r(n)r(n). The system identification problem is to
estimate h(n)h(n) given known input/output signals s(n)s(n) and r(n)r(n). A
practical method for identifying finite impulse responses is the
swept-sine measurement technique, described below.
In some cases, it is desirable to relax the power-maximizing
constraint |s(n)|=1∀n|s(n)|=1∀n in favor of obtaining some other
desirable measurement system properties. For example, we may care
more about the accuracy of the measurement at lower frequencies
compared to higher frequencies, so we would like the excitation signal
s(n)s(n) to contain more energy at lower frequencies
Entry 1. We might also be measuring a mechanical or
acoustical system in which the motor controlled by s(n)s(n) behaves
weakly nonlinearly. If the nonlinearity is memoryless and is
NOT preceded by any filtering, then the system to be measured
matches the Hammerstein model shown in Figure 2. The goal
is to measure h(n)h(n), independently of the motor nonlinearity f(s)f(s).
Performing the measurement is complicated by the fact that
superposition no longer holds.
Mathematically, the Hammerstein system behaves as follows:
r
(
n
)
=
(
f
(
s
)
*
h
)
(
n
)
r
(
n
)
=
(
f
(
s
)
*
h
)
(
n
)
(1)
It turns out that we can obtain both of these desirable measurement
system properties by using a new excitation signal s(n)s(n). This
signal is a sine wave with a frequency that is exponentially increased
from ω1ω1 to ω2ω2 over TT seconds Entry 2:
s
(
n
)
=
sin
[
K
(
e
-
n
/
L
f
s
-
1
)
]
s
(
n
)
=
sin
[
K
(
e
-
n
/
L
f
s
-
1
)
]
(2)
where K=ω1Tlnω2ω1K=ω1Tlnω2ω1 and L=Tlnω2ω1L=Tlnω2ω1. The MATLAB/Octave
code
generate_sinesweeps.m
generates the appropriate sine sweep.
Now we consider how to extract the linearized impulse response from a measurement. In essence, we need to inverse filter the measurement by the excitation signal.
To this end, we realize that a useful property of s(n)s(n) is that the time delay ΔtNΔtN
between any sample n0n0 and a later point with instantaneous
frequency NN times larger than the instantaneous frequency at
s(n0)s(n0) is constant:
Δ
t
N
=
T
ln
(
N
)
ln
ω
2
ω
1
Δ
t
N
=
T
ln
(
N
)
ln
ω
2
ω
1
(3)
This characteristic implies that after inverse-filtering the measured
response, the signals due to the nonlinear terms in f(s)f(s) are located
at specific places in the final response signal. Consequently, the
linear contribution to the response, which is proportional to h(n)h(n)
can be separated from the other nonlinear terms. We can thus measure
a linear system even if it is being driven by a weakly nonlinear
motor.
Because the frequency of s(n)s(n) increases exponentially, the system is
excited for longer periods of time at lower frequencies. This means
that the inverse filter averages measurements at lower frequencies
longer, so this measurement technique is better suited to especially
low-pass noise sources.
- Generate the
sine sweeps
using
generate_sinesweeps.m
- Open the pd
patch
sinesweeps.pd
in pd.
- Ensure that the patch is not in editing mode, and check the
“compute audio” box in the main pd
window.
- Adjust the “Output Volume” so that when you click on “Record
Response To The Sine Sweeps,” 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
Figure 3 when you click on “Record Response To The
Sine Sweeps.” 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 file Resp.wav
to disk. Rename
this file so that the name matches the measurement you just made.
For instance, you might rename it to
nonlinear2Resp.wav
if it corresponded to the second time you measured the transfer
function of a weakly nonlinear system.
- Run
sinesweeps_response('nonlinear2,100,0.4')
in
MATLAB
or
Octave
to analyze the measured response.
This means that the inverse filter will be restricted to a dynamic
range of 100 (40 dB), which helps avoid exaggerating problems
beneath ω1ω1 and above ω2ω2, where the excitation signal
has little energy. 0.4 refers to the length in seconds of the
linear impulse response term to be extracted. Plots will be
generated, and the file
nonlinear2ImpResp.wav
will be written to disk.
-
Abel, J. and Berners, D. (2005). Signal Processing Techniques for Digital Audio Effects. http://ccrma.stanford.edu/courses/424/.
-
Farina, Angelo. (2000, Feb.). Simultaneous Measurement of Impulse Response and Distortion with a Swept-Sine Technique. Audio Engineering Society Convention, Preprint 5093,