fourier series and fourier transforms

14
Duke University Department of Civil and Environmental Engineering CEE 699.04, ME 555.05. System Identification Fall, 2013 c Henri P. Gavin, August 30, 2013 Fourier series and Fourier transforms This document describes the forced-response of a lightly-damped simple oscillator to general periodic loading. The analysis is carried out using Fourier series approximations to the periodic external forcing and the resulting periodic steady-state response. 1 Fourier Series Suppose an external forcing, f (t), is persistent and periodic with period T . ··· = f (t - 2T )= f (t - T )= f (t)= f (t + T )= f (f +2T )= ··· (1) Any periodic function may be represented as a series expansion of sines and cosines, in a Fourier series, f (t)= 1 2 a 0 + q=1 a q cos 2πqt T + q=1 b q sin 2πqt T , (2) where the Fourier coefficients, a q and b q are given by the Fourier integrals, a q = 2 T to+T to f (t) cos 2πqt T dt , q =0, 1, 2,... (3) b q = 2 T to+T to f (t) sin 2πqt T dt , q =0, 1, 2,... (4) and the time t o is arbitrary. This section emphasizes the connection between real and complex-valued notations for an oscillation. The Fourier series (2) may be represented using complex exponential notation. f (t) = 1 2 a 0 + q=1 a q cos 2πqt T + b q sin 2πqt T (5) = q= q=-∞ F q exp i 2πq T t (6) = q= q=-∞ F q e q t (7) as long as F q = F * -q .

Upload: others

Post on 25-Oct-2021

45 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fourier series and Fourier transforms

Duke UniversityDepartment of Civil and Environmental Engineering

CEE 699.04, ME 555.05. System IdentificationFall, 2013

c©Henri P. Gavin, August 30, 2013

Fourier series and Fourier transforms

This document describes the forced-response of a lightly-damped simple oscillator togeneral periodic loading. The analysis is carried out using Fourier series approximations tothe periodic external forcing and the resulting periodic steady-state response.

1 Fourier Series

Suppose an external forcing, f(t), is persistent and periodic with period T .

· · · = f(t− 2T ) = f(t− T ) = f(t) = f(t+ T ) = f(f + 2T ) = · · · (1)

Any periodic function may be represented as a series expansion of sines and cosines, in aFourier series,

f(t) = 12a0 +

∞∑q=1

aq cos 2πqtT

+∞∑

q=1bq sin 2πqt

T, (2)

where the Fourier coefficients, aq and bq are given by the Fourier integrals,

aq = 2T

∫ to+T

to

f(t) cos 2πqtT

dt , q = 0, 1, 2, . . . (3)

bq = 2T

∫ to+T

to

f(t) sin 2πqtT

dt , q = 0, 1, 2, . . . (4)

and the time to is arbitrary. This section emphasizes the connection between real andcomplex-valued notations for an oscillation. The Fourier series (2) may be represented usingcomplex exponential notation.

f(t) = 12a0 +

∞∑q=1

[aq cos 2πqt

T+ bq sin 2πqt

T

](5)

=q=∞∑

q=−∞Fq exp

[i2πqTt]

(6)

=q=∞∑

q=−∞Fq e

iωqt (7)

as long as Fq = F ∗−q.

Page 2: Fourier series and Fourier transforms

2 CEE 699.04, ME 555.05. System Identification – Duke University – Fall 2013 – H.P. Gavin

Proof:

f(t) =q=∞∑

q=−∞Fq eiωqt (8)

=q=0∑

q=−∞Fq eiωqt +

q=∞∑q=1

Fq eiωqt (9)

=q=∞∑q=0

F−qe−iωqt +n=∞∑q=1

Fqeiωqt (10)

= F0 +∞∑

q=1

[Fq eiωqt + F−q e−iωqt

](11)

= f0 +∞∑

q=1

[(F ′q + iF ′′q ) (cos ωqt + i sin ωqt) + (F ′q − iF ′′q ) (cos ωqt− i sin ωqt)

](12)

= F0 +∞∑

q=1

[2F ′q cos ωqt− 2F ′′q sin ωqt

](13)

So, the real part of Fq, F ′q, is half of aq, the imaginary part of Fq, F ′′q , is half of −bq, andFq = F ∗−q. The complex coefficients may be found directly from

Fq = 1T

∫ to+T

to

f(t) exp[−2πiqt

T

]dt . (14)

