导航:首页 > 五金知识 > grillingemd工具箱

grillingemd工具箱

发布时间:2022-05-16 20:11:00

⑴ matlab编的有关EMD去噪的程序,处理的是核磁共振测井信号,急求

function imf = emd(x,n);%%最好把函数名改为emd1之类的,以免和Grilling的emd冲突
%%n为你想得到的IMF的个数
c = x('; % of the input signal (as a row vector)
N = length(x);-
% loop to decompose the input signal into n successive IMFs
imf = []; % Matrix which will contain the successive IMF, and the resiefor t=1:n
% loop on successive IMFs
%-------------------------------------------------------------------------
% inner loop to find each imf
h = c; % at the beginning of the sifting process, h is the signal
SD = 1; % Standard deviation which will be used to stop the sifting process
while SD > 0.3 % while the standard deviation is higher than 0.3 (typical value) %%筛选停止准则
% find local max/min points
d = diff(h); % approximate derivative %%求各点导数
maxmin = []; % to store the optima (min and max without distinction so far)
for i=1:N-2
if d(i)==0 % we are on a zero %%导数为0的点,即”驻点“,但驻点不一定都是极值点,如y=x^3的x=0处
if sign(d(i-1))~=sign(d(i+1)) % it is a maximum %%如果驻点两侧的导数异号(如一边正,一边负),那么该点为极值点
maxmin = [maxmin, i]; %%找到极值点在信号中的坐标(不分极大值和极小值点)
end
elseif sign(d(i))~=sign(d(i+1)) % we are straddling a zero so%%如y=|x|在x=0处是极值点,但该点倒数不存在,所以不能用上面的判
断方法
maxmin = [maxmin, i+1]; % define zero as at i+1 (not i) %%这里提供了另一类极值点的判断方法
end
end
if size(maxmin,2) < 2 % then it is the resie %%判断信号是不是已经符合残余分量定义
break
end
% divide maxmin into maxes and mins %% 分离极大值点和极小值点
if maxmin(1)>maxmin(2) % first one is a max not a min
maxes = maxmin(1:2:length(maxmin));
mins = maxmin(2:2:length(maxmin));
else % is the other way around
maxes = maxmin(2:2:length(maxmin));
mins = maxmin(1:2:length(maxmin));
end % make endpoints both maxes and mins
maxes = [1 maxes N];
mins = [1 mins N];
%------------------------------------------------------------------------- % spline interpolate to get max and min envelopes; form imf
maxenv = spline(maxes,h(maxes),1:N); %%用样条函数插值拟合所有的极大值点
minenv = spline(mins, h(mins),1:N); %%用样条函数插值拟合所有的极小值点
m = (maxenv + minenv)/2; % mean of max and min enveloppes %%求上下包络的均值
prevh = h; % of the previous value of h before modifying it %%h为分解前的信号
h = h - m; % substract mean to h %% 减去包络均值
% calculate standard deviation
eps = 0.0000001; % to avoid zero values
SD = sum ( ((prevh - h).^2) ./ (prevh.^2 + eps) ); %% 计算停止准则
end
imf = [imf; h]; % store the extracted IMF in the matrix imf
% if size(maxmin,2)<2, then h is the resie
% stop criterion of the algo. if we reach the end before n
if size(maxmin,2) < 2
break
end
c = c - h; % substract the extracted IMF from the signal
end
return

阅读全文

与grillingemd工具箱相关的资料

热点内容
一种汽车发动机舱自动灭火装置 浏览:594
自来水手表前阀门怎么打开 浏览:440
找出实验装置漏气位置 浏览:121
天正给排水管道加载阀门 浏览:774
psv工具箱怎么安装游戏 浏览:175
电梯检测装置一般在哪里 浏览:751
南通中华电动工具 浏览:333
设备系统如何入账 浏览:676
下料自动校正装置设计 浏览:469
尼尔机械纪元6o战术刀怎么获得 浏览:887
温州地区最大的阀门厂 浏览:76
冷库制冷机电流偏低是什么原因 浏览:985
阀门膜头是什么材质 浏览:81
踏板车后轮轴承垫片怎么取下来 浏览:213
机床结构示意图怎么画 浏览:380
暖气片阀门儿向左是开向右是开 浏览:527
无锡军青机械制造有限公司怎么样 浏览:776
仪表如何隔离 浏览:618
对开门冷藏柜不制冷怎么办 浏览:282
根据图1实验装置图回答 浏览:349