signals and systems€¦ · outline 1 frequency domain system identification introduction choice...
TRANSCRIPT
Signals and Systems
Lecture 11: System Identification
Dr. Guillaume Ducard
Fall 2018
based on materials from: Prof. Dr. Raffaello D’Andrea
Institute for Dynamic Systems and Control
ETH Zurich, Switzerland
G. Ducard 1 / 46
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 2 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
In this lecture apply tools learned to identify an unknown system.
This process is known as system identification. The key idea:
1 by applying a known input to a system
2 and observing the system’s output,
⇒ a model of the system can be estimated.
G. Ducard 3 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
In this lecture apply tools learned to identify an unknown system.
This process is known as system identification. The key idea:
1 by applying a known input to a system
2 and observing the system’s output,
⇒ a model of the system can be estimated.
In this lecture, we focus on black-box system identification.
Black-box: we do not have a first-principles (i.e. physics-based) model ofthe system. Black-box system identification is a purely data-drivenmodeling tool.
G. Ducard 3 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
In this lecture apply tools learned to identify an unknown system.
This process is known as system identification. The key idea:
1 by applying a known input to a system
2 and observing the system’s output,
⇒ a model of the system can be estimated.
In this lecture, we focus on black-box system identification.
Black-box: we do not have a first-principles (i.e. physics-based) model ofthe system. Black-box system identification is a purely data-drivenmodeling tool.
Grey-box: we have a first-principles model, but with unknownparameters. Data is used to identify these parameters. This is covered inthe IDSC lecture System Modeling.
G. Ducard 3 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
In this lecture apply tools learned to identify an unknown system.
This process is known as system identification. The key idea:
1 by applying a known input to a system
2 and observing the system’s output,
⇒ a model of the system can be estimated.
In this lecture, we focus on black-box system identification.
Black-box: we do not have a first-principles (i.e. physics-based) model ofthe system. Black-box system identification is a purely data-drivenmodeling tool.
Grey-box: we have a first-principles model, but with unknownparameters. Data is used to identify these parameters. This is covered inthe IDSC lecture System Modeling.
White-box: we have a first-principles model, with no unknownparameters, or where parameters can be measured directly (mass, forexample); no data is required in this case.
G. Ducard 3 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
This categorization is a simplified view.
In reality : combinations of these system identification methods are usually
applied.
G. Ducard 4 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
This categorization is a simplified view.
In reality : combinations of these system identification methods are usually
applied.
The objective of black-box system identification is:
1 typically to identify the transfer function H(z) of the system;
2 ⇒ to be used for control design, simulation, etc.
G. Ducard 4 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
This categorization is a simplified view.
In reality : combinations of these system identification methods are usually
applied.
The objective of black-box system identification is:
1 typically to identify the transfer function H(z) of the system;
2 ⇒ to be used for control design, simulation, etc.
An intermediate step
1 Often first: estimate the system’s frequency response H(Ω)(like Bode plots) – which can also be used for control designdirectly in the frequency domain (lead/lag compensation, gainand phase margin, Nyquist stability criterion, etc)
G. Ducard 4 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
This categorization is a simplified view.
In reality : combinations of these system identification methods are usually
applied.
The objective of black-box system identification is:
1 typically to identify the transfer function H(z) of the system;
2 ⇒ to be used for control design, simulation, etc.
An intermediate step
1 Often first: estimate the system’s frequency response H(Ω)(like Bode plots) – which can also be used for control designdirectly in the frequency domain (lead/lag compensation, gainand phase margin, Nyquist stability criterion, etc)
2 Next, estimate the system’s transfer function of the system,based on the frequency response estimate.
G. Ducard 4 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
System identification can either be performed in the time domainor frequency domain.
Time domain techniques can be generalized to non-linearsystems; however,
Frequency domain techniques exploit the structure of LTIsystems, and are therefore conceptually easier.
G. Ducard 5 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
System identification can either be performed in the time domainor frequency domain.
Time domain techniques can be generalized to non-linearsystems; however,
Frequency domain techniques exploit the structure of LTIsystems, and are therefore conceptually easier.
We will only consider frequency domain system identification inthis lecture, where the objective:
1 is to determine H(Ω) from experimental data,2 and then to estimate the transfer function H(z) from the
frequency response estimate.
G. Ducard 5 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Introduction
System identification can either be performed in the time domainor frequency domain.
Time domain techniques can be generalized to non-linearsystems; however,
Frequency domain techniques exploit the structure of LTIsystems, and are therefore conceptually easier.
We will only consider frequency domain system identification inthis lecture, where the objective:
1 is to determine H(Ω) from experimental data,2 and then to estimate the transfer function H(z) from the
frequency response estimate.
⇒ We focus on the black-box identification of causal, linear time-invariantsystems.
G. Ducard 5 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
IntroductionChoice of signals inputs
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 6 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
IntroductionChoice of signals inputs
Frequency Domain System Identification
We will consider the following system identification problem:
Gue
udy
ydym
Where G is a causal, stable LTI system, and
ue is a known input that we use to excite the system
ud is an unknown process noise, assumed to be white
yd is an unknown measurement noise, assumed to be white
ym, given by ym = Gue + yd + Gud, is a measurement of thesystem’s output, which is corrupted by process noise andmeasurement noise
G. Ducard 7 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
IntroductionChoice of signals inputs
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 8 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
IntroductionChoice of signals inputs
Input choice for frequency domain system identification
Based on the above problem structure, the task is now to design:
1 a set of inputs ue, such that by analyzing the measuredoutput ym
2 and the known input ue,
⇒ the frequency response of the system H(Ω) can be determinedaccurately, despite inherent process and measurement noise.
We will see later in the lecture how to estimate the system’stransfer function based on its estimated frequency response.
G. Ducard 9 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
IntroductionChoice of signals inputs
Input choice for frequency domain system identification
Based on the above problem structure, the task is now to design:
1 a set of inputs ue, such that by analyzing the measuredoutput ym
2 and the known input ue,
⇒ the frequency response of the system H(Ω) can be determinedaccurately, despite inherent process and measurement noise.
We will see later in the lecture how to estimate the system’stransfer function based on its estimated frequency response.
Question: What kind of input signal can be used for identification?
We now introduce two possible inputs:
a unit impulse,
and a sinusoid.
G. Ducard 9 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 10 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
Identifying a System based on its Impulse Response
In Lecture 2, we saw that
an LTI system is fully characterized by its impulse response.
ConclusionBy measuring its impulse response, the system can be identified.
G. Ducard 11 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
In the absence of process and measurement noise, we have that
ym = G ue .
We then have a simple way of determining freq. resp. H(Ω):1 Let ue[n] = δ[n]
2 Then ym[n] = h[n] and H(Ω) =∞∑
n=0
ym[n]e−jΩn
G. Ducard 12 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
In the absence of process and measurement noise, we have that
ym = G ue .
We then have a simple way of determining freq. resp. H(Ω):1 Let ue[n] = δ[n]
2 Then ym[n] = h[n] and H(Ω) =∞∑
n=0
ym[n]e−jΩn
In practicesince most systems have an infinite impulse response
⇒ impossible to measure it entirely,
⇒ we collect N pieces of data, where N is large enough suchthat the impulse response has decayed significantly ( = sothat ym[n] is small enough for n ≥ N).
G. Ducard 12 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
We then take the DFT:
Ym[k] =
N−1∑
n=0
ym[n]e−j 2πkN
n.
At the discrete frequency Ωk = 2πk/N where k = 0, 1, . . . , N − 1,(N DFT coefficients).
The frequency response estimate H(Ωk) is defined as:
H (Ωk) := Ym[k] = H (Ωk)−
∞∑
n=N
h[n]e−jΩkn
︸ ︷︷ ︸HN (Ωk)
,
where HN (Ωk) is the ‘estimation” error introduced by notmeasuring the entire duration of the impulse response.Remark: Note that HN(Ω) → 0 as N → ∞ since G is stable.
G. Ducard 13 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
Example : Estimating frequency response, based on impulse response, without noise
Let the system be given by the transfer function
H(z) =0.9474 + 0.2105z−1 − 0.7368z−2
1− 1.579z−1 + 0.7895z−2,
which has the following frequency response:
π02468
|H(Ω
)|
π
−90
0
90
∠H(Ω
)
G. Ducard 14 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
We apply the input ue[n] = δ[n] in the absence of noise, and recordthe system’s output for N = 11, N = 51 and N = 201 samples:
20 40 60 80 100 120 140 160 180 200
−1
0
1
2
y m[n]
ym[n] for N = 201
ym[n] for N = 51
ym[n] for N = 11
G. Ducard 15 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
Take DFT of these measurements to estimate system’s frequency responseH(Ω):
π0
2
4
6
8
∣ ∣ ∣H(Ω
)∣ ∣ ∣
H(Ω)
H(Ω) for N = 201
H(Ω) for N = 51
H(Ω) for N = 11
π
−90
0
90
∠H(Ω
)
Conclusion:
1 a larger N gives a higher frequency resolution, since we are dividing theinterval −π to π into N equally spaced frequency intervals.
2 We also note that as N increases, estimation error decreases.G. Ducard 16 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 17 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
With measurement noise
We study effects of measurement noise yd on above estimation procedure.
ym[n] = h[n] + yd[n] for n = 0, 1, . . . , N − 1,
where E(yd[n]) = 0 and E(yd[n]yd[m]) = σ2yδ[n−m].
It follows that H (Ωk) = Ym[k] = H (Ωk)−HN (Ωk) + Yd[k],where E(Yd[k]) = 0 and E(|Yd[k]|
2) = Nσ2y .
G. Ducard 18 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
With measurement noise
We study effects of measurement noise yd on above estimation procedure.
ym[n] = h[n] + yd[n] for n = 0, 1, . . . , N − 1,
where E(yd[n]) = 0 and E(yd[n]yd[m]) = σ2yδ[n−m].
It follows that H (Ωk) = Ym[k] = H (Ωk)−HN (Ωk) + Yd[k],where E(Yd[k]) = 0 and E(|Yd[k]|
2) = Nσ2y .
Thus, H (Ωk)−H (Ωk) = −HN (Ωk) + Yd[k]
E(H (Ωk)−H (Ωk)
)= −HN (Ωk) , est. error approaches zero as
N → ∞.
G. Ducard 18 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
With measurement noise
We study effects of measurement noise yd on above estimation procedure.
ym[n] = h[n] + yd[n] for n = 0, 1, . . . , N − 1,
where E(yd[n]) = 0 and E(yd[n]yd[m]) = σ2yδ[n−m].
It follows that H (Ωk) = Ym[k] = H (Ωk)−HN (Ωk) + Yd[k],where E(Yd[k]) = 0 and E(|Yd[k]|
2) = Nσ2y .
Thus, H (Ωk)−H (Ωk) = −HN (Ωk) + Yd[k]
E(H (Ωk)−H (Ωk)
)= −HN (Ωk) , est. error approaches zero as
N → ∞.
But, mean-square error: E
(∣∣∣H (Ωk)−H (Ωk)∣∣∣2)
= H2N (Ωk) +Nσ2
y
approaches infinity as the length of the sample increases, becauseNσ2
y → ∞ as N → ∞.
Remark : Inclusion of process noise ud has a similar effect, but is morecomplex to derive analytically.
G. Ducard 18 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
We now demonstrate the effect of zero-mean process noise ud andmeasurement noise yd with σ2
y = σ2u = 1
3.
Using the identical system, given by
H(z) =0.9474 + 0.2105z−1 − 0.7368z−2
1− 1.579z−1 + 0.7895z−2,
we reapply the input ue[n] = δ[n].We record the system’s output for N = 11, N = 51 and N = 201 samples:
20 40 60 80 100 120 140 160 180 200
−1
0
1
2
ym[n]
ym[n] for N = 201
ym[n] for N = 51
ym[n] for N = 11
G. Ducard 19 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
We then take the DFT of these measurements in order to estimate thefrequency response H(Ω) of the system:
π0
5
10
∣ ∣ ∣H(Ω
)∣ ∣ ∣
H(Ω)
H(Ω) for N = 201
H(Ω) for N = 51
H(Ω) for N = 11
π
−90
0
90
∠H(Ω
)
Conclusion: Here we see that the process noise and measurement noise causelarge estimation errors for large N .
G. Ducard 20 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Impulse response, no noiseImpulse response, with noise
This example highlights the problem of using a unit impulseinput to identify a system:
the energy of the input we apply stays constant,
but the energy of the measurement noise increases as Nincreases (E(|Yd[k]|
2) = Nσ2y .).
To address this problem:
one can increase the input amplitude;however, beyond a certain point, we usually don’t have thisluxury due to saturation, non-linear effects, etc.
An alternative solution is to select a more appropriate inputsignal.
G. Ducard 21 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 22 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Identification Using Sinusoidal Inputs
Goal: To identify the frequency response of a system from itsinput-output behavior.An alternative method : is to apply sinusoidal inputs at differentfrequencies .
G. Ducard 23 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Identification Using Sinusoidal Inputs
Goal: To identify the frequency response of a system from itsinput-output behavior.An alternative method : is to apply sinusoidal inputs at differentfrequencies .
Advantages of this method: more robust to noise !
Recall: the energy of the input and that of the noise bothgrow linearly as a function of N ,
the energy of the noise is spread out across all N frequencies(white noise),
but a pure sinusoid has all energy at one frequency (⇒ better“signal to noise ratio” at every frequency).
G. Ducard 23 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Sinusoidal input, output with noise
Consider the case where measurement noise corrupts the output,such that
ym = G ue + yd.
Now let
ue[n] = ej2πN
ln for n = 0, 1, . . . , NT +N − 1, be a sinusoidwith discrete frequency Ωl = 2πl/N ,
ye = Gue be the ideal output of the system.
In Lecture 6 we saw that, since ej2πN
ln is an eigenfunction of anyLTI system,
ye[n] = H (Ωl)ue[n]− w[n], (1)
where w[n] captures the effect of a causal input and decays to zeroas N → ∞ (transient).
G. Ducard 24 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
ye[n] = H (Ωl)ue[n]− w[n],
We now take the DFT of the sequences introduced above forn ≥ NT . Let
Ye[l] =
NT+N−1∑
n=NT
ye[n]e−j
2πN
ln,
Ue[l] =
NT+N−1∑
n=NT
ue[n]e−j
2πN
ln= N,
W [l] =
NT+N−1∑
n=NT
w[n]e−j2πN
ln,
then Ye[l] = H (Ωl)Ue[l]−W [l]. Remark: l is the index for the DT frequency
G. Ducard 25 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
We can thus estimate the system’s frequency response as follows. Let
Ym[l] =
NT +N−1∑
n=NT
ym[n]e−j2πN
ln
Yd[l] =
NT +N−1∑
n=NT
yd[n]e−j
2πN
ln,
then, since ym = ye + yd,
Ym[l] = Ye[l] + Yd[[l]] = H (Ωl)Ue[l]−W [l] + Yd[[l]]
Frequency response estimate: H (Ωl)
H (Ωl) :=Ym[l]
Ue[l]= H (Ωl)−
W [l]
N+
Yd[l]
N.
G. Ducard 26 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
H (Ωl) :=Ym[l]
Ue[l]= H (Ωl)−
W [l]
N+
Yd[l]
N.
We therefore have1
E(H (Ωl)−H (Ωl)
)= −
W [l]
N,
which approaches zero as NT → ∞ or N → ∞ . Therefore,as N → ∞, we have an unbiased estimate.
2
E
(∣∣∣H (Ωl)−H (Ωl)∣∣∣2)
=W 2[l]
N2+
σ2y
N.
The mean-squared error goes to 0. A similar result holds whenud is included.
Conclusion: A sinusoidal input at different frequencies is a very effective inputfor system identification. G. Ducard 27 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Experimental procedure: summary
Choose NT large enough to let the transient die down (first NT
samples of the output to discard),
G. Ducard 28 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Experimental procedure: summary
Choose NT large enough to let the transient die down (first NT
samples of the output to discard),
Choose the experiment length N .
A larger N will reduce the influence of noise (as previouslydiscussed),but will increase the duration of each experiment.
G. Ducard 28 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Experimental procedure: summary
Choose NT large enough to let the transient die down (first NT
samples of the output to discard),
Choose the experiment length N .
A larger N will reduce the influence of noise (as previouslydiscussed),but will increase the duration of each experiment.
Select a frequency of interest by choosing an appropriateinteger l and setting Ωl = 2πl/N .
Note that, because the system is real, we only need to identifythe frequency response for 0 ≤ Ω ≤ π, since H(−Ω) = H∗(Ω).We will thus pick l ∈ [0, N−1
2] if N is odd, or l ∈ [0, N
2] if N is
even.
G. Ducard 28 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Experimental procedure: summary
Set ue[n] = A cos(Ωln) for n = 0, . . . , NT +N − 1, where A scales the
input.
Choosing a large A increases the signal to noise ratio;however, if A is chosen too large, nonlinearities such assaturation may be excited, thus negatively affecting thefrequency response estimate.
G. Ducard 29 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Experimental procedure: summary
Set ue[n] = A cos(Ωln) for n = 0, . . . , NT +N − 1, where A scales the
input.
Choosing a large A increases the signal to noise ratio;however, if A is chosen too large, nonlinearities such assaturation may be excited, thus negatively affecting thefrequency response estimate.
Calculate
Ym[l] =
NT +N−1∑
n=NT
ym[n]e−jΩln and Ue[l] =
NT +N−1∑
n=NT
ue[n]e−jΩln
G. Ducard 29 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Experimental procedure: summary
Set ue[n] = A cos(Ωln) for n = 0, . . . , NT +N − 1, where A scales the
input.
Choosing a large A increases the signal to noise ratio;however, if A is chosen too large, nonlinearities such assaturation may be excited, thus negatively affecting thefrequency response estimate.
Calculate
Ym[l] =
NT +N−1∑
n=NT
ym[n]e−jΩln and Ue[l] =
NT +N−1∑
n=NT
ue[n]e−jΩln
The frequency response estimate at the frequency Ωl is then given by
H(Ωl) :=Ym[l]
Ue[l].
Repeat this for the frequencies of interest by picking the appropriateinteger l.
G. Ducard 29 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Example:Estimating frequency response using sinusoidal inputs, with noise
We now revisit the previous example using the identical system,given by
H(z) =0.9474 + 0.2105z−1 − 0.7368z−2
1− 1.579z−1 + 0.7895z−2,
and where the system is subject to both the process noise ud andthe measurement noise yd.
1 Compared to the previous example, we increase the noise suchthat the standard deviation is increased by a factor of 5,resulting in σ2
y = σ2u = 25
3 .
2 We perform system identification by applying sinusoidal inputsat N different frequencies, by choosingl = 0, 1, . . . , (N − 1)/2.
G. Ducard 30 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
The recorded input ue and output ym for NT = 50, N = 201, A = 1, andl = 7 are as follows:
0 50 100 150 200 250
−5
0
5
n
Amplitude
ue
ym without noise
ym with noise
Observations1. Ideal output of system is: shifted and scaled version of input sinusoid.2. Process noise and measurement noise corrupt the signals and their effectsare noticeable.3. By picking NT = 50, we let the transient decay. G. Ducard 31 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
The estimate of the frequency response is as follows:
π0
2
4
6
8
∣ ∣ ∣H(Ω
)∣ ∣ ∣
H(Ω)
H(Ω) for N = 201
H(Ω) for N = 51
H(Ω) for N = 11
π
−90
0
90
∠H(Ω
)
Observations: This method performs very well in the presence of noise. Theabove plot highlights the two main benefits of picking a larger N :
1 the effect of noise is further reduced, since more samples are averaged,
2 a larger N results in a finer frequency resolution, allowing morefrequencies to be tested.
G. Ducard 32 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
We now demonstrate what happens if we do not wait for the transient todecay, i.e. we pick NT = 0.
π0
2
4
6
8
∣ ∣ ∣H(Ω
)∣ ∣ ∣
H(Ω)
H(Ω) for N = 201
H(Ω) for N = 51
H(Ω) for N = 11
π
−90
0
90
∠H(Ω
)
We see that, as long as N is much larger than the transient decay time, theeffect of the transient is small. However, for small N the transient significantlyaffects the estimate of the frequency response. G. Ducard 33 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 34 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Closed-loop system identification
Often, the system to be identified is part of a closed-loop system.
This is the case, for example, if the open-loop system is unstable.⇒ In this case, an appropriate, stabilizing controller C is requiredbefore performing the identification.
Consider the following stable closed-loop system (where G can beunstable)
ucG
C
us ueud yd
ym
G. Ducard 35 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
uc
G
C
us ue
ud ydym
Let ue = uc + us. Then, ym = Gue + Gud + yd.
Discussion :
if ue can be measured, the open loop method described in the previoussection can be used to identify the frequency response of the plant.
If G and C have no poles at z = ejΩl , and under some mild assumptionson ud and yd, it can be shown that the bias and mean-squared error ofthe estimate H(Ωl) :=
Ym[l]Ue[l]
, both approach 0 as N → ∞.
G. Ducard 36 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 37 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Identifying the Transfer Function: Method
After estimating the frequency response at a number of distinct frequencies Ωl,we can identify the transfer function of the system.Given the two design parameters:
A (number of ak coefficients, although a0 is fixed at 1)
and B (number of bk coefficients),
the goal is to identify the unknown parameters: ak and bk of the system’stransfer function, given by
H(z) =
B−1∑k=0
bkz−k
1 +A−1∑k=1
akz−k
,
with frequency response
H(Ω) =
B−1∑k=0
bke−jΩk
1 +A−1∑k=1
ake−jΩk
.
G. Ducard 38 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
As a result of the identification experimentswe obtained estimates H(Ωl) of H(Ω) at L frequencies Ωl forl = 0, 1, . . . , L− 1.
Setting H(Ωl) = H(Ωl) at all measurement frequencies, we obtain the systemof equations(1 + a1e
−jΩl+ · · ·+ aA−1e−j(A−1)Ωl
)H(Ωl) =
= b0 + b1e−jΩl + · · ·+ bB−1e
−j(B−1)Ωl for l = 0, 1, . . . , L− 1.
G. Ducard 39 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
These equations must hold for both real and imaginary components.We therefore let :
H(Ωl) = Rlejφl and,
using ejθ = cos θ + j sin(θ),
rewrite the system of equations for l = 0, 1, . . . , L− 1 as
Rl cos(φl) + a1Rl cos(φl −Ωl) + · · ·+ aA−1Rl cos(φl − (A− 1)Ωl)
= b0 + b1 cos(Ωl) + · · ·+ bB−1 cos((B − 1)Ωl) Real
Rl sin(φl) + a1Rl sin(φl − Ωl) + · · ·+ aA−1Rl sin(φl − (A− 1)Ωl)
= −b1 sin(Ωl)− · · · − bB−1 sin((B − 1)Ωl) Imaginary
G. Ducard 40 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
This system of equations can be converted to the least squaresproblem of minimizing
(FΘ−G)T(FΘ −G),
where
Θ =[a1 a2 . . . aA−1 b0 b1 . . . bB−1
]T
contains the unknown parameters and where
Θ: size (A+B − 1) vector, unknown.
F : size (2L)× (A+B − 1) regression matrix, known.
G: size (2L) output measurement vector, known.
The least-squares solution
Θ∗ = (FTF )−1FTG
yields the estimated transfer function coefficients Θ∗. G. Ducard 41 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Note that there are (A+B − 1) unknown parameters in the vectorΘ, and that there are 2L equations (L frequency measurementswith both real and imaginary components). However, if anyΩl = 0 or π, an equation is lost since the equation correspondingto the imaginary component yields 0 = 0. For the existence of aleast squares solution, the matrix F must have full column rank.We therefore require
2L ≥ A+B − 1 if frequencies Ωl = 0 and Ωl = π were nottested;
2L ≥ A+B if either Ωl = 0 or Ωl = π were tested;
2L ≥ A+B + 1 if both Ωl = 0 and Ωl = π were tested.
In practice this is not a problem as typically L ≫ A+B.
G. Ducard 42 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Identifying the transfer function
In the previous example, we applied the sinusoid method toestimate the frequency response of the system given by
H(z) =0.9474 + 0.2105z−1 − 0.7368z−2
1− 1.579z−1 + 0.7895z−2,
at specified frequencies Ωl. Using the approach described above,we can now identify the transfer function. With A = B = 3, thetransfer function is identified to be:
H(z) =0.9472 + 0.2015z−1 − 0.7223z−2
1− 1.572z−1 + 0.7836z−2, for N = 201;
H(z) =0.9558 + 0.2477z−1 − 0.7693z−2
1− 1.559z−1 + 0.772z−2, for N = 51;
H(z) =0.6371 + 0.2257z−1 − 0.3091z−2
1− 1.5z−1 + 0.778z−2, for N = 11.
G. Ducard 43 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
The resulting frequency responses are the following:
π0
2
4
6
8
∣ ∣ ∣H(Ω
)∣ ∣ ∣
H(Ω)
H(Ω) for N = 201
H(Ω) for N = 51
H(Ω) for N = 11
π
−90
0
90
∠H(Ω
)
G. Ducard 44 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
Outline
1 Frequency Domain System IdentificationIntroductionChoice of signals inputs
2 Identifying a System based on its Impulse ResponseImpulse response, no noiseImpulse response, with noise
3 Identification Using Sinusoidal InputsExperimental procedureClosed-loop system identificationIdentifying the transfer function
MethodExample
Weighted least squares
G. Ducard 45 / 46
Frequency Domain System IdentificationIdentifying a System based on its Impulse Response
Identification Using Sinusoidal Inputs
Experimental procedureClosed-loop system identificationIdentifying the transfer functionWeighted least squares
A useful variant for system identification is weighted least squares: FΘ = G isreplaced by WFΘ = WG, where
W =
w0
w0
w1
w1
. . .
wL
is a (2L× 2L) square, diagonal matrix. Its elements wl are weights whichcapture the confidence in the measurements. We obtain the solution using thesubstitutions F = WF , G = WG:
Θ∗ = (FTF )−1
FTG
= (F TW
TWF )−1
FTW
TWG.
Higher weights result in a better fit at the corresponding frequencies.For example, it is beneficial to use low weights at frequencies where a systemrolls off. There, the measured amplitudes become small compared to the noiseand the measurements are less reliable. G. Ducard 46 / 46