声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1552|回复: 5

[混合编程] 如何画时频图?

[复制链接]
发表于 2009-6-2 16:52 | 显示全部楼层 |阅读模式

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

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

x
sig=real(amgauss(128).*fmlin(128));
figure(1) ; plot(sig,'LineWidth',2);  xlabel('时间 t'); ylabel('幅值 A');
h=1;
sig=hilbert(sig); [tfr,t,f]=tfrstft(sig,1:128,128,h);
figure(2)
contour(t,f(1:length(f)/2),abs(tfr));  xlabel('时间 t'); ylabel('频率 f');
??? Error using ==> contour at 68
The size of Y must match the size of Z or the number of rows of Z

请问要怎么修改。。。看了置顶帖了,不过还是不明白。。。谢谢了!!!

[ 本帖最后由 ChaChing 于 2009-6-2 17:44 编辑 ]

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2009-6-2 17:36 | 显示全部楼层

回复 楼主 rtbit 的帖子

help contour
and try
pcolor(t,f,abs(tfr));

[ 本帖最后由 ChaChing 于 2009-6-2 17:45 编辑 ]
 楼主| 发表于 2009-6-2 17:56 | 显示全部楼层
谢谢楼上的。不过用contour(t,f,abs(tfr))出的图与需要的图不一样。。。
我有这段程序的结果,但是要用这段程序做其他的,所以想要知道问题出在哪。
发表于 2009-6-2 18:36 | 显示全部楼层
已经有提示了:
??? Error using ==> contour at 68
The size of Y must match the size of Z or the number of rows of Z
说明f(1:length(f)/2)的大小和abs(tfr)的大小不匹配

评分

1

查看全部评分

 楼主| 发表于 2009-6-2 18:58 | 显示全部楼层
谢谢,知道提示什么意思,但是不知道怎么修改。
发表于 2009-6-2 19:19 | 显示全部楼层
contour(Z) draws a contour plot of matrix Z, where Z is interpreted as heights with respect to the x-y plane. Z must be at least a 2-by-2 matrix that contains at least two different values. The number of contour levels and the values of the contour levels are chosen automatically based on the minimum and maximum values of Z. The ranges of the x- and y-axis are [1:n] and [1:m], where [m,n] = size(Z).
例如:
>> z=rand(10,20);
>> contour(1:20,1:10,z)

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-14 02:46 , Processed in 0.074999 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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