Create the signal x(t) = 1 + sin(2 pi 100 t) + 3 cos(2 pi 200t) + cos(2 pi 500t)
ID: 2084877 • Letter: C
Question
Create the signal x(t) = 1 + sin(2 pi 100 t) + 3 cos(2 pi 200t) + cos(2 pi 500t) in Matlab using sampling period of Ts = 0.1 ms and 2048 samples. Using fdatool a) Design a filter and apply to the signal to suppress 200Hz and 500Hz components of the signal. Sketch the magnitude and phase responses of the filter. Plot FFT of both the original signal and the filtered signal commenting on the effect of the filter. b) Design a filter and apply to the signal to suppress DC component and 100Hz components of the signal. Sketch the magnitude and phase responses of the filter. Plot FFT of both the original signal and the filtered signal commenting on the effect of the filter. c) Design a filter and apply to the signal to get only 200Hz component of the signal. Sketch the magnitude and phase responses of the filter. Plot FFT of both the original signal and the filtered signal commenting on the effect of the filter. d) Add a noise of normal distribution with variance of 0.5 to the sExplanation / Answer
%FFT with sampling period ts=0.1*10^-3
*************************************
Fs = 2048; % Sampling frequency
Ts = 0.1*10^-3; % Sample time
L = 1000; % Length of signal
t = (0:L-1)*T; % Time vector
% Sum of a 50 Hz sinusoid and a 120 Hz sinusoid
x = 1+sin(2*pi*100*t) + 3*cos(2*pi*200*t)+cos(2*pi*500*t);
y = x + 2*randn(size(t)); % Sinusoids plus noise
plot(Fs*t(1:50),y(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('time (milliseconds)')
*****************************************************