查看完整版本: matlab 程式問題
頁: [1]

嗜血成性 發表於 2016-12-11 05:46 PM

matlab 程式問題

http://www13.eyny.com/forum.php?mod=image&aid=116888966&size=300x300&key=6c1349b145c15232185827e91cffbf6b&nocache=yes&type=fixnone
這是我們同學打出來的程式碼:
clear;
syms t tr;
x1t=exp(-(t^2));
x2t=2*(heaviside(t+2)-heaviside(t-2));
x3t=int(subs(x1t,tr)*subs(x2t,tr),tr,t-2,t+2);
x1w=fourier(x1t);
x2w=fourier(x2t);
x3w=x1w*x2w;
subplot(3,2,1);ezplot(x1t,[-10,10]);axis([-inf,inf,-inf,inf]);title('x1(t)');
subplot(3,2,2);ezplot(x1w,[-10,10]);axis([-inf,inf,-inf,inf]);title('x1(w)');
subplot(3,2,3);ezplot(x2t,[-10,10]);axis([-inf,inf,-inf,inf]);title('x2(t)');
subplot(3,2,4);ezplot(x2w,[-10,10]);axis([-inf,inf,-inf,inf]);title('x2(w)');
subplot(3,2,5);ezplot(x3t,[-10,10]);axis([-inf,inf,-inf,inf]);title('x3(t)');
subplot(3,2,6);ezplot(x3w,[-10,10]);axis([-inf,inf,-inf,inf]);title('x3(w)');


老師說有問題,有人知道問題出在哪嗎?
...<div class='locked'><em>瀏覽完整內容,請先 <a href='member.php?mod=register'>註冊</a> 或 <a href='javascript:;' onclick="lsSubmit()">登入會員</a></em></div><div></div>

opchta 發表於 2017-2-11 03:11 PM

你們老師說的問題,應該是在這裡:
x3w=x1w*x2w;

因為兩個函數相乘的傅立葉轉換是兩個函數分別做傅立葉轉換後再做摺積(convolution),不是個別做傅立葉轉換後再相乘。
頁: [1]