关于EMD分解工程应用问题
LZ最近在学习EMD分解,怎么把我的振动信号应用在在程序上呢clear;clc;clf;data_fname = 'F:\研究生\shuaixian\fenxi\zhujijiashuiping2_3(19-20).bin'; % 这里是文件名
file_id = fopen(data_fname, 'rb');
row_array= fread(file_id,inf,'int16');
f=10000;%采样频率为10kHz
t=1/f;
% 关闭文件
fclose(file_id);
row_array(row_array<0)=bitcmp(abs(row_array(row_array<0)),16);
%标量转换
data=(row_array*10000/65536-5000)/(5*8*9.8);
%中心化
row_array=data-mean(data);
n=length(row_array);
x=0:t:(n-1)*t;
%fft默认计算的信号是从0开始的
z=row_array;
c=emd(z);
%计算每个IMF分量及最后一个剩余分量residual与原始信号的相关性
=size(c);
%画出每个IMF分量及最后一个剩余分量residual的图形
figure(1)
for i=1:m-1
disp(['imf',int2str(i)]) ;disp();
end;
subplot(m+1,1,1)
plot(t,z)
set(gca,'fontname','times New Roman')
set(gca,'fontsize',14.0)
ylabel(['signal','Amplitude'])
for i=1:m-1
subplot(m+1,1,i+1);
set(gcf,'color','w')
plot(t,c(i,:),'k')
set(gca,'fontname','times New Roman')
set(gca,'fontsize',14.0)
ylabel(['imf',int2str(i)])
end
subplot(m+1,1,m+1);
set(gcf,'color','w')
plot(t,c(m,:),'k')
set(gca,'fontname','times New Roman')
set(gca,'fontsize',14.0)
ylabel(['r',int2str(m-1)])
%画出每个IMF分量及剩余分量residual的幅频曲线
figure(2)
subplot(m+1,1,1)
set(gcf,'color','w')
F=fft(z);
f=abs(F);
plot(f,z,'k')
set(gca,'fontname','times New Roman')
set(gca,'fontsize',14.0)
ylabel(['initial signal',int2str(m-1),'Amplitude'])
for i=1:m-1
subplot(m+1,1,i+1);
set(gcf,'color','w')
=fftfenxi(t,c(i,:));
plot(f,z,'k')
set(gca,'fontname','times New Roman')
set(gca,'fontsize',14.0)
ylabel(['imf',int2str(i),'Amplitude'])
end
subplot(m+1,1,m+1);
set(gcf,'color','w')
=fftfenxi(t,c(m,:));
plot(f,z,'k')
set(gca,'fontname','times New Roman')
set(gca,'fontsize',14.0)
ylabel(['r',int2str(m-1),'Amplitude'])
请大神给看看程序有什么问题,不胜感激。小弟QQ:286331577
页:
[1]