Fourier Transform of a function- what is the fourier transform of a pulse?

2 ビュー (過去 30 日間)
Avishek  Mondal
Avishek Mondal 2017 年 12 月 26 日
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 件)

カテゴリ

Help Center および File ExchangeTransforms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by