声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 7601|回复: 31

[HHT] HHT仿真实例分析(含结果)

  [复制链接]
发表于 2011-10-25 15:27 | 显示全部楼层 |阅读模式

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

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

x
本人针对www.ilovematlab.cn论坛中楼主cwjy的原创“【原创】用希尔伯特黄变换(HHT)求时频谱和边际谱”(见http://www.ilovematlab.cn/thread-65516-1-1.html),进行了验证。
结果有两个问题,等待牛人解答!
1问:此处的瞬时频率怎么和楼主的不一样啊,有知道的可以告诉我?

2问:但是,图9将坐标变换以后,频率就不是10Hz了,Why

HHT仿真实例.doc (262 KB, 下载次数: 267)
hhtfenxi2.txt (5.21 KB, 下载次数: 125)

评分

1

查看全部评分

回复
分享到:

使用道具 举报

发表于 2011-10-28 16:56 | 显示全部楼层
回复 1 # zhangshun5233 的帖子

那个把纵坐标10^4乘上以后看着和那个很像啊。
放大十倍后是不是把端点效应放大了啊?那个2000HZ处是什么啊?

评分

1

查看全部评分

发表于 2011-10-29 06:57 | 显示全部楼层
我做的过程中,发现也有这个问题,我还以为是个例,现在看来不是的。明天我把我的结果和你的比较下,看看是不是那边的那个搞错了。

评分

1

查看全部评分

 楼主| 发表于 2011-10-30 13:33 | 显示全部楼层
回复 5 # 李清志 的帖子

我们的信号是时间有限的连续周期信号,计算机处理时将连续信号离散化,得到有限时间点的离散周期信号,因而其傅里叶变换是连续周期信号;2000Hz的那个地方,即是与前面的,是关于中心频率对称的。

评分

1

查看全部评分

 楼主| 发表于 2011-11-1 17:35 | 显示全部楼层
本帖最后由 zhangshun5233 于 2011-11-1 17:39 编辑

回复 6 # guochaoxxl 的帖子

搞明白了没?
我还是没有明白为什么,但是可以用别的命令来实现同样的功能,即axis,这样做axis[1 100 1 3000],就可以看的很清楚了!
发表于 2011-12-24 16:37 | 显示全部楼层
回复 1 # zhangshun5233 的帖子

我重新对着写了个程序,但是hhspectrum这个函数总是出现这样的情况:Undefined function or method 'instfreq' for input arguments of type
'double'.

Error in ==> hhspectrum at 79
  f(i,:)=instfreq(an(i,:)',tt,l)';

Error in ==> b03 at 72
[A,fa,tt]=hhspectrum(c);
这是怎么回事啊?我安装了EMD工具包了啊?求速回!!!
发表于 2011-12-26 21:04 | 显示全部楼层
做的过程中,发现也有这个问题,我还以为是个例,现在看来不是的。明天我把我的结果和你的比较下,看看是不是那边的那个搞错了。
发表于 2011-12-28 15:41 | 显示全部楼层
回复 6 # 李清志 的帖子

少了个instfreq函数,package emd包里有

评分

1

查看全部评分

发表于 2011-12-28 21:48 | 显示全部楼层
学海无涯,何处是边?
发表于 2011-12-29 19:22 | 显示全部楼层
回复 8 # jameslan 的帖子

我安了那个包啊。还是不行啊。
发表于 2011-12-29 19:22 | 显示全部楼层
回复 7 # huhongping 的帖子

谢谢啊!
发表于 2011-12-29 20:07 | 显示全部楼层

instfreq函数 保存成*.m文件

function [fnormhat,t]=instfreq(x,t,L,trace)
%INSTFREQ Instantaneous frequency estimation.
%        [FNORMHAT,T]=INSTFREQ(X,T,L,TRACE) computes the instantaneous
%        frequency of the analytic signal X at time instant(s) T, using the
%        trapezoidal integration rule.
%        The result FNORMHAT lies between 0.0 and 0.5.
%
%        X : Analytic signal to be analyzed.
%        T : Time instants                (default : 2:length(X)-1).
%        L : If L=1, computes the (normalized) instantaneous frequency
%            of the signal X defined as angle(X(T+1)*conj(X(T-1)) ;
%            if L>1, computes a Maximum Likelihood estimation of the
%            instantaneous frequency of the deterministic part of the signal
%            blurried in a white gaussian noise.
%            L must be an integer               (default : 1).
%        TRACE : if nonzero, the progression of the algorithm is shown
%                                        (default : 0).
%        FNORMHAT : Output (normalized) instantaneous frequency.
%        T : Time instants.
%
%        Examples :
%         x=fmsin(70,0.05,0.35,25); [instf,t]=instfreq(x); plot(t,instf)
%         N=64; SNR=10.0; L=4; t=L+1:N-L; x=fmsin(N,0.05,0.35,40);
%         sig=sigmerge(x,hilbert(randn(N,1)),SNR);
%         plotifl(t,[instfreq(sig,t,L),instfreq(x,t)]); grid;
%         title ('theoretical and estimated instantaneous frequencies');
%
%        See also  KAYTTH, SGRPDLAY.

%        F. Auger, March 1994, July 1995.
%        Copyright (c) 1996 by CNRS (France).
%
%        ------------------- CONFIDENTIAL PROGRAM --------------------
%        This program can not be used without the authorization of its
%        author(s). For any comment or bug report, please send e-mail to
%        f.auger@ieee.org

if (nargin == 0),
error('At least one parameter required');
end;
[xrow,xcol] = size(x);
if (xcol~=1),
error('X must have only one column');
end

if (nargin == 1),
t=2:xrow-1; L=1; trace=0.0;
elseif (nargin == 2),
L = 1; trace=0.0;
elseif (nargin == 3),
trace=0.0;
end;

if L<1,
error('L must be >=1');
end
[trow,tcol] = size(t);
if (trow~=1),
error('T must have only one row');
end;

if (L==1),
if any(t==1)|any(t==xrow),
  error('T can not be equal to 1 neither to the last element of X');
else
  fnormhat=0.5*(angle(-x(t+1).*conj(x(t-1)))+pi)/(2*pi);
end;
else
H=kaytth(L);
if any(t<=L)|any(t+L>xrow),
  error('The relation L<T<=length(X)-L must be satisfied');
else
  for icol=1:tcol,
   if trace, disprog(icol,tcol,10); end;
   ti = t(icol); tau = 0:L;
   R = x(ti+tau).*conj(x(ti-tau));
   M4 = R(2:L+1).*conj(R(1:L));
   
   diff=2e-6;
   tetapred = H * (unwrap(angle(-M4))+pi);
   while tetapred<0.0 , tetapred=tetapred+(2*pi); end;
   while tetapred>2*pi, tetapred=tetapred-(2*pi); end;
   iter = 1;
   while (diff > 1e-6)&(iter<50),
    M4bis=M4 .* exp(-j*2.0*tetapred);
    teta = H * (unwrap(angle(M4bis))+2.0*tetapred);
    while teta<0.0 , teta=(2*pi)+teta; end;
    while teta>2*pi, teta=teta-(2*pi); end;
    diff=abs(teta-tetapred);
    tetapred=teta; iter=iter+1;
   end;
   fnormhat(icol,1)=teta/(2*pi);
  end;
end;
end;

评分

1

查看全部评分

发表于 2011-12-30 10:36 | 显示全部楼层
回复 12 # jameslan 的帖子

强烈谢谢啊!
发表于 2011-12-31 17:59 | 显示全部楼层
回复 12 # jameslan 的帖子

运行总是出现这个结果是怎么回事啊???? Error using ==> instfreq at 39
At least one parameter required
发表于 2012-1-2 20:39 | 显示全部楼层
本帖最后由 lixiaolong08 于 2012-1-2 20:51 编辑

您好,最后两个图显示不出来,请问为什么:
??? Undefined function or method 'myimage' for input arguments of type 'double'.

Error in ==> wode1220 at 169
myimage(E,'2D');
回复 支持 0 反对 1

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-6 15:28 , Processed in 0.351692 second(s), 30 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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