Complex exponential notation allows us to directly determine the steady-state periodicresponse to general periodic forcing, in terms of both the magnitude of the response and thephase of the response. Recall the relationship between the complex magnitudes X and F fora sinusoidally-driven spring-mass-damper oscillator is

Xq = 1(k −mω2

q ) + i(cωq)Fq (15)

Xq = H(ωq) Fq (16)

The function H(ω) is called the frequency response function for the dynamic system relatingthe input f(t) to the output x(t).

Because the oscillator is linear, if the response to f1(t) is x1(t), and the response to f2(t)is x2(t), then the response to c1f1(t) + c2f2(t) is c1x1(t) + c2x2(t). More generally, then,

x(t) =q=∞∑

q=−∞

1(k −mω2

q ) + i(cωq)Fq e

iωqt (17)

where ωq = 2πq/T .

Note that ωq is not the same symbol as ωn; ωn =√k/m, ωq = 2πq/T .

The series expansion for the response x(t) converges with fewer terms than the Fourierseries for the external forcing, because |H(ωq)| decreases as 1/ω2

q .

Page 3: Fourier series and Fourier transforms

Dynamic Periodic Response to Periodic Forcing 3

2 Fourier Transforms

Recall for periodic functions of period, T , the Fourier series expansion is

f(t) =q=∞∑

q=−∞Fq e

iωqt , (18)

where the Fourier coefficients, Fq, have the same units as f(t), and are given by the Fourierintegral,

Fq = 1T

∫ T/2

−T/2f(t) e−iωqt dt , (19)

in which the interval of integration arbitrarily starts at −T/2.

Now, consider a change of variables, by defining a frequency increment, ∆ω, and a scaledamplitude, F (ωq).

∆ω ∆= ω1 = 2πT

(ωq = q ∆ω) (20)

F (ωq) ∆= TFq = 2π∆ωFq (21)

Where the scaled amplitude, F (ωq), has units of f(t) · t or f(t)/ω.

Using these new variables,

f(t) = 12π

q=∞∑q=−∞

F (ωq) eiωqt ∆ω , (22)

F (ωq) =∫ T/2

−T/2f(t) e−iωqt dt . (23)

Finally, taking the limit as T →∞, implies ∆ω → dω and ∑→ ∫f(t) = 1

∫ ∞−∞

F (ω) eiωt dω , (24)

F (ω) =∫ ∞−∞

f(t) e−iωt dt . (25)

These expressions are the famous Fourier transform pair. Equation (24) is commonly calledthe inverse Fourier transform and equation (25) is commonly called the forward Fouriertransform. They differ only by the sign of the exponent and the factor of 2π.

By convention, the forward fast Fourier transform (FFT) of an N -point time series ofduration T (xk = x((k − 1)∆t), k = 1, · · · , N) scales the N , complex-valued, Fourier am-plitudes/coefficients as follows: FFT(x) = X(ωq)/∆t = NXq, where the Fourier-transformfrequencies, ωq, are given by ωq = 2πq/T , and are sorted as follows:q = 0, · · · , N/2,−N/2 + 1, · · · ,−1.

Page 4: Fourier series and Fourier transforms

4 CEE 699.04, ME 555.05. System Identification – Duke University – Fall 2013 – H.P. Gavin

3 Fourier Approximation

Any periodic function may be approximated as a truncated series expansion of sines andcosines, as a Fourier series,

f(t) = 12a0 +

Q∑q=1

aq cos 2πqtT

+Q∑

q=1bq sin 2πqt

T, (26)

where the Fourier coefficients, aq and bq may be found by solving the Fourier integrals,

aq = 2T

∫ T/2

−T/2f(t) cos 2πqt

Tdt , q = 0, 1, 2, . . . , Q (27)

bq = 2T

∫ T/2

−T/2f(t) sin 2πqt

Tdt , q = 0, 1, 2, . . . , Q (28)

The Fourier approximation (26) may also be represented using complex exponential notation.

f(t) =q=Q∑

q=−Q

Fq eiωqt = 1

T

q=Q∑q=−Q

F (ωq) eiωqt (29)

where eiωqt = cosωqt+ i sinωqt, ωq = 2πq/T , Fq = (aq − ibq)/2, F−q = F ∗q , and

Fq = 1T

∫ T/2

−T/2f(t) e−iωqt dt . (30)

The response of a system described by a frequency response function H(ω) to arbitraryperiodic forces described by a Fourier series may be found in the frequency domain,

Xq = H(ωq) Fq , (31)

or in the time domain,

x(t) =q=Q∑

q=−Q

H(ωq) Fq eiωqt = 1

T

q=Q∑q=−Q

H(ωq) F (ωq) eiωqt . (32)

Page 5: Fourier series and Fourier transforms

Dynamic Periodic Response to Periodic Forcing 5

4 Examples

In the following examples, the external forcing is periodic with a period, T , of 2π (sec-onds). For functions periodic in 2π seconds, the frequency increment in the Fourier series is1 radian/second. In this case, the frequency index number, q, is also the frequency, ωq, inradians per second, otherwise, ωq = 2πq/T .

The system is a forced spring-mass-damper oscillator,

x(t) + 2ζωnx(t) + ω2nx(t) = 1

mf ext(t) . (33)

The complex-valued frequency response function from the external force, f ext(t), to the re-sponse displacement, x(t), is given by

H(ω) = 1/ω2n

1− Ω2 + i 2ζΩ , (34)

where Ω is the frequency ratio, ω/ωn,

In the following three numerical examples, ωn = 10 rad/s, ζ = 0.1, m = 1 kg, andQ = 16 terms. The three examples consider external forcing in the form of a square-wave, asawtooth-wave, and a triangle-wave. In each example six plots are provided.

In the (a) plots, the solid line represents the exact form of f(t), the dashed lines representthe real-valued form of the Fourier approximation and the complex-valued form of the Fourierapproximation, and the circles represent 2Q sample points of the function f(t) for use in fastFourier transform (FFT) computations. The two dashed lines are exactly equal.

In the (b) plots, the impulse-lines show the values of the Fourier coefficients, Fq, found byevaluating the Fourier integral, equation (30), and the circles represent the Fourier coefficientsreturned by the FFT.

In the (c) plots, the red solid lines show the cosine terms of the Fourier series and theblue dashed lines show the sine terms of the Fourier series.

The (d) and (e) plots show the magnitude and phase of the transfer function, H(ω) as asolid line, the Fourier coefficients, Fq, as the green circles, and H(ωq)Fq as the blue circles.

In the (f) plots, the solid line represents x(t) as computed using equation (32), the circlesrepresent the real part of the result of the inverse FFT calculation and the dots representthe imaginary part of the result of the inverse FFT calculation.

The numerical details involved in the correct representation of periodic functions andfrequency indexing for FFT computations are provided in the attached Matlab code.

Page 6: Fourier series and Fourier transforms

6 CEE 699.04, ME 555.05. System Identification – Duke University – Fall 2013 – H.P. Gavin

4.1 Example 1: square wave

The external forcing is given by

f ext(t) = sgn(t) ; −π < t < π (35)

The Fourier coefficients for the real-valued Fourier series are:aq = 0 and bq = −(2/(qπ)) (−1q − 1).

(a)-1.5

-1

-0.5

0

0.5

1

1.5

-3 -2 -1 0 1 2 3

function, f(

t), (N

)

time, t, (s) (b)-0.7

-0.6

-0.5

-0.4

-0.3

-0.2

-0.1

0

0 2 4 6 8 10 12 14 16F

ourier

coeffic

ients

, F

q, (N

)frequency, ω, (rad/s)

(c)-1.5

-1

-0.5

0

0.5

1

1.5

-3 -2 -1 0 1 2 3

cosin

e a

nd s

ine term

s

time, t, (s) (d) 1e-04

0.001

0.01

0.1

1

0 2 4 6 8 10 12 14 16

frequency r

esponse

frequency, ω, (rad/s)

(e)-200

-150

-100

-50

0

50

100

150

200

0 2 4 6 8 10 12 14 16

phase lead, (d

egre

es)

frequency, ω, (rad/s) (f)-0.025

-0.02

-0.015

-0.01

-0.005

0

0.005

0.01

0.015

0.02

0.025

-3 -2 -1 0 1 2 3

response, x, (m

)

time, t, (s)

Figure 1. (a): — = fext(t); - - = f ext(t). (b): red solid = <(Fq); blue dashed = =(Fq);*: Fq from FFT. (c): red solid = component cosine terms, blue dashed = component sineterms. (d): — = |H(ω)|; *: |Fq| and |H(ωq)Fq|. (e): — = phase lead of H(ω); *: phaseleads of Fq and H(ωq)Fq. (f): — = x(t); *: x(t) from IFFT; · · · : =(x(t)) from IFFT.

Page 7: Fourier series and Fourier transforms

Dynamic Periodic Response to Periodic Forcing 7

4.2 Example 2: sawtooth wave

The external forcing is given by

f ext(t) = x ; −π < t < π (36)

The Fourier coefficients for the real-valued Fourier series are:aq = 0 and bq = −(2/q) (−1q).

(a)-4

-3

-2

-1

0

1

2

3

4

-3 -2 -1 0 1 2 3

function, f(

t), (N

)

time, t, (s) (b)-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0 2 4 6 8 10 12 14 16

Fourier

coeffic

ients

, F

q, (N

)

frequency, ω, (rad/s)

(c)-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

-3 -2 -1 0 1 2 3

cosin

e a

nd s

ine term

s

time, t, (s) (d) 1e-04

0.001

0.01

0.1

1

0 2 4 6 8 10 12 14 16

frequency r

esponse

frequency, ω, (rad/s)

(e)-200

-150

-100

-50

0

50

100

150

0 2 4 6 8 10 12 14 16

phase lead, (d

egre

es)

frequency, ω, (rad/s) (f)-0.08

-0.06

-0.04

-0.02

0

0.02

0.04

-3 -2 -1 0 1 2 3

response, x, (m

)

time, t, (s)

Figure 2. (a): — = fext(t); - - = f ext(t). (b): red solid = <(Fq); blue dashed = =(Fq);*: Fq from FFT. (c): red solid = component cosine terms, blue dashed = component sineterms. (d): — = |H(ω)|; *: |Fq| and |H(ωq)Fq|. (e): — = phase lead of H(ω); *: phaseleads of Fq and H(ωq)Fq. (f): — = x(t); *: x(t) from IFFT; · · · : =(x(t)) from IFFT.

Page 8: Fourier series and Fourier transforms

8 CEE 699.04, ME 555.05. System Identification – Duke University – Fall 2013 – H.P. Gavin

4.3 Example 3: triangle wave

The external forcing is given by

f ext(t) = π/2− t sgn(t) ; −π < t < π (37)

The Fourier coefficients for the real-valued Fourier series are:aq = −(2/q2π)(−1q − 1) and bq = 0.

(a)-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

-3 -2 -1 0 1 2 3

function, f(

t), (N

)

time, t, (s) (b)-0.1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0 2 4 6 8 10 12 14 16

Fourier

coeffic

ients

, F

q, (N

)

frequency, ω, (rad/s)

(c)-1.5

-1

-0.5

0

0.5

1

1.5

-3 -2 -1 0 1 2 3

cosin

e a

nd s

ine term

s

time, t, (s) (d) 1e-05

1e-04

0.001

0.01

0.1

1

0 2 4 6 8 10 12 14 16

frequency r

esponse

frequency, ω, (rad/s)

(e)-200

-150

-100

-50

0

50

100

150

200

0 2 4 6 8 10 12 14 16

phase lead, (d

egre

es)

frequency, ω, (rad/s) (f)-0.02

-0.015

-0.01

-0.005

0

0.005

0.01

0.015

0.02

-3 -2 -1 0 1 2 3

response, x, (m

)

time, t, (s)

Figure 3. (a): — = fext(t); - - = f ext(t). (b): red solid = <(Fq); blue dashed = =(Fq);*: Fq from FFT. (c): red solid = component cosine terms, blue dashed = component sineterms. (d): — = |H(ω)|; *: |Fq| and |H(ωq)Fq|. (e): — = phase lead of H(ω); *: phaseleads of Fq and H(ωq)Fq. (f): — = x(t); *: x(t) from IFFT; · · · : =(x(t)) from IFFT.

Page 9: Fourier series and Fourier transforms

Dynamic Periodic Response to Periodic Forcing 9

4.4 Matlab code1 function [Fq ,wq ,x,t] = Fourier (type,Q,wn ,z)2 % [F,w, x ] = Fourier ( type ,Q, wn, z )3 % Compute the Fourier s e r i e s c o e f f i c i e n t s o f a p e r i o d i c s i g n a l , f ( t ) ,4 % in two d i f f e r e n t ways :5 % ∗ complex e x p o n e n t i a l expansion ( i . e . , s ine and cos ine expansion )6 % ∗ f a s t Fourier transform7 %8 % The ’ type ’ o f p e r i o d i c s i g n a l may be9 % ’ square ’ a square wave

