lecture 2 matlab exercise presenter : lee-kang lester liu instructor : prof. truong nguyen

22
Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Upload: blaine-biscoe

Post on 01-Apr-2015

231 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Lecture 2 Matlab Exercise

Presenter : Lee-Kang Lester LiuInstructor : Prof. Truong Nguyen

Page 2: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M3.3(b)

M3.3(b) : Determine and plot the real and imaginary parts and the magnitude and phase spectrum of the following DTFT.

X

Page 3: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M3.3(b)

M3.3(b) : Determine and plot the real and imaginary parts and the magnitude and phase spectrum of the following DTFT.

X

After seeing the magnitude and phase spectrum, what are its corresponding poles and zeros. !!

Page 4: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M3.3(b)

M3.3(b) : Determine and plot the real and imaginary parts and the magnitude and phase spectrum of the following DTFT.

X

Z=roots([1 0.1885 -0.1885 -1]);P=roots([1 0.7856 1.4654 -0.2346]);Figure; zplane(Z,P);

Page 5: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Question ?

Page 6: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.4

M4.4: Write a MATLAB program to compute the group delay using the expression of Problem 4.77 at prescribed set of discrete frequencies.

P4.77:Show that the group delay of a LTI discrete-time system characterized by a frequency response can be expressed as,

Page 7: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.4

M4.4: Write a MATLAB program to compute the group delay using the expression of Problem 4.77 at prescribed set of discrete frequencies.

Suppose we have a system , we can rewrite the frequency response as

Second, the definition of group delay, , is

Page 8: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.4

Hence,

Page 9: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.4

The definition of group delay, , is

Hence,

Page 10: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.4

Given a system Using provided equation to find its group delay,

Page 11: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.4

The definition of group delay, , is

Given a system Using provided equation to find its group delay,

Page 12: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Question ?

Page 13: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.5

M4.5: Write a MATLAB program to simulate the filter designed in Problem 4.69, and verify its filtering operation.

P4.69:A FIR filter of length 3 is defined by a symmetric impulse response, i.e., Let the input to this filter be a sum of two cosine sequences of angular frequencies 0.2 rad/sample and 0.5 rad/samples, respectively. Determine the impulse response coefficients so that the filter passes only the high-frequency component of the input.

Page 14: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.5

P4.69:A FIR filter of length 3 is defined by a symmetric impulse response, i.e., Let the input to this filter be a sum of two cosine sequences of angular frequencies 0.2 rad/sample and 0.5 rad/samples, respectively. Determine the impulse response coefficients so that the filter passes only the high-frequency component of the input.

n0 1 2

h [0 ]h [1 ]h [2 ]

= = = + =

Page 15: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.5

P4.69:A FIR filter of length 3 is defined by a symmetric impulse response, i.e., Let the input to this filter be a sum of two cosine sequences of angular frequencies 0.2 rad/sample and 0.5 rad/samples, respectively. Determine the impulse response coefficients so that the filter passes only the high-frequency component of the input.

n0 1 2

h [0 ]h [1 ]h [2 ]

=

Given that and

=

=

Page 16: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.5

P4.69:A FIR filter of length 3 is defined by a symmetric impulse response, i.e., Let the input to this filter be a sum of two cosine sequences of angular frequencies 0.2 rad/sample and 0.5 rad/samples, respectively. Determine the impulse response coefficients so that the filter passes only the high-frequency component of the input.

n0 1 2

h [0 ]h [1 ]h [2 ]

=

=

h [0 ]=h [2 ]=−4.8788h [1 ]=9.5631

Page 17: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Question ?

Page 18: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.6

M4.6: Write a MATLAB program to simulate the filter designed in Problem 4.72, and verify its filtering operation.

P4.72:Consider an FIR filter of length 5 with a symmetric impulse response, i.e., An input consisting of a sum of three cosine sequences of angular frequencies: 0.3 rad/samples, 0.4 rad/samples, and 0.7 rad/samples, respectively, is applied to this filter. Determine the impulse response coefficients so that the filter passes only the mid-frequency component of the input.

Page 19: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.6

P4.72:Consider an FIR filter of length 5 with a symmetric impulse response, i.e., An input consisting of a sum of three cosine sequences of angular frequencies: 0.3 rad/samples, 0.4 rad/samples, and 0.7 rad/samples, respectively, is applied to this filter. Determine the impulse response coefficients so that the filter passes only the mid-frequency component of the input.

n0 1 2 3 4

h [0 ]h [1 ]h [2 ]h [3 ]h [ 4 ]

,

Page 20: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.6

P4.72:Consider an FIR filter of length 5 with a symmetric impulse response, i.e., An input consisting of a sum of three cosine sequences of angular frequencies: 0.3 rad/samples, 0.4 rad/samples, and 0.7 rad/samples, respectively, is applied to this filter. Determine the impulse response coefficients so that the filter passes only the mid-frequency component of the input.

= = = + =

Page 21: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.6

P4.72:Consider an FIR filter of length 5 with a symmetric impulse response, i.e., An input consisting of a sum of three cosine sequences of angular frequencies: 0.3 rad/samples, 0.4 rad/samples, and 0.7 rad/samples, respectively, is applied to this filter. Determine the impulse response coefficients so that the filter passes only the mid-frequency component of the input.

-229.8416

Page 22: Lecture 2 Matlab Exercise Presenter : Lee-Kang Lester Liu Instructor : Prof. Truong Nguyen

Problem M4.6

P4.72:Consider an FIR filter of length 5 with a symmetric impulse response, i.e., An input consisting of a sum of three cosine sequences of angular frequencies: 0.3 rad/samples, 0.4 rad/samples, and 0.7 rad/samples, respectively, is applied to this filter. Determine the impulse response coefficients so that the filter passes only the mid-frequency component of the input.