声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 880|回复: 2

[综合讨论] 数值卷积的问题,请老师帮忙回答一下

[复制链接]
发表于 2010-4-23 10:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
初学matlab,遇到一个数值卷积的问题。f1t=t,f2t=sint. 他们的理论卷积结t-sint 为什么我画出的图两者不一样呢?
t1=0:0.1:10; t2=0:0.1:20;
f1=t1; f2=sin(t1); c=0.1*conv(f1,f2);
subplot(2,2,1); plot(t1,f1)
subplot(2,2,2); plot(t1,f2)
subplot(2,2,3); plot(t2,c);
t3=0:0.1:20; d=t2-sin(t2);
subplot(2,2,4); plot(d)

[ 本帖最后由 ChaChing 于 2010-4-25 15:44 编辑 ]
回复
分享到:

使用道具 举报

发表于 2010-4-25 10:07 | 显示全部楼层
t1=0:0.1:10; t2=0:0.1:20;
f1=t1; f2=sin(t1);% 此处应为t2
c=0.1*conv(f1,f2);
subplot(2,2,1); plot(t1,f1)
subplot(2,2,2); plot(t1,f2)
subplot(2,2,3); plot(t2,c);
t3=0:0.1:20;% 卷积结果范围由t1和t2确定,这个范围也不对,应在[0,30]
d=t2-sin(t2) %此处应为t3 吧
subplot(2,2,4); plot(d)
另外:t和sin(t)的卷积是t-sin(t) ? 楼主确定吗。从我画的图,二者并不一致

评分

1

查看全部评分

 楼主| 发表于 2010-4-26 09:30 | 显示全部楼层
我已经解决了 谢谢楼主的回答!
t1=0:0.1:10;
f1=t1; f2=sin(t1);
n=length(t1);
c=0.1*conv(f1,f2);
subplot(2,2,1); plot(t1,f1)
subplot(2,2,2); plot(t1,f2)
subplot(2,2,3); plot(t1,c(1:n));
d=t1-sin(t1);
subplot(2,2,4); plot(t1,d)%时间两个函数取的一致就行了.

[ 本帖最后由 第七页 于 2010-4-26 09:35 编辑 ]
untitled.jpg
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-21 22:54 , Processed in 0.059841 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表