Fourier Transform of a function- what is the fourier transform of a pulse?
조회 수: 3 (최근 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에서 Transforms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!