Computation of Frequency Response Curves, use MATHLAB

to solve the problems you must use MATHLAB and while writing the codes you must add comments to explain the steps that were taken.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

you must write a report to answer the questions and explain everything.

EEEN30160: Matlab Exercise week 6
General Guidelines:
• Remember to put your Student Number on the report
• Remember to put the name of your partner in the report
• Remember to label (both x and y axes) your graphs. In the labels put also the
measurement unit in parenthesis (e.g. seconds or samples for time axes). For arbitrary
signals use (A.U.), meaning Arbitrary Units, as measurement unit. Points will be subtracted
from the score of each exercise for any missing label.
• COMMENT YOUR CODE. A perfect code with no comments will count for half of the points
assigned to the exercise.
• Each exercise is worth the same number of points
Z-transform and filter transfer functions
Computation of Frequency Response Curves:
The MATLAB command freqz can be used to compute the frequency response function H(e jω) from a
z-domain transfer function H(z) for any desired set of values of the frequency variable ω. Here, ω has
the units rad/sample and is a normalized frequency such that 2 corresponds to the sample rate,
whatever that happens to be. Once H(e jω ) is determined, the magnitude and phase plots can be
computed and plotted using matlab functions abs and angle. Poles and zeros can be computed by
using several MATLAB functions including zplane, tf2zpk, and roots. We will try out these things in
this lab.
As we saw in lectures, Z-domain transfer functions come in the form
Note that the denominator polynomial coefficient vector should always start with 1, which you can
think of as a0.
Look up the help on freqz (and of all the functions you are using) in MATLAB to make sure you
construct the inputs correctly. It outputs the transfer function H, whose magnitude (abs) and phase
(angle) can then be plotted.
Problem 1: Consider the discrete-time system with transfer function:
y(n) = x(n) + ¼x(n-1) – ¼x(n-2) +y(n-1)-2y(n-2)
a) Estimate the parameters b and a from the formula. Be particularly careful with the signs of the a
parameters. It is worth remembering that:
And
Obtain the poles and zeros for this system by using ‘tf2zpk’. Look up the help to find out how to use
these functions. Plot the poles and zeros in the z-plane using ‘zplane’. In defining the numerator and
denominator coefficients, be careful to get the orders right, and consult lecture 6 to recap on how
difference-equation representations translate to z-domain transfer functions!
b) Is the system stable? Explain your answer.
c) generate a signal x as a vector of 1000 random samples (use the function rand) and filter the
signal using the LTI system. Use the function filtfilt (see the help for understanding how to put the
inputs). Plot the original and filtered signals. Can you explain what you see?
Problem 2: Consider the following transfer function
y(n) = x(n) + 0.6x(n-1) – 0.4x(n-2) + 0.4y(n-1) – 0.2y(n-2)
a) Check if the filter is stable.
b) Calculate H(z) using freqz. For this calculation, you can use N = 100 points in the inputs of freqz.
Plot the frequency and phase response of the filter.
c) What type of system is this: lowpass, highpass, bandpass, or bandstop? Explain your answer.
d) generate a signal x as a vector of 1000 random samples (use the function rand) and filter the
signal using the LTI system. Use the function filtfilt. Plot the original and filtered signals. Can you
explain what you see?
Problem 3:
a) Generate a 10th order low-pass FIR filter with a cut-off frequency of pi/2 (or one quarter of the
sampling rate). The function to use is fir1 (check the help).
b) Generate a 3rd order low-pass IIR butterworth filter (function butter) with the same cut off
frequency.
c) Plot, on the same plot, the absolute value of H for both filters (again, N = 100) and, on another
plot, the phase of H for both filters. Explain what you see.
Upload your report including all plots and WELL-COMMENTED code to
blackboard by next Thursday’s class.

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER