Week 7 - Homework_06

.pdf

School

University of Illinois, Urbana Champaign *

*We aren’t endorsed by this school

Course

205

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

2

Uploaded by PrivateStraw7294

Report
BIOE 205 - Sp. 2023 Homework 6 Due: 03/10 By popular request, this homework has more textbook problems. The relevant MATLAB .m/.mat files can be found in a zip archive on Ed: homework6.zip . In all problems, include all your plots and code files. It might help to use MATLAB live scripts. Problem 1 Short time Fourier transform in MATLAB 10 points Load the file ECG 1hr.mat which contains one hour of electrocardiogram signal in the variable ecg . Plot the time-frequency spectra of this signal using the stft approach shown in Exam- ple 4.8 of CSSB. You can find the necessary stft.m file in the archive. Limit the frequency range to 3 Hz and do not include the DC component. Note the sampling frequency is 250 Hz. This is Problem 4.20 of CSSB. Problem 2 System ID in MATLAB 15 points Read Example 5.1 in CSSB carefully. Modify the code to find the maximum length of a pulse that will serve as an impulse to system represented by the MATLAB function, unknown sys hw6.m . Note this system has quite different response characteristics and the maximum pulse width will also be quite different compared to the example. You need to look at complete impulse response to determine the maximum pulse width, but this system is much slower than the one in the example. Therefore, increase the time interval under observation accordingly. Problem 3 Convolution and Fourier transforms 10 points (a) Prove that the convolution operator is commutative: f ( t ) ⋆ g ( t ) = g ( t ) ⋆ f ( t ) (b) Find the inverse Fourier transform of the frequency domain impulse function δ ( ω ). Problem 4 Basic convolution 15 points Use the basic convolution equation (Eq. 5.1) to find the output of a system with an impulse response shown below to a step input with amplitude 3; i.e, x ( t ) = 3 for t > 0. Figure 1: Find the system response. 1
BIOE 205 - Sp. 2023 Homework 6 Due: 03/10 Problem 5 Do Problem 5.11 of CSSB 15 points This problem looks intimidating but can be solved in about 15 lines of MATLAB code (excluding the plotting commands). Make good use of the hints given in the problem: Use a loop to evaluate sinusoids of frequency between 1 Hz to 50 Hz. Make the length of these signals N = 256 so DFT is faster. Use a sampling frequency of f s = 100 Hz. This means the frequency needs to be plotted between [0 , 50] Hz. Make the amplitude of the sine wave 2 so that the RMS value of the input is 1. Problem 6 Moving averages as filters 10 points Load the respiratory signal resp in file resp noise.mat sampled at 125 Hz. Apply a 3-point mov- ing average filter and a 12-point moving average filter. If you use MATLAB’s filter(h, 1, x) command it will produce a filtered signal that is the same length as the input signal. Display the results from the two filters in two plots using subplot. Each plot should compare the unfil- tered signal with one of the filtered signals. Title the plots and offset the filtered signal (by 1.0) for better viewing. Note the improved noise reduction with the 12-point moving average filter. This is Problem 5.13 in CSSB. Problem 7 Phase characteristics 10 points Show both the magnitude and phase spectra of two filters, one a four-point moving average and the other the four-coefficient “Daubechies” filter used in Problem 5 above. Use f s = 200 Hz and adequate padding. Plot phase in degrees and plot only valid points. Use subplot to bring the four plots together. This is Problem 5.14 in CSSB . Problem 8 Mystery filter 15 points Load the MATLAB file filter1.mat , which contains the impulse response, h , of a mystery filter. Also load the signal in cardiac press.mat , which holds one cycle of a cardiac pressure wave in variable c press which is sampled at 200 Hz. Apply the impulse response, h , to the pressure signal using convolution. Plot the cardiac pressure signal before and after filtering on separate plots using subplot. What does this mystery filter do? This is Problem 5.15 in CSSB. 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help