arun k. tangirala - ω frequency response n function...

4
Arun K. Tangirala (IIT Madras) CH 5230: System Identification January-April 2010 Responses of LTI systems First-order, Second-order, Delay and Higher-order systems FREQUENCY RESPONSE FUNCTION ESTIMATION Arun K Tangirala Department of Chemical Engineering IIT Madras Lecture Notes for CH 5230 Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010 Responses of LTI systems First-order, Second-order, Delay and Higher-order systems To recall, the FRF is defined as (for an LTI system) The summation begins from n = 0 assuming a causal system (g[n] = 0, n < 0) The FRF is also known as the transfer function since it is a frequency-domain representation It only exists when the sum converges, which will if and only if the system is stable, i.e., The ratio definition is in terms of Discrete-Time Fourier Tranforms of output and input Interpreting the FRF is straightforward. For a sine input of frequency ω, |G(e jω )| gives the amplitude ratio of the output sine / input sine (at steady-state) G(e jω ) gives the phase shift (at steady-state) at that frequency Frequency Response Functions 2 G(e jω )= n=0 g[n]e jωn = Y (ω) U (ω) n=0 |g[n]| < Y (ω)= n=0 y[n]e jωn ; U (ω)= n=0 u[n]e jωn Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010 Responses of LTI systems First-order, Second-order, Delay and Higher-order systems FRF in practice The theoretical definition of FRF is based on infinite summation of output and input Practically, we encounter two difficulties: Infinite samples of output and input are not available. From a computational viewpoint, we can compute DTFT only on a discrete frequency grid This leads us to the well-known Discrete Fourier Transform (DFT) where the frequencies are Notice that number of frequencies equal the number of samples - this is necessary to be able to reconstruct the continuous-frequency DTFT (if necessary) The factor 1/N is usually 1/N. The modified factor is to facilitate symmetry of the synthesis equation (reconstructing time-samples from DFT) 3 Y (ω k )= 1 N N1 n=0 y[n]e jωkn ; U (ω k )= 1 N N1 n=0 u[n]e jωkn ω k =2π k N , k =0, ··· ,N 1 Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010 Responses of LTI systems First-order, Second-order, Delay and Higher-order systems The relationship between the DFTs of input and output through the FRF is no longer exact in general, i.e., This is important to know since this means the ratio of DFTs (may) only give us an estimate of the FRF (even in the absence of noise) In fact, The remainder term RN(ω) goes to zero asymptotically (for large samples) For periodic signals with period N, the relationship is exact at those frequencies. Thus, a plausible estimate of FRF is the ratio of DFTs, which will at least give us a reasonable estimate of the FRF FRF in practice … continued 4 Y N (ω k ) U N (ω k ) = G(e jωk ) Y N (ω k ) = G(e jωk )U N (ω k )+ R N (ω) |R N (ω)| 2C u C G N where |u[n]| C u , and C G = n=−∞ n|g[n]|

Upload: others

Post on 08-Mar-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Arun K. Tangirala (IIT Madras) CH 5230: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

FREQUENCY RESPONSE FUNCTION ESTIMATION

Arun K Tangirala

Department of Chemical EngineeringIIT Madras

Lecture Notes for CH 5230

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

To recall, the FRF is defined as (for an LTI system)

• The summation begins from n = 0 assuming a causal system (g[n] = 0, n < 0)

• The FRF is also known as the transfer function since it is a frequency-domain representation

• It only exists when the sum converges, which will if and only if the system is stable, i.e.,

• The ratio definition is in terms of Discrete-Time Fourier Tranforms of output and input

Interpreting the FRF is straightforward. For a sine input of frequency ω,

• |G(ejω)| gives the amplitude ratio of the output sine / input sine (at steady-state)

• ∠G(ejω) gives the phase shift (at steady-state) at that frequency

Frequency Response Functions

2

G(ejω) =∞�

n=0

g[n]e−jωn =Y (ω)

U(ω)

∞�

n=0

|g[n]| < ∞

Y (ω) =∞�

n=0

y[n]e−jωn ; U(ω) =∞�

n=0

u[n]e−jωn

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

FRF in practiceThe theoretical definition of FRF is based on infinite summation of output and input

Practically, we encounter two difficulties:

• Infinite samples of output and input are not available.

• From a computational viewpoint, we can compute DTFT only on a discrete frequency grid

This leads us to the well-known Discrete Fourier Transform (DFT)

where the frequencies are

• Notice that number of frequencies equal the number of samples - this is necessary to be able to reconstruct the continuous-frequency DTFT (if necessary)

• The factor 1/√N is usually 1/N. The modified factor is to facilitate symmetry of the synthesis equation (reconstructing time-samples from DFT)

3

Y (ωk) =1√N

N−1�

n=0

y[n]e−jωkn ; U(ωk) =1√N

N−1�

n=0

u[n]e−jωkn

ωk = 2πk

N, k = 0, · · · , N − 1

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

The relationship between the DFTs of input and output through the FRF is no longer exact in general, i.e.,

