MATLAB:符号表达式,傅里叶逆变换积分

MATLAB:符号表达式,傅里叶逆变换积分,matlab,expression,integral,Matlab,Expression,Integral,我有以下脚本: 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 Tr

我有以下脚本:

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
答案如下:

%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)
。但出于教学目的,我想使用原始公式进行求解。

最好在代码中使用
(1/(2*sym(pi))
,然后得到ft的完全符号解:
ft=int((2*exp(t*w*I)*sin(w))/w,w=-10..10/(2*pi)
%iF=ifourier(fw,w,t)iF=simplify(iF)子批次(3,1,2)h=ezplot(如果,[-L,L])%在网格上绘制问题集(h,'Color','r','LineWidth',4)的函数通过使用内置函数ifourier,我们可以解决该问题。我们可以用原来的公式ft=(1/(2*sym(pi))*int(fw*exp(j*w*t),w,-L,L)得到同样的结果吗?我不理解你的评论。这不是你在问题里写的吗?好的。我感谢你的帮助。谢谢你,丹尼尔。致以最良好的祝愿。最好在代码中使用
(1/(2*sym(pi))
,然后你就可以得到一个完整的ft符号解:
ft=int((2*exp(t*w*i)*sin(w))/w,w==-10..10/(2*pi)
%逆傅里叶变换内置iF=ifourier(fw,w,t)iF=simplify(iF)子批次(3,1,2)h=ezplot(iF,[-L,L])%问题集的绘图函数(h,'Color','r','LineWidth',4)通过使用内置函数ifourier,我们可以解决这个问题。我们可以用原来的公式ft=(1/(2*sym(pi))*int(fw*exp(j*w*t),w,-L,L)得到同样的结果吗?我不理解你的评论。这不是你在问题里写的吗?好的。我感谢你的帮助。谢谢你,丹尼尔。顺致敬意,