声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2267|回复: 5

[HHT] 急求HHT运行的EMD分解出的图没有坐标显示?

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

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

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

x
本帖最后由 zt861217 于 2011-4-14 16:26 编辑

以下是HHT程序,用到的txt文件在附件里。求各位高手给想想办法,我是新手,还有急用。 g2044.25.txt (61.87 KB, 下载次数: 7)
% EMD_FMSIN.M
%
% P. Flandrin, Mar. 13, 2003 - modified Mar. 2, 2006
%
% computes and displays EMD for the sum of 2 sinusoidal
% FM's + 1 Gaussian logon
%
% displays reassigned spectrograms of the sum signal and of untitled.jpg
% the 3 first modes extracted
%
% produces Figure 1 in
%
% G. Rilling, P. Flandrin and P. Gon峚lv弒
% "On Empirical Mode Decomposition and its algorithms"
% IEEE-EURASIP Workshop on Nonlinear Signal and Image Processing
% NSIP-03, Grado (I), June 2003
clear;
NN=660;
%fid=fopen('g2204.375.txt','rt');
%fid=fopen('2174.5.TXT','rt');%泥岩
%fid=fopen('2174.75.txt','rt');%泥岩
%fid=fopen('2174.625.txt','rt');%泥岩
%fid=fopen('2270.TXT','rt');%油水层
%fid=fopen('2270.125.txt','rt');%油水层
%fid=fopen('2270.25.txt','rt');%油水层
%fid=fopen('s2176.875.txt','rt');
fid=fopen('g2204.25.txt','rt');
%NN=360;
%fid=fopen('460.txt','rt');
%%fid=fopen('495a.txt','rt');
%fid=fopen('Test_520ab.txt','rt');
%fid=fopen('Test_600.txt','rt');
%fid=fopen('Test_605.txt','rt');
%fid=fopen('670.txt','rt');
%fid=fopen('842.txt','rt');
%fid=fopen('1000.txt','rt');
%fid=fopen('1140.txt','rt');
x=fscanf(fid,'%d',NN);
fclose(fid);
x=x-x(1);
T = 1:1:NN;
t = 1:NN;
%N = 2000;% # of data samples
%p = N/2;% period of the 2 sinusoidal FM's
% sinusoidal FM 1
%fmin1 = 1/64;% min frequency
%fmax1 = 1.5*1/8;% max frequency
%x1 = fmsin(N,fmin1,fmax1,p,N/2,fmax1);
% sinusoidal FM 1
%fmin2 = 1/32;% min frequency
%fmax2 = 1.5*1/4;% max frequency
%x2 = fmsin(N,fmin2,fmax2,p,N/2,fmax2);
% logon
%f0 = 1.5*1/16;% center frequency
%x3 = amgauss(N,N/2,N/8).*fmconst(N,f0);
%a1 = 1;
%a2 = 1;
%a3 = 1;
%x = real(a1*x1+a2*x2+a3*x3);
%x = x/max(abs(x));
[imf,ort,nbits] = emd(x); % <-------- adapted to current emd.m
% 可以在这里进行滤波
%imf(6,:)=0;
%imf(5,:)=0;
%imf(4,:)=0;
%imf(3,:)=0;
%imf(2,:)=0;
%imf(1,:)=0;
%[Nimf,Mimf]=size(imf);
%imf(Nimf-4,:)=0;
%imf(Nimf-3,:)=0;
%imf(Nimf-2,:)=0;
%imf(Nimf-1,:)=0;
%imf(Nimf,:)=0;

emd_visu(x,t,imf,1);
figure(1)
%[A,f,tt] = hhspectrum(imf,t,l,aff)
[A,f,tt] = hhspectrum(imf,t,2);
    %SUCCESS3=XLSWRITE('HHT_IF.xls',f');
%[im,tt] = toimage(A,f,t,splx,sply)
splx = 178;
% number of columns of the output im (time resolution).
% If different from length(t), works only for uniform sampling.
sply = 178;
% number of rows of the output im (frequency resolution).
[im,Ttt] = toimage(A,f,tt,splx,sply);
disp_hhs(im,Ttt);
DeltaFF = 2* pi * 12 / 1000.;
BB=sum(im');
BBA = sum(BB);
BB = (BB / BBA);
[Nbb,Mbb]=size(BB);
%h = SIZEOF(BB)
ABBA = 0;
for i = (Mbb-28):-1:(Mbb-50)
    ABBA = ABBA + BB(i);
end
ABBA
figure;
plot(Ttt*DeltaFF,fliplr(BB)');
%plot(fliplr(BB)');
%axis([0 sply*4*pi*12/1000 0 max(BB)])
xlabel('频率 / kHz')
%xlabel('时间 / us')
ylabel(['幅值'])
%ylabel(['HHT的瞬时能量'])
title('Hilbert边际谱')
%title('Hilbert瞬时能量谱')
imm = im.^2;
AAA = sum(imm);
AAB = sum(AAA);
AAA =( AAA / AAB);
%h = SIZEOF(AAA)
figure;
plot(Ttt*12,(AAA)');
%xlabel('频率 / kHz')
xlabel('时间 / μs')
%ylabel(['幅值'])
ylabel(['HHT的瞬时能量'])
%title('Hilbert边际谱')
title('Hilbert瞬时能量谱')
AAAA = sum(imm');
AAAB = sum(AAAA);
AAAA =( AAAA / AAAB);
figure;
%h = SIZEOF(AAAA)
%xxmin = 0;
%xxmax = Ttt*DeltaFF;
%yymin = 0;
%yymax = 20000000;
plot(Ttt*DeltaFF,fliplr(AAAA)');
%plot(Ttt,fliplr(AAAA)')
%axis([xxmin xxmax yymin yymax])
xlabel('频率 / kHz')
%xlabel('时间 / us')
ylabel(['能量'])
%ylabel(['HHT的瞬时能量'])
%title('Hilbert边际谱')
title('Hilbert能量谱')
clear


本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2011-4-14 16:49 | 显示全部楼层
我才是新手,都不知道HHT怎么用MATLAB实现
发表于 2011-5-8 12:13 | 显示全部楼层
我的也没有坐标  急求
发表于 2011-5-8 14:42 | 显示全部楼层
这个要坐标自己加一下就行了,跟初始的振动信号坐标一样
用axis自己加到EMD文件里去
不过这没什么意思
加了之后图出来就不好看了
看个趋势就够了

评分

1

查看全部评分

发表于 2012-9-20 20:43 | 显示全部楼层
看看怎么实现!
发表于 2013-4-7 14:47 | 显示全部楼层
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-12-25 11:02 , Processed in 0.101308 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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