Question
consider the signal using matlab

Problem 2: Consider a signal: x[n] 3cos(n7/3) + 2sin(nt/4)+ cos(n7/5) Using Matlab, (1) Plot this signal in time domain. Can
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB CODE

clc
clear all;
n=0:1:1000; %Time vector of 1 sec
x=3*cos(pi*n./3)+5*cos(n*pi./4)+cos(n*pi./5);
Fs=250000;% Sampling frequency
nfft=1024; % length of fft
X=fft(x,nfft); %fft calculation
X=X(1:nfft/2);
mx=abs(X); % magnitude response
f=(0:nfft/2-1)*Fs/nfft; % frequency vector
figure(1)
stem(x); %signal plot
xlim([0 1000]); % X axis limit
title('Given Signal')
xlabel('n')
ylabel('Amplitude')
figure(2)
plot(f,mx,'r')
title('Spectrum of sine wave')
xlabel('Frequency')
ylabel('Amplitude')

PLOTS

ै2 G G है 8 G- G G G- G- G G G G G- G Amplitude

Spectrum of sine wave 3000 2500 2000 1500 1000 500 6 8 10 12 14 Frequency x 10 Amplitude

Add a comment
Know the answer?
Add Answer to:
consider the signal using matlab Problem 2: Consider a signal: x[n] 3cos(n7/3) + 2sin(nt/4)+ cos(n7/5) Using...
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