10 % ’ sawtooth ’ a saw−t oo th wave11 % ’ t r i a n g l e ’ a t r i a n g l e wave12 %13 % The per iod o f the s i g n a l , f ( t ) , i s f i x e d at 2∗ p i ( second ) .14 %15 % The number o f Fourier s e r i e s c o e f f i c i e n t s i s input as Q.16 % This r e s u l t s in a 2∗Q Fourier transform c o e f f i c i e n t s .17 %18 % The Fourier approximation i s then used to compute the steady−s t a t e19 % response o f a s i n g l e degree o f freedom (SDOF) o s c i l l a t o r , d e s c r i b e d by20 %21 % 222 % x ”( t ) + 2 z wn x ’ ( t ) + wn x ( t ) = f ( t ) ,23 %24 % where the mass o f the system i s f i x e d at 1 ( kg ) .25 %26 % see : h t t p :// en . w ik ipe d ia . org / wik i / F o u r i e r s e r i e s27 % h t t p ://www. jhu . edu/˜ s i g n a l s / f o u r i e r 2 / index . html28 %2930 i f nargin < 431 help Fourier32 return33 end343536 T = 2* pi; % per iod o f e x t e r n a l forc ing , s3738 a = zeros (1,Q); % c o e f f i c i e n t s o f cos ine par t o f Fourier s e r i e s39 b = zeros (1,Q); % c o e f f i c i e n t s o f s ine par t o f Fourier s e r i e s4041 q = [1:Q]; % p o s i t i v e f requency index va lue42 wq = 2* pi*q/T; % p o s i t i v e f requency va lues , rad/ sec , eq ’ n (20)4344 dt = T/(2*Q); % 2Q d i s c r e t e p o i n t s in time f o r FFT sampling45 ts = [-Q:Q -1]* dt; % 2Q d i s c r e t e p o i n t s in time f o r FFT sampling4647 % ” s h i f t e d ” time . . . −T/2 < t < T/2 . . .48 % t s (1) = −Q∗ dt = −T/2 = −p i . . . f (−T/2) = f (T/2) by ex tens ion49 % t s (Q) = −dt = −T/(2∗Q) = −p i /Q50 % t s (Q+1) = 0 . . . f (0) = f (T) by ex tens ion51 % t s (Q+2) = dt = T/(2∗Q) = pi /Q52 % t s (2∗Q) = (Q−1)∗dt = T/2 − dt = pi − p i /Q5354 P = 128; % number o f p o i n t s in the time−record ( f o r p l o t t i n g purposes only )55 t = [-P:P]*T/2/P; % time a x i s5657 % =======================================================================58 % Fourier s e r i e s approximation o f genera l p e r i o d i c f u n c t i o n s5960 % sin ( q∗ p i ) = 0 , cos ( q∗ p i ) = (−1).ˆ q61 % f t r u e i s used only f o r p l o t t i n g62 % f samp i s used in FFT computations63646566 i f strcmp( type,’square ’ ) % square wave67 b = - 2./(q*pi) .* (( -1).ˆq - 1);68 f_true = sign(t); f_true (1) = 0; f_true (2*P+1) = 0;69 f_samp = sign(ts );70 f_samp (1) = 0; % g e t p e r i o d i c i t y r i g h t , f (−p i ) = 0

Page 10: Fourier series and Fourier transforms

10 CEE 699.04, ME 555.05. System Identification – Duke University – Fall 2013 – H.P. Gavin

71 end7273 i f strcmp( type,’sawtooth ’ ) % sawtooth wave74 b = -(2./q) .* ( -1).ˆq;75 f_true = t; f_true (1) = 0; f_true (2*P+1) = 0;76 f_samp = ts;77 f_samp (1) = 0; % g e t p e r i o d i c i t y r i g h t , f (−p i ) = 078 end7980 i f strcmp( type,’triangle ’ ) % t r i a n g l e wave81 a = -(2./( pi*q .ˆ2)) .* ( ( -1).ˆq - 1 );82 f_true = pi /2 - t .* sign(t);83 f_samp = pi /2 - ts .* sign(ts );84 end858687 f_approxR = a * cos(q ’*t) + b * sin (q ’*t); % r e a l Fourier s e r i e s8889 Fq = (a - i*b)/2; % complex Fourier c o e f f i c i e n t s9091 % Complex Fourier s e r i e s ( p o s i t i v e and n e g a t i v e exponents )92 f_approxC = Fq * exp(i*wq ’*t) + conj(Fq) * exp(-i*wq ’*t);939495 % The imagniary par t o f the complex Fourier s e r i e s i s e x a c t l y zero !96 imag_over_real_1 = max(abs(imag( f_approxC ))) / max(abs( real ( f_approxC )))979899 % The f a s t Fourier transform (FFT) method

