greetings,(adsbygoogle = window.adsbygoogle || []).push({});

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

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Dft of cos function

**Physics Forums | Science Articles, Homework Help, Discussion**