ftt of cosine wave

1 view (last 30 days)
Franco Riggio
Franco Riggio on 26 May 2019
Commented: Walter Roberson on 27 May 2019
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 Comments
Walter Roberson
Walter Roberson on 27 May 2019
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 on 27 May 2019
I seem to recall it is an adjustment needed when converting between continuous and the most common implementations for discrete.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!