100 % In Matlab , the forward Fourier transform has a n e g a t i v e exponent .101 % According to a convent ion o f the FFT method , index number 1 i s f o r time = dt102 % t s (Q+1)=0 ; t s (2∗Q) = (Q−1)∗dt = T/2−dt ; t s (1) = −Q∗ dt = −T/2 ; t s (Q) = −dt103 % . . . see the t a b l e at the end o f t h i s f i l e .104105 F_FFT = f f t ( [ f_samp (Q +1:2* Q) f_samp (1:Q) ] ) / (2*Q); % Fourier c o e f f ’ s106107108 % coe f = [ Fq ’ F FFT( 2 :Q+1) ’ ] % d i s p l a y the Fourier c o e f f i c i e n t s109110 % −−−−−−−− P l o t t i n g −−−−−−−−−−−111112 figure (1);113 plot (t,f_true ,’-r’ , ts ,f_samp ,’*r’ , t,f_approxR ,’-c’ , t,f_approxC ,’-b’ )114 xlabel (’time , t, (s)’)115 ylabel (’function , f(t), (N)’)116 axis (1.05*[ - pi ,pi ])117 legend(’true ’,’sampled ’,’real Fourier approx ’,’complex Fourier approx ’)118 plot (wq , real (Fq),’ˆr’, wq ,imag(Fq),’ˆb’ , ...119 wq , real ( F_FFT (2:Q+1)) , ’*r’, wq ,imag( F_FFT (2:Q+1)) , ’*b’ )120 ylabel (’Fourier coefficients , F(w), (N)’)121 xlabel (’frequency , / Symbol w, (rad/s)’)122 legend(’real(F)’, ’imag(F)’, ’real(FFT(f)) ’, ’imag(FFT(f)) ’)123124125 figure (2);126 plot (t,a ’*ones(1 ,2*P +1).* cos(q ’*t),’-r’ , t,b ’*ones(1 ,2*P +1).* sin (q ’*t),’-b’);127 xlabel (’time , t, (s)’)128 ylabel (’cosine and sine terms ’)129 axis (1.05*[ - pi ,pi ])130131132 % =======================================================================133 % Steady−s t a t e response o f a SDOF o s c i l l a t o r to genera l p e r i o d i c f o r c i n g .134135 % Complex−va lued frequency response funct ion , H(w) , has u n i t s o f [m/N]136 H = (1/ wn ˆ2) ./ ( 1 - (wq/wn ).ˆ2 + 2*i*z*( wq/wn) );137138 % Complex Fourier s e r i e s ( p o s i t i v e and n e g a t i v e exponents )139 x_approxC = (H .* Fq) * exp(i*wq ’*t) + (conj(H) .* conj(Fq )) * exp(-i*wq ’*t);140141 % In Matlab , the i n v e r s e Fourier transform has a p o s i t i v e exponent .

Page 11: Fourier series and Fourier transforms

Dynamic Periodic Response to Periodic Forcing 11

142 % . . . see the t a b l e at the end o f t h i s f i l e f o r the s o r t i n g convent ion .143 x_FFT = i f f t ( [ (1/ wn ˆ2) , H , conj(H(Q -1: -1:1)) ] .* F_FFT ) * (2*Q);144145 figure (3); % p l o t f requency response f u n c t i o n s146 semilogy(wq ,abs(Fq),’*g’, wq ,abs(H),’-r’, wq ,abs(H.* Fq),’*b’ )147 xlabel (’frequency , / Symbol w, (rad/s)’)148 ylabel (’frequency response ’)149 legend(’|F|’, ’|H|’, ’|H*F|’)150151 plot (wq ,angle(Fq )*180/ pi ,’*g’, wq ,angle(H )*180/ pi ,’-r’, wq ,angle(H.* Fq )*180/ pi ,’*b’)152 xlabel (’frequency , / Symbol w, (rad/s)’)153 ylabel (’phase lead , ( degrees )’)154155 figure (4); % p l o t time response156 ts = [ ts(Q +1:2* Q) ts (1:Q) ]; % re−s o r t the time a x i s157 plot ( t,x_approxC ,’-r’ , ts , real ( x_FFT ),’*b’ , ts , imag( x_FFT ),’.b’ )158 axis (1.05*[ - pi ,pi ])159 xlabel (’time , t, (s)’)160 ylabel (’response , x, (m)’)161 legend(’x(t) - complex Fourier series ’, ’real(x(t)) - FFT ’, ’imag(x(t)) - FFT ’)162163164 % The imaginary par t i s e x a c t l y zero f o r the complex exponent s e r i e s method !165 imag_over_real_2 = max(abs(imag( x_approxC ))) / max(abs( real ( x_approxC )))166167 % The imaginary par t i s p r a c t i c a l l y zero f o r the FFT method !168 imag_over_real_3 = max(abs(imag( x_FFT ))) / max(abs( real ( x_FFT )))169170 % −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−171 % SORTING of the FFT c o e f f i c i e n t s number o f data p o i n t s = N = 2∗Q172 % note : f max = 1/(2∗ dt ) ; d f = f max /(N/2) = 1/(N∗ dt ) = 1/T;173 %174 %175 % index time frequency176 % ===== ==== =========177 % 1 0 0178 % 2 dt d f179 % 3 2∗ dt 2∗ d f180 % 4 3∗ dt 3∗ d f181 % : : :182 % N/2−1 (N/2−2)∗ dt f max−2∗d f = ( N/2−2)∗ d f183 % N/2 (N/2−1)∗ dt f max−d f = ( N/2−1)∗ d f184 % N/2+1 (N/2)∗ dt +/− f max = ( N/2 )∗ d f185 % N/2+2 (N/2+1)∗ dt −f max+df = (−N/2+1)∗ d f186 % N/2+3 (N/2+2)∗ dt −f max+2∗d f = (−N/2+2)∗ d f187 % : : : :188 % N−2 (N−3)∗dt −3∗d f189 % N−1 (N−2)∗dt −2∗d f190 % N (N−1)∗dt −d f191 % −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

Page 12: Fourier series and Fourier transforms

12 CEE 699.04, ME 555.05. System Identification – Duke University – Fall 2013 – H.P. Gavin

5 Random Loading

5.1 Response to Random Loading with Finite Period or Duration

The frequency content of a random process is characterized by its power spectral density.The power spectral density of a random process of finite duration, T , is the expectation ofthe process’s squared Fourier amplitudes divided by its duration

Pxx(ωq) = 1T

E[|X(ωq)|2] = 1T

limM→∞

1M

M∑m=1|Xm(ωq)|2 = 1

Tlim

M→∞

1M

M∑m=1

∣∣∣∣∣∫ T

0xm(t)e−iωqt dt

∣∣∣∣∣ .(38)

where xm(t) is a record in a sample of M records representative of the process. Unit-intensitywhite noise, u(t), is a random process with a power spectral density of unity over all frequen-cies, so E[|U(ωq)|2] = T . If u(t) is periodic in T then E[|U(ωq)|2] = |Um(ωq)|2 ∀ n, andthere is no uncertainty in the Fourier magnitudes, |U(ωq)|. In such a situation, the uncer-tainty lies entirely in the ratio of the real to the imaginary parts of U(ωq), i.e., the phase,φq = tan−1(U ′′(ωq)/U ′(ωq)). The complex Fourier amplitudes of unit-intensity noise withperiod T (and no spectral magnitude variability) may therefore be computed from

U(ωq) = U ′(ωq) + iU ′′(ωq) =√T cosφq + i

√T sinφq ; (39)

where φq is uniformly distributed between −π and π.

If u(t) is periodic (or if u(t) has finite duration and is assumed to be periodic) theresponse y(t) of a system with frequency response H(ω) to u(t) is also periodic and may beapproximated from the finite series

y(t) = 1T

q=Q∑q=−Q

H(ωq) U(ωq) eiωqt . (40)

where ωq = 2πq/T . If U(ω) is the Fourier transform of a unit-intensity random process forwhich E[|U(ωq)|2] = |U(ωq)|2, the periodic response may be computed from

y(t) = 2√

∆fq=Q∑q=1|H(ωq)| cos(ωqt+ θq) , (41)

where θq is uniformly distributed between −π and π. This response has a period T and∆f = 1/T .

Since the frequency response, H(ω) represents the input-output relationship of real-valuedfunctions, H(−ω) = H∗(ω), U(−ω) = U∗(ω), and Y (−ω) = Y ∗(ω). The system frequencyresponse function may be represented in terms of real and imaginary parts, H(ω) = H ′(ω) +iH ′′(ω) where H ′(ω) = |H(ω)| cosψ(ω) and H ′′(ω) = |H(ω)| sinψ(ω), and where |H(ω)| isthe magnitude of the frequency response function and ψ(ω) is the phase of the frequencyresponse function. The following derivation makes use of the notation U(ωq)/T = Uq andH(ωq)/T = Hq.

