📄 mm2201.m
字号:
% mm2201.m
N = 128; % choose a power of 2 for speedt = linspace(0,3,N); % time points for function evaluationf = 2*exp(-3*t); % evaluate the function and minimize aliasing: f(3) ~ 0Ts = t(2) - t(1); % the sampling periodWs = 2*pi/Ts; % the sampling frequency in rad/secF = fft(f); % compute the fftFc=fftshift(F)*Ts;
W=Ws*(-N/2:(N/2)-1)/N;
Fa = 2./(3+j*W); % evaluate analytical Fourier transform
plot(W,abs(Fa),W,abs(Fc),'.') % generate plot, 'o' mark fft resultsxlabel('Frequency, Rad/s')ylabel('|F(\omega)|')title('Figure 22.1: Fourier Transform Approximation')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -