Fourier Transform of a function- what is the fourier transform of a pulse?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
This is in relation to my previous questions. Say instead of using fft over the whole domain, I now want to find the Fourier transform of only a pulse. Here is the code I've got-
%%time domain
dt = 0.0098;
t = 0:dt:5;
tlen = length(t)+1;
A = 1;
F=5;
N=3;
y = A*(1 -cos(2*pi*F*t./N)).*cos(2*pi*F*t).*(t >= 0 & t <= N/F);
L = nnz(y);
figure;
plot(t,y);
%%get frequency
fs = 1/dt; %sampling frequency!
f = fs*(0:(tlen/2))/tlen;
flen = length(f);
%%FT
Y = fft(y);
P1 = abs(Y/L);
P = P1(1:tlen/2+1);
P(2:end-1) = 2*P(2:end-1);
figure;
plot(f,P);
figure; plot(f,P1(1:flen));
Am I right in normalising Y by L (the number of non-zero elements in the signal) instead of by tlen? If I'm not wrong, this will affect the amplitudes of the plots
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!