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 - The Fusion of Science and Community**

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

Loading...

Similar Threads - function | Date |
---|---|

Mathematics behind Signal and Systems | Mar 14, 2018 |

Magnitude of the transfer function | Dec 5, 2017 |

Testing a Microcontroller with a Function Generator | Nov 16, 2017 |

Exponential forcing function to an RL circuit -- poles & zeros | Oct 22, 2017 |

DC link and rectifier model, Active current as function of voltage? | Sep 5, 2017 |

**Physics Forums - The Fusion of Science and Community**