ftt of cosine wave

1 次查看(过去 30 天)
Franco Riggio
Franco Riggio 2019-5-26
Hello everyone,
I have tried to have the fft from a cosine wave. The form of the final function the place where I must have the delta are correct, but the amplitude of the delta is 10.5. The code is the following:
clc
clear all
close all
N=21;
F0=1/N;
n=[0:N-1];
s=cos(2*pi*F0*n);
S=fft(s);
fs=1/210;
Fs=[0:fs:fs*(21-1)];
stem(Fs,abs(S));
Thank you!
  5 个评论
Walter Roberson
Walter Roberson 2019-5-27
Franco Riggio comments to me,
Thank you, the answer was the correct one! But why do you have to normalize it? Do you have to do it everytime you want to plot it? What do I have to do if I have more than one cosine?
Walter Roberson
Walter Roberson 2019-5-27
I seem to recall it is an adjustment needed when converting between continuous and the most common implementations for discrete.

请先登录,再进行评论。

回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by