With fs = 8kHz, design a MATLAB program to create a signal consisting of three sin waves and noise as follows:

2 views (last 30 days)
(a) A 1.5 kHz sin wave lasting from t = 0 s to t = 4s; (b) A 1.5 kHz sin wave lasting from t = 1 s to t = 4s; (c) A 2kHz sin wave lasting from t =2s to t=4s ; (d) An AWGN lasting from t=0s to 4s Hear the signal from the speaker
2) Convert the signal to frequency domain with FFT, and plot the amplitude results of FFT
3) Design a FIR filter to get rid of 1.5kHz sin wave and as much as possible AWGN. hear the filtered signal from the speaker, convert the signal to frequency domain with FFT, and plot the amplitude resuls of FFT
4) Try to use windows to reduce the length of hn). Repeat the above operations
So, I`m really needing help in this question. I done question 1 and 2 but number 3 and 4 I`m stuck. My code for this program ins following:
clear all;
fs=8000; fm=1000; fm1=1500; fm2=2000;
t = 0:1/fs:4; t1=[zeros(1,fs) 0:1/fs:3]; t2=[zerps(1,2*fs)0:1/fs:2];
si=sin(2*pi*fm*t); si1=sin(2*pi*fm1*t1); si2=sin(2*pi*fm2*t2);
x = si + si1 + si2;
soundsc(x,fs);
noi = rand(1,length(t));
sinoi = x + noi;
soundsc(sinoi,fs);
e=abs(fft(sinoi));
figure(2);
semilogy (0:fs/length(sinoi):fs*(1-1/length(sinoi)), e);
I stucked in this part and I don`t know how to do letter c and d, if someone know and can spend little time helping I will thanksfull so much!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!