声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3995|回复: 12

[HHT] HHT三维图的画法遇到的问题

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

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

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

x
我画出的三维图遇到两个问题:有哪位帮忙指点一下。只可惜数据太大,传不上去。
(1)我的频率轴是从1开始,而我想让其从零开始,我改了一下,老报错。有哪位指点一下。谢谢!
(2)边际谱也不对,我要的频率在0到10之间,可是边际谱的频率轴太大,
clear;
fs=20;
N=20000;
load z2
imf=z;
[m,n]=size(imf);
for i=1:m
    subplot(m/2,2,i);
    plot(imf(i,:));   
end
figure(2)
dt=1/fs;
h = nspab(imf',500,0,500,dt);
subplot(211)
surf(h(1:5,50:end-20))
shading interp
xlabel('时间(点数)','FontSize',12);
Ylabel('频率(Hz)','FontSize',12);
zlabel('幅值','FontSize',12);
title('a','FontSize',12)
view([-75,25])
yt=subplot(223)
imagesc(h(1:5,:))
Ylabel('频率(Hz)','FontSize',12);
xlabel('时间(点数)','FontSize',12);
set(yt,'ydir','nor')
title('b','FontSize',12)
ms=mspc(h,10)
subplot(224)
plot((1:length(ms)),ms)
xlabel('频率(Hz)','FontSize',12);
ylabel('幅值','FontSize',12);
title('c','FontSize',12)
未命名.jpg

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

 楼主| 发表于 2009-6-2 08:48 | 显示全部楼层

回复 楼主 大鹏之举 的帖子

有哪位兄弟愿意帮帮忙解决一下上面的问题,有意者,加我QQ297053904,我把数据传给你。帮我看一下。谢谢!

[ 本帖最后由 大鹏之举 于 2009-6-2 08:50 编辑 ]
发表于 2009-11-5 14:13 | 显示全部楼层
怎么没人回答啊,我也正研究呢,好多语句看不太懂啊!谢谢各位指点啊!h = nspab(imf',500,0,500,dt);啥意思呢,好像程序有好多地方有明显错误啊

[ 本帖最后由 nkdtxf 于 2009-11-5 15:20 编辑 ]
发表于 2010-1-17 19:57 | 显示全部楼层
同问啊,一样的效果,一样的问题~~!!
发表于 2010-3-4 21:32 | 显示全部楼层
请问一下楼主,程序中的nspab函数在那里可以找到呢?
发表于 2010-3-5 10:34 | 显示全部楼层
nspab函数的说明如下,你的程序中给出的自变量最后一项dt应该不正确吧,应该是t0和t1
function [h,xs,w] = nspab(data,nyy,minw,maxw,t0,t1)
% The function NSPAB generates a smoothed HHT spectrum of data(n,k)  
% in time-frequency space, where  
% n specifies the length of time series, and
% k is the number of IMF components.
% The frequency-axis range is prefixed.
% Negative frequency sign is reversed.
%
% MATLAB Library function HILBERT is used to calculate the Hilbert transform.
%
% Example, [h,xs,w] = nspab(lod78_p',200,0,0.12,1,3224).
%
% Functions CONTOUR or IMG can be used to view the spectrum,
%    for example contour(xs,w,h) or img(xs,w,h).
%
% Calling sequence-
% [h,xs,w] = nspab(data,nyy,minw,maxw,t0,t1)
%
% Input-
% data - 2-D matrix data(n,k) of IMF components
% nyy - the frequency resolution
% minw - the minimum frequency
% maxw - the maximum frequency
% t0 - the start time
% t1 - the end time
% Output-
% h - 2-D matrix of the HHT spectrum, where
%    the 1st dimension specifies the number of frequencies,
%    the 2nd dimension specifies the number of time values
% xs - vector that specifies the time-axis values
% w - vector that specifies the frequency-axis values

mspc函数说明如下,你定义时f=10,而f应该是个向量,所以绘制不出边际谱
function ms=mspc(x,f)

% The function MSPC calculates a normalized marginal damping spectrum
% of x(k,n), where k specifies the number of frequencies, and
% n is the number of time values.
%
% MSPC can be used after NSP, NSPAB.
% Function PLOT can be used to view the marginal spectrum,
%    for example, plot(f,ms).
%
% Calling sequence-
% ms=mspc(x,f)
%
% Input-
% x - 2-D matrix x(k,n) of the HHT spectrum
% f - vector f(k) that specifies the frequency-axis values
%
% Output-
% ms - vector ms(k) that specifies the marginal spectrum
发表于 2010-5-29 09:58 | 显示全部楼层
请问大哥怎么画三维图啊,跪求

评分

1

查看全部评分

发表于 2010-9-8 17:37 | 显示全部楼层
回复 大鹏之举 的帖子
楼主,你好,看了你的程序感觉不错,呵 你能不能把nspab
这个函数的程序给我传一下,麻烦你一下,非常感谢!我的邮箱 wanghongtao0211@163.com
   
发表于 2010-10-10 16:31 | 显示全部楼层
楼主我也好像要那个nspab函数,能不能提供个附近下载啊,先谢谢了.
发表于 2010-10-11 08:47 | 显示全部楼层
Rilling工具箱里是不是没有nspab这个函数啊?
发表于 2010-10-11 14:38 | 显示全部楼层
回复 blackiris 的帖子

检查下
which instfreq -all
发表于 2013-9-22 19:40 | 显示全部楼层
刚来学习学习
发表于 2014-9-15 10:48 | 显示全部楼层
新手路过 运行中出现了错误
>> h = nspab(IMF',500,0,500,dt)
Out of memory. Type HELP MEMORY for your options.

Error in nspab (line 49)
h1=zeros(npt-1,nyy+1);
查看了说明 还是不知道怎么改 请各位指条明路
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-18 14:30 , Processed in 0.107187 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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