16
MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri, 8am, Rm.4.503 . Charles Unsworth, partment of Engineering Science, Rm. 4.611 l : 373-7599 ext. 82461 ail : [email protected]

MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

MM3FC Mathematical Modeling 3LECTURE 5

Times

Weeks 7,8 & 9.Lectures : Mon,Tues,Wed 10-11am,

Rm.1439Tutorials : Thurs, 10am, Rm. ULT.

Clinics : Fri, 8am, Rm.4.503Dr. Charles Unsworth,Department of Engineering Science, Rm. 4.611

Tel : 373-7599 ext. 82461Email : [email protected]

Page 2: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

This LectureWhat are we going to cover &

Why ?• Frequency Response of Simple Systems.

(1st Order Difference System = ‘High Pass System’ )(2nd Order Difference System = ‘Low Pass System’ )(Cascaded Systems)(L-point Running Average Filter)

• The Dirichlet Function.(needed to understand the frequency response of the L-point Running Average Filter)

Page 3: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

First Difference System• The first difference system is :

y[n] = x[n] – x[n-1]

• Has coefficients bk={1,-1} with frequency response :

• Thus the magnitude response is :

)wjsin(+)wcos(-1=e -1=)wH( ˆ-jw

))wcos(-2(1=)w(sin+)w2cos(-)w(cos+1 =

(sin(w))+))wcos(-(1=)}wIm{H(+)}wRe{H( = |)wH(| ∴

)wsin(= )}wIm{H( ),wcos(-1= )}wRe{H( Now,

22

2222

… (5.1)

Page 4: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

))wcos(-)/1w(sin( tan⇒

)})w)}/Re{H(w(Im{H(tan=)wH(∠

1-

-1

))wcos(-(1=/2)w(2sin Thus, /2,w =Let x

cos2x)-(12

1=xsin Now,

2

2

• The phase response is :

/2)w2sin(=/2))w(2(2sin= |)wH(| ⇒ 2

Page 5: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

From the magnitude plot• The system completely removes the DC component at w = 0.

• However, the high frequencies up towards are preserved.

Thus, this filter is known as a ‘high pass’ filter.

From the phase plot• We can see linear phase over the preserved frequencies.

For both plots we can see only the frequency range 0 < w < need to be plotted.

And Magnitude is an EVEN function.And Phase is an ODD function.

Page 6: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

The Simple Low-Pass FIR Filter• Believe it or not ! We did this earlier. The difference equation :

y[n] = x[n] + 2x[n-1] +x[n-2]

• Gave the frequency response of Example 1, Lecture 4:

• The Magnitude plot shows the DC and low frequencies are preserved.• And the high frequencies are removed.

w-jw-2jw-j )).ewcos(2+2(=e+e2+1=)wH(

Page 7: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

Frequency Response for Cascaded Systems

• When 2 LTI systems are in cascade then we ‘convolve’ the individual impulse responses of each system together.

• The frequency response of 2 LTI systems in cascade is simply the ‘product’ of the individual frequency responses.

x[n] = ejwn H1[w]ejwn

LTI 1H1[w]

LTI 2H2[w]

y1[n]= H1[w]H2[w]ejwn

LTI 2H2[w]

LTI 1H1[n]

x[n] = ejwn H2[w]ejwn y2[n]= H2[w]H1[w]ejwn

= H1[w]H2[w]ejwn

LTI EquivalentH[w]

x[n] = ejwn y[n] = H[w]ejwn

Page 8: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

)w()Hw(H ⇔ [n]h*[n]h

tionMultiplica ⇔ n Convolutio

2121

• Thus,

Example 1 : Two LTI systems have coefficients ak={1,-2} and bk={0,1,1}. Determine their cascaded frequency response, impulse response, difference equation and the co-efficients of an equivalent filter.

H1(w) = 1 – 2e-jw and H2(w) = e-jw + e-2jw

H(w) = H1(w)H2(w) = (1 – 2e-jw)(e-jw + e-2jw) = e-jw + e-2jw – 2e-2jw - 2e-3jw

= e-jw - e-2jw - 2e-3jw

Thus the cascaded impulse response is : h[n] = [n-1] – [n-2] –2[n-3]

Thus, the cascaded difference equation is : y[n] = x[n-1] – x[n-2] –2x[n-3]

The equivalent filter has co-efficients : ck = {0,1,-1,-2}( Quite handy if you have 3 or more cascaded systems)

… (5.2)

Page 9: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

• The LTI Running average FIR system is defined as :

• Thus, the frequency response can be written as :

• We can derive the magnitude and phase of the system by making use of the series expansion formula :

Frequency Response of an L-point Running Average Filter

∑1-L

0=k

k]-x[nL

1=y[n]

∑1-L

0=k

kwj-eL

1=)wH(

∑1-L

0=k

Lk

-1

-1=

α

αα

… (5.3)

Page 10: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

• By letting = e-jw, we can expand the frequency response, such that :

• Now,

• Where DL(w) is a well known function known as the ‘Dirichlet function’, where (L) is the order of the L-point running average filter.

1)/2-(Lwj-

/2wj-/2wj/2wj-

L/2wj-L/2wjL/2wj-

wj-

Lw-j1-L

0=k

kwj-

e /2)wLsin(

L/2)wsin( =

)e-(ee

)e-(ee

L

1=

e-1

e-1

L

1=e

L

1=)wH( ∑

/2)wLsin(

L/2)wsin( =)w(D where,

e )w(D=)wH(

L

1)/2-(Lw-jL

((

(

(

))

)

)… (6.4)

Page 11: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

A Closer Look at the Dirichlet Function

• Consider what the frequency response would be for an 11-point running averager.

• Thus, H(w) is a product of the real amplitude function D11(w) and a complex exponential function e-j5w.( Remember, e-j5w has magnitude = 1 and phase = -5w )

• ‘Amplitude’ rather than ‘Magnitude’ is used to describe D11(w) because D11(w) can be –ve.

• We obtain a plot of the magnitude |H(w)| by taking the absolute value of D11(w).

• We shall consider the amplitude representation first because it is simpler to examine the properties of the amplitude.

e /2)w11sin(

11/2)wsin( =e )w(D=e )w(D=)wH( wj5-wj5-

111)/2-(11wj-

11 )(

Page 12: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

• The amplitude plot of the 11-point running averager is shown below :

Important Features to note :1) D11(w) is periodic with period 2.2) D11(w) has a maximum value = 1, at w = 0.3) D11(w) decays as (w) increases, with smallest nonzero amplitude

at w =

1) D11(w) has zeros at nonzero multiples of 2/11( In General, DL(w) has zeros at nonzero multiples of 2/L)

Page 13: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

• For completeness, we know the phase of the 11-point running averager is linear with gradient of –5w.

Page 14: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

The Magnitude response • for the 11-point running

averager is the absolute value of D11(w) :

|H(w)| = |D11(w)|

• D11(w) has zeros at nonzero multiples of 2/11.

• And null frequencies at these points

The phase response is :

• More complicated than the linear function we saw before.

• As we must include the algebraic sign in the phase function that the magnitude |H(w)| = |D11(w)| discards.

Page 15: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

• A closeup of one period shows, the phase has a discontinuity at every nulled frequency and is linear inbetween each discontinuity.

Page 16: MM3FC Mathematical Modeling 3 LECTURE 5 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,

• Moreover, in the amplitude we see that the discontinuities in the phase occur where the sign of the Dirichlet function changes.• At each sign change, where (w) is +ve we have a + phase jump.• At each sign change, where (w) is -ve we have a - phase jump.• Thus, we can construct the phase from gradient & phase jump knowledge.

Phase jump of + at eachsign change for +ve w

Phase jump of - at eachsign change for –ve w Gradient = (L-1)/2