我有以下脚本:
clear all; close all;
syms t w
% I seek the Fourier Transform of following f
f = (heaviside(t+1)-heaviside(t-1))*1 ;
L = 10;
h = ezplot(f,[-L,L]) % plot function of problem
set(h, 'Color','r','LineWidth',4)
grid on
% seek Fourier Transform fw
fw = int(f * exp(-j * w * t),t,-L,L)
fw_s = simplify(fw,'IgnoreAnalyticConstraints',true);
fw = fw_s
%fw = (2 * sin(w))/w ;this is the result of Fourier Transform
%inverse Fourier Transform ft
ft = (1/(2*pi)) * int(fw * exp(j * w * t),w,-L,L)
ft_s = simplify(ft,'IgnoreAnalyticConstraints',true);
ft = ft_s
Matlab的答案如下:
%ft = (5734161139222659*int((exp(t*w*i)*sin(w))/w, w == -10..10))/18014398509481984
如何强制Matlab答案为f = (heaviside(t+1)-heaviside(t-1))*1
,如问题所示。我知道函数ifourier(fw,w,t)
中的构建。但是出于教学目的,我想通过使用原始公式来解决。