声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1225|回复: 1

[编程技巧] 伪Wigner-Ville分布前通过带通滤波器

[复制链接]
发表于 2009-3-31 18:01 | 显示全部楼层 |阅读模式

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

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

x
伪Wigner-Ville分布前通过带通滤波器%利用伪Wigner-Ville分布
%采样频率
fs=25000;
%实验信号
n=length(A0); t=1:n; xdata=A0;
%时域波形
figure(1); plot(t/fs,xdata); xlabel('时间 t/n'); ylabel('幅值 A/v');
%带通滤波
wp=2*[1000 1900]/fs; ws=2*[900 2000]/fs; rp=3; rs=30;
[n wn]=buttord(wp,ws,rp,rs); [b,a]=butter(n,wn);
sig2=filter(b,a,xdata);
%计算伪Wigner-Ville分布
sig3=hilbert(sig2); [tfr,t,f]=tfrpwv(sig3(1:1000));
figure(4); contour(t/fs,f(1:1000)*fs,abs(tfr)); xlabel('时间 t/s'); ylabel('频率 f/Hz');

运行结果为:
??? Operands to the || and && operators must be convertible to logical scalar values.
Error in ==> specgraph.contourgroup.schema>LdoDirtyAction at 256
  refresh(h);
Warning: Error occurred while evaluating listener callback.
> In contour at 66
  In wigner at 55

上面如果没有通过带通直接伪Wigner-Ville,可以出图,但说明不了故障特征,现在通过带通滤波在做伪Wigner-Ville,结果报错,请教如何改
带通滤波试用了三种频率,contour(t/fs,f(1:1000)*fs,abs(tfr));用了上2种方法,都不行

[ 本帖最后由 ChaChing 于 2009-3-31 21:43 编辑 ]
回复
分享到:

使用道具 举报

发表于 2009-10-20 17:55 | 显示全部楼层

回复 楼主 tongxiaoxia 的帖子

http://mathforum.org/kb/message. ... 392302&tstart=0
MatLab suport was kind enough to take a look at this problem for me. It
turns out that there is a bug in contourf command for version 7.0.0 R14
of MatLab. The basic problem is that contourf has problems plotting
negative values.

The command to correct the bug is:
contourf('v6',X,Y,Z)
从别处搜到的

评分

1

查看全部评分

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

本版积分规则

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

GMT+8, 2024-6-29 21:43 , Processed in 0.215709 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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