声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1755|回复: 6

[HHT] 将信号乘以采样频率以后出现的结果很奇怪,大家帮帮忙

[复制链接]
发表于 2010-4-7 10:14 | 显示全部楼层 |阅读模式

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

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

x
我是在toimage函数中添加了fs=100.f=f*fs两句,具体为function [im,tt] = toimage(A,f,t,splx,sply)
% [im,tt] = TOIMAGE(A,f,t,splx,sply) transforms a spectrum made
% of 1D functions (e.g., output of "spectreh") in an 2D
% image(求完瞬时频率和瞬时幅值后要用toimage函数把一维频谱转换成二维图输出)
%
% inputs :   - A    : amplitudes of modes (1 mode per row of A)(幅度模值,每一行为一级imf的幅度模值)
%            - f    : instantaneous frequencies(瞬时频率)
%            - t    : time instants (截断时间)
%            - splx : number of columns of the output im (time resolution).
%                     If different from length(t), works only for uniform
%                     sampling.(截断时间的列数,假如相异于t的长度,则计算同一的采样时间?)
%            - sply : number of rows of the output im (frequency
%            resolution).(频率阶段的行数)
% outputs :  - im   : 2D image of the spectrum(2维频谱图)
%            - tt   : time instants in the image(在图中的截断时间)
%
% utilisation : [im,tt] = toimage(A,f);[im,tt] = toimage(A,f,t);[im,tt] = toimage(A,f,sply);
%              [im,tt] = toimage(A,f,splx,sply);[im,tt] = toimage(A,f,t,splx,sply);
DEFSPL = 400;
fs=100;
if nargin < 3
  t = 1:size(A,2);
  sply = DEFSPL;
  splx = length(t);
else
    if length(t) == 1
        tp = t;
        t = 1:size(A,2);
        if nargin < 4
            sply = tp;
            splx = length(t);
        else
            if nargin > 4
                error('too many arguments')
            end
            sply = splx;
            splx = tp;
        end
    else
        lt = length(t);
        if nargin < 5
          sply = splx;
          splx = lt;
        end
        if nargin < 4
          sply = DEFSPL;
          splx = lt;
        end
        
        if nargin > 5
            error('too many arguments')
        end
    end
end
   
%end
lt=length(t);
im=[];
im(splx,sply) = 0;
f=f*fs
for i=1:size(f,1)
  for j = 1:lt
    ff=floor(f(i,j)*2*(sply-1))+1;
    if ff <= sply % in case f(i,j) > 0.5
      im(floor(j*(splx-1)/lt)+1,ff)=im(floor(j*(splx-1)/lt)+1,ff)+A(i,j);
    end
  end  
end
for i = 1:splx
  tt(i) = mean(t(floor((i-1)*lt/(splx))+1:floor(i*lt/(splx))));
end
im=fliplr(im)';
红色处为添加的。
以下是未添加求出的归一化频率与添加后的实际频率图,大家帮我看看,为什么添加以后所求出来的实际的频率就成波浪状的了呢?是我的程序哪里有问题了?还是别的原因呢?以下四图分别是原始信号、emd结果、未改之前结果、改之后结果。
signal.png
emd.png
归一化频率hhspectrum.png
fs与归一化频率积.png
回复
分享到:

使用道具 举报

 楼主| 发表于 2010-4-7 10:16 | 显示全部楼层
上四图中最后一个y轴不应该为normalized frequency,我忘记改过来了,请大家见谅!!
 楼主| 发表于 2010-4-19 20:01 | 显示全部楼层
大家帮忙看看!谢谢
发表于 2010-4-19 20:31 | 显示全部楼层
客观上说你的这个图,效果已经非常的不错了!
发表于 2010-4-19 20:55 | 显示全部楼层
HHT没深入研究过! 仅说说个人看法
别人的副程序少直接修改(何况是高手的), 除非很确定整体流程!
最好的方式应该是从该程序的输出转换成LZ要的东西
还有建议LZ善用编辑功能, 及相似内容尽量发在同一帖
 楼主| 发表于 2010-4-20 07:57 | 显示全部楼层
好的。新手,请大家见谅!!!呵呵呵
发表于 2011-8-17 17:58 | 显示全部楼层
回复 1 # cboboc 的帖子

请教楼主,如何将每一个imf的横纵坐标值都显示出来啊。万分感谢了,急!!!!
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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