mm3fc mathematical modeling 3 lecture 4 times weeks 7,8 & 9. lectures : mon,tues,wed 10-11am,...

20
MM3FC Mathematical Modeling 3 LECTURE 4 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]

Post on 20-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

MM3FC Mathematical Modeling 3LECTURE 4

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]

This LectureWhat are we going to cover &

Why ?• The Frequency Response of a filter. (Response of the filter to real world complex

sinusoids)

• Graphical Representation of Frequency Response.

(Using Magnitude response and Phase Response diagrams)

• Frequency Response of Simple Systems. (The delay system)

Frequency Response of FIRS• Now we will introduce the concept of ‘frequency response’ of an

FIR.

• So far our discrete input x[n] has been that of simple integer values.

• Now we shall look at real world inputs where x[n] is a complex sinusoid.

• We will show that for LTI systems when x[n] is a complex sinusoid then y[n] is a complex sinusoid of the same frequency but with a different magnitude and phase.

• The frequency response of a system summarises the magnitude and phase change the system produces for all possible frequencies.

Sinusoidal Response of an FIR• LTI systems behave in a simple way when the input is a discrete-

time (digitised) complex exponential.• The simple FIR is :

∑M

0=kk ]-[b = y[n] knx

• To recap, if we sample the continuous time signal x(t) :

• And take ‘snap-shots’ x[n] at a sampling period every (Ts) secs.

• We now let , where is the sampled frequency.

•Any recorded signal is said to be “discrete”.

•A ‘discrete (digital) signal’ is a ‘snap-shot’ x[n] of a continuous signal taken every (Ts) secs.

x[n] = x(nTs) = Acos(ω(nTs) + φ)

Where, (n) is an integer indicating the position of the values in the sequence.

)jw(nTjφ

ss

seAe=

)+ )Acos(w(nT = ) x(nT= x[n] φ

jwtjφeAe=)+Acos(wt = x(t) φ

swT=w w

nwjjφeAe=

)+n wAcos( = x[n] φ

… (4.0)

• Thus, substituting into the FIR equation :

• Separating out the exponential term we get :

• Where,

• H(w) is the ‘frequency response function’ or ‘frequency response’ of an LTI system to a complex exponential signal of any frequency (w).

∑∑M

0=k

k)-(nwjjφk

M

0=kk eAeb=k]-x[nb = y[n]

nwjjφ

M

0=k

nwjjφk wj-k

eAe ).wH(=

e.Ae eb = y[n] ∑( )

kwj-M

0=kkeb=)wH( ∑

… (4.1)

… (4.2)

• Now the impulse response for the FIR system is related in the same way :

• Thus, we can express the frequency response in terms of the filter co-efficients (bk) or the impulse response h[k].

The ‘frequency response’ of an LTI FIR system

The output from an LTI FIR is :

∑∑M

0=k

M

0=kk ]-[ h[k]=]-[b = y[n] knxknx

kwj-M

0=k

kwj-M

0=kk e h[k]=eb=)wH( ∑∑

nwjjφeAe ).wH(= y[n]

… (4.3)

… (4.4)

Important points :1) H(w) multiples the signal thus changing the complex amplitude.2) H(w) is complex–valued so can be expressed as :

• Thus, if we had a signal x[n] such that :

• Then the output would be :

)wH(∠ je . |)wH(| =)wH(

nwjjφeAe= x[n]

nwjφ)+)wH(∠( j

nwjjφ)wH(∠ j

e e . |)AwH(| =

eAe . e |)wH(| =y[n]

Magnitude response = f(w)

Phase response= f’(w)

… (4.5)

… (4.6)

Example 1 : An FIR has filter co-effficients bk= {1,2,1}. a) Determine the system’s frequency response. b) Determine formulas for the magnitude and phase of the

frequency response. c) Determine the output y[n] of such a system if the input signal is

x[n] = 2ej/4 ej n/3.

OK !a) The frequency response H(w) can expressed from the filter

coefficients.

b) Obtain magnitude and phase formulas from H(w). We want H(w) in the form of :

w2j-wj-

(2)wj-(1)wj-(0)wj-kwj-M

0=kk

e+e2+1=