• This is important to know since this means the ratio of DFTs (may) only give us an estimate of the FRF (even in the absence of noise)

• In fact,

• The remainder term RN(ω) goes to zero asymptotically (for large samples)

• For periodic signals with period N, the relationship is exact at those frequencies.

Thus, a plausible estimate of FRF is the ratio of DFTs, which will at least give us a reasonable estimate of the FRF

FRF in practice … continued

4

YN (ωk)

UN (ωk)�= G(ejωk)

YN (ωk) = G(ejωk)UN (ωk) +RN (ω)

|RN (ω)| ≤ 2CuCG√N

where |u[n]| ≤ Cu, and CG =∞�

n=−∞n|g[n]|

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Empirical Transfer Function Estimate (ETFE)The simplest way of estimating FRF is to feed a sine wave of known frequency and recording the response.

• The presence of noise can be overcome by taking the correlation of the input and response with a cosine (sine) of that frequency

• However, this method is time-consuming - FRF at each frequency requires a separate input

In practice, from both computational (effect of noise) and experimental (time and cost), it is best to be able to estimate using inputs of mixed frequencies

The first approach in that direction leads us to the Empirical Transfer Function Estimate (ETFE)

• The double hat on the estimate is to reflect the fact that in absence of noise, it is still only an estimate

5

ˆG(ejωk) =YN (ωk)

UN (ωk)

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Properties of ETFE

Assume the true process is

Then, the ETFE can be written as

where

• The second term is bounded and vanishes asymptotically (large samples)

The effect of noise has to be analyzed in the statistical domain

• The term RN(ωk) decays proportional to 1/√N and is zero when periodic inputs are used

6

y[n] = G0(q)u[n] + v[n]

ˆG(ejωk) = G0(ejωk) +RN (ωk)

UN (ωk)+

VN (ωk)

UN (ωk)

VN (ωk) =1√N

N−1�

n=0

v[n]e−jωkn

E( ˆG(ejωk)) = G0(ejωk) +RN (ωk)

UN (ωk)

The ETFE is an asymptotically unbiased estimator of the FRF, while being simply unbiased when inputs of period N are used.

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Variance of ETFEThe variance of the ETFE can be shown to be

Thus, the error in ETFE does not vanish even for large N

• This is reminiscent of the spectrum estimation for random signals

‣ The spectral estimates of random signals using the DFT are uncorrelated and hence highly erratic (fluctuating)

‣ Estimate of FRF from data due to a single realization does not help

Ideally, the FRF is smooth for LTI systems. How do we get this from ETFE?

• The smoothness in FRF can be brought about by smoothing the ETFE in a small neighbourhood of each frequency (Weighted Least Squares estimates of the true FRF)

• Alternatively, we can use ideas in spectral estimation. Split the data into segments and compute the average ETFE (idea is to generate more realizations out of a single data set!).

7

=

�1

|UN (ω)|2 [Φv(ω) + ρ2(N)], if ξ = ωρ2(N)

UN (ω)UN (−ξ) , if |ξ − ω| = 2πkN , k = 1, 2, · · · , N − 1

E�[ ˆGN (ejω)−G0(ejω)][ ˆGN (e−jξ)−G0(e−jξ)]

|ρ2(N)| ≤ C2√N

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Properties of ETFE: SummaryThe ETFE is an asymptotically unbiased estimator of the FRF

• The magnitude response, however, is not an asymptotically unbiased estimator of the true magnitude response

The variance of ETFE does not decrease with number of samples

• In fact, as N →∞, the var(ETFE) œ inverse of the signal-to-noise ratio at that frequency

• The variance does not decrease with N simply because we are estimating at as many frequencies as many data points we have.

The estimates are asymptotically uncorrelated at two different frequencies

When input is periodic, the input spectrum is proportional to N and therefore, the variance decays to zero.

8

limN→∞

E(| ˆG(ejω)|2) = |G0(ejω)|2 + Φvv(ω)

|UN (ω)|2

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Example

Notice that estimates are quite erratic

Increase in number of samples will also produce the same behaviour

Observe the smooth nature of the true response

Weighted average in frequencies may reduce the fluctuations in ETFE

9

>> mod_p = idpoly([1 -0.7 0.1],[0 0 1],[1 0.4],1,1,’NoiseVariance’,1);

>> uk = idinput(2046,’prbs’,[0 0.4],[-1 1]);

>> yk = sim(mod_p,uk,’Noise’);

>> dataset = iddata(yk,uk,1);

>> datatilde = detrend(dataset);

>> Gwhhat = etfe(datatilde); % Compute the ETFE

>> bode(mod_p,Gwhhat);

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Smoothing the ETFE is equivalent to accommodating the nature of FRF of an LTI system into the estimation procedure

Collect estimates in the neighbourhood of a frequency point and weigh them appropriately

Consider a frequency interval ω0 - !ω " ω " ω0 + !ω over which the true FRF G0(ej ω) is constant

