以下のフーリエ変換を考える。
フーリエ変換
振幅スペクトル
clear; close all; clc; tau = 1; f0=5; dt=0.01; T=1/f0; t=-T/2:dt:T/2; y=f(tau,f0,t); plot(t,y,'DisplayName','original'); hold on; xf = @(f) tau*sinc(2*tau*(f-f0))+tau*sinc(2*tau*(f+f0)); figure(); freq = -10:0.01:10; plot(freq,xf(freq),'DisplayName','FT'); figure(); plot(freq,abs(xf(freq)),'DisplayName','FT'); big; function res=f(tau,f0,t) res = zeros(length(t),1); for idx=1:length(t) ti = t(idx); if abs(ti) <= tau res(idx) = cos(2*pi*f0*ti); else res(idx) = 0; end end end