且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MATLAB中的快速傅立叶逆变换

更新时间:2022-05-19 22:09:52

我在这里看到很多问题:

I see a number of issues here:

N = 1000;
t0 = 1e-13;
tau = 2*1e-14;
n = [0:t0/40:2*1e-13-t0/40];
f0 = 3*1e8/(150*1e-9);

x = cos(2*pi*f0*n);
x = x.*exp((-(n-t0).^2)./(tau^2));
%  X = abs(fft(x,N));  <-- Not seen this technique before, and why N=1000?
% try something more like:
X = fft(x);

F = [-N/2 : N/2 - 1]/N;
% this is fine to shift and plot the function
Xshifted = fftshift(X);
plot( abs( Xshifted ) )
% now you're taking the inverse of the shifted function, not what you want
% y=ifft(X,80);  also not sure about the 80
y = ifft(X);

figure(3)
plot(n,y)
figure(4)
plot( n, x ); hold on; plot( n, y, 'o' )

这就是我最初看到的全部. HTH!

That's all I see at first. HTH!