• The ETFE in this interval provides estimates of this constant and has an asymptotic variance of Φvv(ω)/|UN(ω)|2

Using principles of WLS, the optimal estimate of G0(ej ω) is given by

Smoothed (Weighted) estimates of ETFE

10

GN (ejω0) =

k2�

k=k1

αkˆG(ejωk)

k2�

k=k1

αk

where

αk =|UN (ωk)|2

Φvv(ωk)

�ω =2π(k1 − k2)

N

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Weighted estimates using auto/cross-spectraThe FRF need not be constant, but rather smooth around the frequency of interest

• In such a case, an additional weighting can be chosen to give importance to frequencies close to ω0

The weights require the knowledge of disturbance spectrum

• Assume that the disturbance spectrum is constant in a small neighbourhood of ω0

The result is a weighted estimate that does not really require the knowledge of disturbance spectrum

• Wϒ(ξ-ω0) is the weighting function centered around ω0, while ϒ controls the window shape

It can be shown that this is equivalent to using auto- and cross-spectral estimates

11

GN (ω) =ΦN

yu(ω)

ΦNuu(ω)

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Segmentation approach (Welch’s method)There are several windows available for the weighted estimation approach

• Hanning, Bartlett, Hamming, Parzen, …

The solutions that we have discussed are pretty much identical to those that are used in spectral estimation of time-series

Therefore, it is natural to adopt another commonly used solution

• Split up the data into segments, compute the auto-(cross) power spectrum for each segment and take the average of such estimates

Dividing the data set into M segments of length L each gives us the estimate

12

GN (ejω) =1

M

M�

k=1

ˆG(k)L (ejω)

or GN (ejω) =

M�

k=1

β(k)L (ω) ˆG(k)

L (ejω)

β(k)L (ω)

where β(k)L (ω) = |UL(ω)|2

Welch’s method

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Examples

Clearly the smoothed estimate is closer to the true response

Smoothing has been achieved at the cost of loss of resolution (the frequency spacing)

We can now estimate the disturbance spectrum

13

>> mod_p = idpoly([1 -0.7 0.1],[0 0 1],[1 0.4],1,1,’NoiseVariance’,1);

>> uk = idinput(2046,’prbs’,[0 0.4],[-1 1]);

>> yk = sim(mod_p,uk,’Noise’);

>> dataset = iddata(yk,uk,1);

>> datatilde = detrend(dataset);

>> Gwhhat = etfe(datatilde); % Compute the raw (ETFE) estimate

>> Gwhat = spa(datatilde); % Compute the smoothed estimate

>> bode(mod_p,Gwhat,Gwhhat);

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Estimating the disturbance spectrumThe knowledge of disturbance spectrum is useful in many ways

• We can guess the nature of noise model or test for whiteness of residuals

• We can use it iteratively to improve the estimate of ETFE

Theoretically, the disturbance spectrum is

Practically, the disturbance spectrum is estimated from that of residuals

Asymptotically, the estimate tends to the true spectrum

14

Φvv(ω) = Φyy(ω)− |G(ejω)|2Φuu(ω)

Φvv(ω) =

� π

−πWγ(ξ − ω)|YN (ξ)− GN (ejξ)UN (ξ)|2 dξ

≈ ΦNyy(ω)−

|ΦNyu(ω)|2

ΦNuu(ω)

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

Example

Observe how the disturbance spectrum has been estimated without the knowledge of the underlying models

We can use this disturbance spectrum to decide on the nature of noise model

15

>> mod_p1 = idpoly([1 -0.7 0.1],[0 0 1],[1 0.4],1,1,’NoiseVariance’,1);

>> mod_p2 = idpoly(1,[0 0 1],1,1, [1 -0.7 0.1],’NoiseVariance’,1);

>> uk = idinput(2046,’prbs’,[0 0.4],[-1 1]);

>> yk1 = sim(mod_p1,uk,‘Noise’); yk2 = sim(mod_p2,uk,‘Noise’);

>> dataset1 = iddata(yk1,uk,1); datatilde1 = detrend(dataset1);

>> dataset2 = iddata(yk2,uk,1); datatilde2 = detrend(dataset2);

>> Gwhat1 = spa(datatilde1); Gwhat2 = spa(datatilde2);

>> bode(Gwhat1(‘noi’),Gwhat2(‘noi’));

Arun K. Tangirala (IIT Madras) CH 3040: System Identification January-April 2010

Responses of LTI systems First-order, Second-order, Delay and Higher-order systems

SummaryThe frequency response function can be estimated from input-output data in primarily two ways:

• ETFE: Provides the raw estimate. It is asymptotically unbiased, but its variance does not decrease with number of samples (except for periodic inputs)

• Weighted/Smoothed estimate: Use the WLS or Welch’s averaged periodogram approach to improve the quality of ETFE

The disturbance spectrum can be estimated without the knowledge of process or noise models

• It is useful in improving the estimate of ETFE

• It is useful in determining the nature of noise models

The non-parametric estimates are useful in

• Testing the quality of parametric models

• Input design

16