声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1020|回复: 1

[HHT] 大家看看这是怎么回事呢?

[复制链接]
发表于 2012-3-29 16:30 | 显示全部楼层 |阅读模式

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

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

x
function imf = emd(x)
% Empiricial Mode Decomposition (Hilbert-Huang Transform)
% imf = emd(x)
% Func : findpeaks

x=transpose(x(:));
imf = [];
while ~ismonotonic(x)
   x1 = x;
   sd = Inf;
   while (sd > 0.1) | ~isimf(x1)
      s1 = getspline(x1);
      s2 = -getspline(-x1);
      x2 = x1-(s1+s2)/2;
      
      sd = sum((x1-x2).^2)/sum(x1.^2);
      x1 = x2;
   end
   
   imf{end+1} = x1;
   x          = x-x1;
end
imf{end+1} = x;

% FUNCTIONS

function u = ismonotonic(x)

u1 = length(findpeaks(x))*length(findpeaks(-x));
if u1 > 0, u = 0;
else,      u = 1; end

function u = isimf(x)

N  = length(x);
u1 = sum(x(1:N-1).*x(2:N) < 0);
u2 = length(findpeaks(x))+length(findpeaks(-x));
if abs(u1-u2) > 1, u = 0;
else,              u = 1; end

function s = getspline(x)

N = length(x);
p = findpeaks(x);
s = spline([0 p N+1],[0 x(p) 0],1:N);


运行之后说x=transpose(x(:));有错误,什么意思呢?
回复
分享到:

使用道具 举报

发表于 2012-5-10 09:19 | 显示全部楼层
我见过这个程序,我也用它算过东西,我在Matlab中试过transpose的用法,好像是把行向量换成列向量,或者是列向量换成行向量,我的数据x一开始就是列向量,所以没有出现那个问题……不知道对你有没有帮助??
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-9-21 12:43 , Processed in 0.057062 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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