Sale!

# EEL 3135– Lab #05 solution

\$30.00

Full Name:
EEL 3135– Lab #05
Question #1: (Frequency Response of Filters)
with the corresponding descriptions. This is designed to show you how to visualize the frequency
response of FIR filters in MATLAB.
comments. You will use elements of this MATLAB code for the rest of the lab assignment. Submit
only a single published PDF file that contains both your code and the results.
Question #2: (Frequency Filtering)

Category:

## Description

Full Name:
EEL 3135– Lab #05
Question #1: (Frequency Response of Filters)
with the corresponding descriptions. This is designed to show you how to visualize the frequency
response of FIR filters in MATLAB.
comments. You will use elements of this MATLAB code for the rest of the lab assignment. Submit
only a single published PDF file that contains both your code and the results.
Question #2: (Frequency Filtering)
This question will study a low-pass filter in the frequency domain and apply it to a sum of sinusoids
signal. You will compare this result with the convolution in the time domain. Add all code into
skeleton eel3135_lab05_skeleton.m from Canvas. Include all code (and functions) in this
one file so that everything is published to a single PDF.
(a) Create a new function H = FreqResponse(b,w) that outputs the following frequency
response of an FIR system:
H(e
jwb
) = X
M
k=0
bke
−jwkb
.
where the input b is a vector of filter coefficients, input w is a vector of angular frequencies,
and output H is the complex-valued frequency response. Include this function at the end of
the skeleton file.
(b) Let the filter coefficients be {bk} = {1, 2, 1}, generate the frequency response using the function FreqResponse. Plot the magnitude and phase responses. Use Question #1 as a guide.
(c) Given the following input signal:
x[n] = 1 + cos((π/3)n) + cos((9π/10)n + π/2).
Use FreqResponse to determine the frequency response at ˆw = 0, ˆw = π/3, and ˆw = 9π/10.
Use the disp function to display each result.
(d) Compute the output signal y[n] based on the input signal and the result in part (c). Use
subplot and stem to plot x[n] and y[n] side-by-side for a range of n containing 1 fundamental period of x[n]. Label the horizontal axis “Samples” and vertical axis “x[n]” or “y[n]”.
(e) Using the conv function, compute the convolution between the input signal x[n] (for a
range of n containing 1 fundamental period) and coefficients {bk}. Call this result z[n]. Use
subplot and stem to plot x[n] and z[n] side-by-side for a range of n containing 1 fundamental period of x[n]. Label the horizontal axis “Samples” and vertical axis “x[n]” or “z[n]”.
differences.
1
Question #3: (Audio Filtering)
In this problem, we will apply filters to audio signal jingle11k.wav. The audio file is produced
by The Underscore Orkestra (https://freemusicarchive.org/music/The Underscor
3.0.
(a) For the filter coefficients
a = [1/9, 1/9, 1/9, 1/9, 1/9, 1/9, 1/9, 1/9, 1/9];
compute the filter’s frequency response with FreqResponse to get output Ha. Plot the
magnitude and phase responses of Ha.
(b) Use soundsc to play the input x in the skeleton code. Apply the filter a on x with conv
and store the result in xa. Play xa with soundsc.
Relate this difference to the filter magnitude response.
(c) For filter coefficients
b = [1, 0, -4, 0, 6, 0, -4, 0, 1];
compute the filter’s frequency response with FreqResponse to get the output Hb. Plot the
magnitude and phase responses of Hb.