Task 1
Using the tf command, design an analog low-pass filter with cutoff frequency 8 kHz. You may choose any order of the transfer function you like.
a) Provide the transfer function.
b) Plot the step response of this filter.
c) Plot the Bode frequency response of this filter.
d) Include the MATLAB code.
Task 2
Design a 1st order low-pass filter with cutoff frequency 1kHz, 1) with roll-off and 2) without roll-off. For each filter,
a) Provide the transfer function.
b) Plot the step response of these filters.
c) Plot the Bode frequency response of these filters.
d) Compare the step and frequency responses of these two filters.
e) Include the MATLAB code.
To compare the responses of two filters, use step(SYS1, SYS2) and bode(SYS1, SYS2), and a legend command to distinguish the two lines on a single figure.
Task 3
Design an analog Butterworth low-pass filter of order 5 with cutoff frequency 1kHz. Use the ‘s’ option for the butter command.
a) Provide the transfer function.
b) Plot the step response of this filter.
c) Plot the Bode frequency response of this filter.
d) Compare the step and frequency responses of this filter with the roll-off filter in Task 2.
e) Include the MATLAB code.
Task 4
Build a SIMULINK model to filter a signal x(t) = 2 sin(2π*300Hz) + sin(2π*31.413kHz), for a 0.01-second time interval. Use the Butterworth filter you designed in Task 3.
a) Include screenshot of your SIMULINK block diagram.
b) Include screenshot of the original signal and the filtered signal shown on the scope block.
c) Discuss your observations.
In order to successfully complete this task you will need to change the simulation configuration parameters as shown in the figure below
Notes:
1. Use the SIMULINK sum (under Simulink->Commonly Used Blocks) and transfer function (under Simulink->Continuous) block to simulate the filter. Double click on the transfer function block to change its parameters. It will accept arguments which are variables defined in the workspace, e.g., num1, den1, where [num1,den1] = butter(6,4). Otherwise, you may use the “tfdata” command to extract numerator and denominator polynomials from a transfer function system object.
2. In SIMULINK, to compare two signals, you may use a MUX block and a scope. Make sure that in the scope “parameters” the data history is NOT limited.
Task 5
Design discrete time low-pass filters of order 5 with cutoff frequency 1kHz by
1) using the c2d command to convert the CT filter you designed in Task 3.
2) using the butter command without the ‘s’ option.
Use the 0.01-seccond test signal x(t) defined in Task 4 as the input to the filter. Use lsim command to generate filter response.
a) Use a sampling rate of 100kHz. For each filter 1) and 2), plot their filter response to the input signal x(t) and compare with the continuous time case in Task 3. Discuss your observations.
b) Change the sampling rate to 4kHz and redesign the filter in (2). Plot its filter response to the input signal x(t) and compare with the continuous case once more. Discuss your observations.
c) Include the MATLAB code.