Eegr signal and system project

Eegr signal and system project

Description

 

 

Unformatted Attachment Preview

Project 2 Morgan State University Department of Electrical and Computer Engineering EEGR 451 – DSP – Spring 2019 FIR Filtering Instructions: In this project, all the problems must be answered using MATLAB. Work with your assigned partner. Clearly label the axes for all plotted signals. Your report should include a title page, problem statement, results clearly presented and a short ‘Conclusion’ section, with MATLAB code provided in the Appendix. A sample code for the second part of this project is given. Your assignment involves identifying and discussing the filter impulse response, the filter order, the input samples, the use of the sampling frequency in the code and other involved frequencies as well as the output samples. Submit the report for Project 2 on Friday, April 26, 2019. ======== Exercise 1: Filtering a random signal by direct convolution Write a MATLAB program to (a) Generate a random input signal of 50 samples whose amplitude is uniformly distributed between -4 and 5; (b) Process the input signal by direct convolution using the following filter impulse response: h(n) = {1/8, 1/4, 1/4, 1/4, 1/8} (c) Plot the input and output signals on the same graph and explain what the filtering effect is. Exercise 2: Filtering a multi-frequency signal Let’s consider the following analog signal x(t) = 0.3sin(4000πt)+sin(10000πt)+0.4sin(16000πt) Write a MATLAB program to (a) Sample the analog signal at 60 kHz for a duration of 10 msec. (b) Process the input signal using the given filter impulse response h in the given code. (c) Plot the input and output signals (as function of time) on the same figure using the stem and plot functions. Sample Code % Finite Impulse Response (FIR) filter % f1 = 2000; f2 = 5000; f3 = 8000; fs = 60000; t = [0:1/fs:6e-3]; %duration with sampling period x = 0.3*sin(2*pi*f1*t)+sin(2*pi*f2*t)+0.4*sin(2*pi*f3*t); %input signal N = 303; M = 151; for n = 0:N-1 if n == 151 h = 0.2094; else h = (sin(0.5760*pi*(n-M))-sin(0.3665*pi*(n-M)))./pi*(n-M); end end w = conv(x,h) figure(1); stem(t,x,’r’,’Linewidth’,1); hold on; plot(t,x,’k’,’Linewidth’,1); title(‘Sampled analog signal at 60 kHz without Filter’); figure(2); stem(t,w,’r’,’Linewidth’,1); hold on; plot(t,w,’k’,’Linewidth’,1); title(‘Sampled analog signal at 60 kHz with Filter’);
Purchase answer to see full attachment

Explanation & Answer:

1 Task