- #1
amaresh92
- 163
- 0
greetings,
i have typed some code in MATLAB to find the 5 point fft of cos function of frequency 100hz but in answer i am not geting the answer at 100 hz.may i know where the things going wrong. the code is as this one
clc;
t=0:1/4:1;
x=cos(2*pi*100*t);
xm=abs(fft(x));
disp(xm)
p=0:length(xm)-1;
subplot(2,2,1);
stem(100*p,xm);
the answer is
5 0 0 0 0
thanks in advance
i have typed some code in MATLAB to find the 5 point fft of cos function of frequency 100hz but in answer i am not geting the answer at 100 hz.may i know where the things going wrong. the code is as this one
clc;
t=0:1/4:1;
x=cos(2*pi*100*t);
xm=abs(fft(x));
disp(xm)
p=0:length(xm)-1;
subplot(2,2,1);
stem(100*p,xm);
the answer is
5 0 0 0 0
thanks in advance