Page 13: Fourier series and Fourier transforms

Dynamic Periodic Response to Periodic Forcing 13

Breaking the sum of equation (40) into negative and non-negative values of the index q,

y(t) = 1T

q=−1∑q=−Q

H(ωq) U(ωq) eiωqt + 1T

q=Q∑q=0

H(ωq) U(ωq) eiωqt

= T−1∑

q=−Q

HqUq(cosωqt+ i sinωqt) + TQ∑

q=0HqUq(cosωqt+ i sinωqt)

= TQ∑

q=1H∗qU

∗q (cosωqt− i sinωqt) + T

Q∑q=0

HqUq(cosωqt+ i sinωqt)

= TH0U0(cosω0t+ i sinω0t) +

TQ∑

q=1(H ′qU ′q −H ′′qU ′′q − i(H ′qU ′′q +H ′′qU

′q))(cosωqt− i sinωqt) +

TQ∑

q=1(H ′qU ′q −H ′′qU ′′q + i(H ′qU ′′q +H ′′qU

′q))(cosωqt+ i sinωqt)

= TH0U0 + TQ∑

q=1H ′qU

′q cosωqt−H ′′qU ′′q cosωqt− i(H ′qU ′′q +H ′′qU

′q) cosωqt+

− iH ′qU ′q sinωqt+ iH ′′qU′′q sinωqt− (H ′qU ′′q +H ′′qU

′q) sinωqt+

TQ∑

q=1H ′qU

′q cosωqt−H ′′qU ′′q cosωqt+ i(H ′qU ′′q +H ′′qU

′q) cosωqt+

iH ′qU′q sinωqt− iH ′′qU ′′q sinωqt− (H ′qU ′′q +H ′′qU

′q) sinωqt

= TH0U0 + 2TQ∑

q=1(H ′qU ′q −H ′′qU ′′q ) cosωqt− (H ′qU ′′q +H ′′qU

′q) sinωqt

= TH0U0 + 2√T

Q∑q=1

(H ′q cosφq −H ′′q sinφq) cosωqt− (H ′q sinφq +H ′′q cosφq) sinωqt

= TH0U0 + 2√T

Q∑q=1

H ′q(cosφq cosωqt− sinφq sinωqt)−H ′′q (cosφq sinωqt+ sinφq cosωqt)

= TH0U0 + 2√T

Q∑q=1

H ′q cos(ωqt+ φq)−H ′′q sin(ωqt+ φq)

= TH0U0 + 2√T

Q∑q=1|Hq| cosψq cos(ωqt+ φq)− |Hq| sinψq sin(ωqt+ φq)

= TH0U0 + 2√T

Q∑q=1|Hq| cos(ωqt+ φq + ψq) (42)

Since cosine is periodic in [−π : π] and since φ is uniformly distributed within [−π : π], andassuming either H0 = 0 or U0 = 0, equation (42) simplifies to equation (41)

y(t) = 2√

∆fq=Q∑q=1|H(ωq)| cos(ωqt+ θq)

where θq is uniformly distributed in [−π : π]. Note, again, that over a period T = 2π/ω1 =1/(∆f), this response is periodic. With frequencies ωq = 2πq/T , and 0 ≤ t < T , the

Page 14: Fourier series and Fourier transforms

14 CEE 699.04, ME 555.05. System Identification – Duke University – Fall 2013 – H.P. Gavin

magnitude of the Fourier transform of the response to unit-intensity random input, y(t), ascomputed from equation (41) recovers |H(ω)| exactly: E[|Y (ωq)|2] = |Y (ωq)|2 = |H(ωq)|2.

5.2 Response to Non-periodic or Persistent Random Loading

The response of a linear system to non-periodic or persistent white noise is not periodic.A strictly-proper linear system,

x(t) = Ax(t) +Bu(t), x(0) = xo (43)y(t) = Cx(t) (44)

has the frequency response H(ω) = C(iωI − A)−1B, which, in turn, has a realization

H(ω) ∼[A BC 0

]. (45)

Its response may be simulated in discrete-time via numerical integration methods. If thetime series u(tk) and y(tk) have N points, simulating white noise response of the system (45)requires the generation of N uncorrelated standard Gaussian random values, u(tk). Sampledunit Gaussian white noise with time step ∆t is normally distributed with a mean of zero anda standard deviation of 1/

√∆t, has a mean square value of 1/(∆t), and a power spectral

density of 1 over a frequency range −1/(2∆t) < f < 1/(2∆t).