資源簡介
局部均值分解的MATLAB代碼,可以給定函數(shù),可以用實(shí)測數(shù)據(jù),親測可用
代碼片段和文件信息
clear?all;
clc;
%?給定一仿真信號
fs=2000;
N=2048;
n=0:N-1;
t=n/fs;
x=(1+0.5*t).*sin(2*pi.*20*t)+2*cos(2*pi.*3*t);
%繪制仿真信號和其頻譜圖
figure(1)
subplot(211)
plot(tx)
subplot(212)
y2=x;
L=length(y2);
NFFT?=?2^nextpow2(L);
Y?=?fft(y2NFFT)/L;
f?=?fs/2*linspace(01NFFT/2);
plot(f2*abs(Y(1:NFFT/2)))
%?局域均值分析
x=x‘;
c?=?x‘;
N?=?length(x);
A?=?ones(1N);
PF?=?[];
aii?=?2*A;
while(1)
??si?=?c;
??a?=?1;
??
???while(1)
????h?=?si;
????
??????maxVec?=?[];
??????minVec?=?[];
??????
???%?look?for?max?and?min?point
??????for?i?=?2:?N?-?1
?????????if?h?(i?-?1)??h?(i?+?1)
????????????maxVec?=?[maxVec?i];?
?????????end
?????????if?h?(i?-?1)?>?h?(i)?&?h?(i)?????????????minVec?=?[minVec?i];?
?????????end?????????
??????end
??????
???%?
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????3522??2018-03-18?19:40??LMD,親測可用\LMD.m
?????目錄???????????0??2018-03-18?19:40??LMD,親測可用\
評論
共有 條評論