Question

(B) Implement Matlab code for each part as described below: i) Define the following signal in time and plot it where Ai 10, A

Using MATLAB, Please read carefully, EXPLAIN CODE AND ANSWERS, DISCUSS RESULTS, I NEED EVERY PART

0 0
Add a comment Improve this question Transcribed image text
Answer #1

clc;close all;clear all;
%plot s(t)
figure(1)
t=0:0.001:0.1
A1=10;A2=3;f1=10;f2=40;
st=(A1*(cos(2*pi*f1*t)))+(A2*(cos(2*pi*f2*t)))
subplot(321)
plot(t,st)
xlabel('t')
ylabel('s(t)')
title('s(t)')

%FFT of s(t)
%Frequency spectrum of S(f)
subplot(322)
Sf=fft(st)
k=0:1:length(t)-1
stem(k,real(Sf),'m')
title('Real(Sf)')
xlabel('k')
ylabel('real(Sf)')

subplot(323)
stem(k,imag(Sf),'g')
title('Imag(Sf)')
xlabel('k')
ylabel('Imag(Sf)')


%Remove high frequency component&perform ifft
Sf(5)=0;Sf(98)=0%Choose lowest amplitude peaks from real(Sf)
G=Sf
g=ifft(G)
subplot(324)
plot(t,g,'b')
title('Recovered signal g(t) by ifft')
xlabel('t')
ylabel('g(t)')

%Frequency spectrum of G(f)
subplot(325)
k=0:1:length(t)-1
stem(k,real(G),'m')
title('Real(Gf)')
xlabel('k')
ylabel('real(Gf)')

subplot(326)
stem(k,imag(G),'g')
title('Imag(Gf)')
xlabel('k')
ylabel('Imag(Gf)')

s(t) Real(Sf) 600 500 s 400 D 300 200 100 10 -5 -10 -15 -100 20 40 60 80 100 0.02 0.04 0.06 0.08 0.1 Recovered signal g(t) by

Add a comment
Know the answer?
Add Answer to:
(B) Implement Matlab code for each part as described below: i) Define the following signal in tim...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT