Fourier Transform of a function- what is the fourier transform of a pulse?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!