e.1+e.2+e.1=eb=)wH( ∑

)wH(∠ je . |)wH(| =)wH(

Using manipulation of H(w) we get :

wj-

wj-wjwj-

w-2jw-j

)).ewcos(2+2(=

)e+2+e(e=

e+e2+1=)wH(

w-= )wH(∠

π≤w<π-when , 0≥))w2cos(+(2= |)wH(| ∴

• Now we can see how the magnitude and phase of the output signal y[n] will vary for any complex sinusoid of frequency(w).

• How do we know what factor to take out ?

We take out an exponential which is ½ order of the filter.

Thus, H(w) = 1 + 2 e-jw + e-2jw

Has Length(L) = 3, Order = L–1 = 2Thus, take out an e-jw

.

Or better still just grab the ‘highest ordered exponent’ and divide it’s power by 2. And this becomes the factor.i.e e-2jw/2 = e-jw

c) Determine y[n] when x[n] = 2ej/4 ej n/3.

As we can see x[n] has :

Calculate magnitude & phase response at this frequency for this system :

Now substitute into the equation :

/3-=)wH(∠ ,3= |)wH(| ∴3e=/3))2cos(+(2e= /3)H( ∴

))w2cos(+(2e= )wH( /3j-/3j-

w-j

π

ππ ππ

π/3=w π/4,=φ

1)-/3(nj/4j/3)-n/3j(/4j

n/3j/4j/3j-

nwjjφ)wH(∠ j

.e e6=e e6=

e e2.e3=

eAe . e |)wH(| =y[n]

πππππ

πππ Want to keep y[n] in same format as x[n].So keep this to one side.Group these

terms instead.

• Finally, y[n] has been multiplied by 3. • And has a phase shift that corresponds to a delay of one sample.

• What happens when an input signal x[n] is made up of many signals ?

• First we use the principal of superposition to break the signal down into its constituent complex exponentials.

• Then we apply the ‘frequency response’ of the system to each different frequency in turn.

Example 2 : Using the frequency response of the FIR with coefficients bk={1,2,1} find the output y[n] when the input x[n] is :

Substituting in the different frequencies we get :

Frequency Response for complicated signals

)21

20cos(3+)

2-

33cos(+4=x[n] nn

πππ

/21j20-/21j20-

/3j-/3j-

0

e0223.0=))21/20cos(2+2(e=/21)H(20

e3=))3/cos(2+2(e=/3)H(

4=))0cos(2+2(e=H(0)

ππ

ππ

ππ

ππ

• Multiplying each frequency by its corresponding frequency response :

• Substituting in each frequency response term :

• Thus the final output written in the same form as the input x[n] is :

/21)n)H(2021

20π3cos(+/3))H(

2

π-n

3

π3cos(+4H(0)=y[n] ππ

)n)(0.0223e21

20π3cos(+))(3e

2

π-n

3

π3cos(+4(4)=y[n] 21/j20-/3j- ππ

1))-(n 21

20π0.067cos(+)

2

π-1)-(n

3

π9cos(+16=

)21

20-n

21

20π0.067cos(+)

3-

2

π-n

3

π9cos(+16=y[n]

ππ

DC level is x4

x3& delayed by 1 sample

x0.0223& delayed by 1 sample

Properties of Frequency Response

• We have just illustrated a way of solving problems in the ‘frequency -domain’.

• When the input is a complex exponential we do not have to work in the ‘time-domain’. (i.e difference equation or impulse response)

• We can work completely in the ‘frequency-domain’ if we think about how the spectrum of the signal is modified rather than considering what happens to individual samples.

• The frequency response function H(w) has a number of properties.

Relationship between Frequency Response, Impulse Response & difference equation.

• From the equation below we can see we can determine H(w) from the filter co-efficients (bk’s) or from the impulse response.

kwj-M

0=k

kwj-M

0=kk e h[k]=eb=)wH( ∑∑

• When we go from the Impulse response to the frequency response we move from the ‘time-domain’ into the ‘frequency-domain’.

Example 3 : Write down the difference equation, impulse response and frequency response for the FIR filter with bk={-1,3,-1}

Difference Equation : y[n] = -x[n] + 3x[n-1] - x[n-2]

Impulse Response : h[n] = -[n] + 3[n-1] - [n-2]

(Just the same but with ’s replacing the x’s)

Frequency Response : H(w) = -1 + 3e-jw – e-2jw

(Just the same but with e-jw’s replacing the x’s)

kwj-M

0=k

M

0=k

e h[k]=)wH( ⇔ k]-[n h[k]= h[n]

Domain Frequency ⇔ Domain Time

∑∑ δ… (4.7)

Example 4 : Using Eulers formulae, determine the difference equation and impulse response from the frequency response of the FIR system below :

)w2cos-3(e=)wH( w-j

Periodicity of H(w)• An important property of a discrete-time LTI system is that its

frequency response is always a periodic function with period 2.• Thus, we can specify the frequency response over the range :

- < w <

Conjugate Symmetry of H(w)

• Because H(w) is complex it has conjugate symmetry in its magnitude and phase response. Such that :

• As a result the frequency response is often shown over 0 < w < because the –ve frequency region can be constructed from symmetry.

symmetry ODD has Phase )wH(∠- = )wH(-∠

symmetry EVEN has Magnitude |)wH(| = |)wH(-|

… (4.8)

Graphical Representation of Frequency Response

• Two important points about the ‘frequency response’

1) In general, sinusoids of different frequencies are treated differently by the system. (Hence, the frequency response usually varies with frequency ).

2) By appropriate choice of filter co-efficients, bk, a wide variety of frequency response shapes can be realised.

• We plot H(w) vs. w to visualise the variation of the frequency response.

• We’ll now examine H(w) vs. w plots for the :

i) ‘ Delay system ’. ii) ‘ First difference system ’ ( = ‘ Simple high-pass filter ’). iii) ’ Simple low-pass filter ’ system.

The Delay System• The delay system for an FIR filter is given by (2.7) :

y[n] = x[n – n0]

• It has one none zero co-efficient bn0= 1 and has frequency response :

• Thus, y[n] will have its magnitude response x 1 for all frequencies.• And y[n] will have its phase = -wn0. (Thus, the phase response will be linear with a slope –n0). (Hence, all FIR filters are known as ‘ Linear-phase ’ filters.)

w-jn0e.1=)wH(… (4.9)

w-2=)wH(∠

1 = |)wH(| ∴

re=z (1.5), From

e=)wH( Thus,j

ˆ-j2

θ

w

Example 5 : Plot the phase response for an n0= 2 delay system.