celectron builder使用 怎么使用lmd

LMD局域均值分解的matlab程序及示例
说明:研究LMD局域均值分解有3个月左右,能找到的相关文章也基本上看了一遍,觉得是个很好的方法,号称是EMD经验模态分解的改进版。但是网络上一直没有找到该算法的matlab程序,只见文章说的天花乱坠。后来自己写了一个,但是使用有一个问题没有解决,就是分解的时候怎么去除骑行波的问题。先把自己写的程序贡献出来,让大家分析下,一起讨论下,到底LMD的程序怎样写才能如文献中说的那样达到目的。欢迎大家热烈讨论!
程序仍存在不收敛的问题,拿出来分享只是希望高手指点一二,写的不好欢迎拍砖!
想要M文件的,给出下载地址:
文件夹包含,找出纯调频函数,计算瞬时幅值,瞬时频率的函数等
%%%%%%%%%%%主程序%%%%%%%%%%
%lmd1原始版
%通过emd.m的三次样条+镜像延拓求出上下包络及均值
%局域均值函数=(上包络+下包络)/2
%局域包络函数=|上包络-下包络|/2
%相关文章见《一种基于EMD的振动信号时频分析新方法研究》-胡劲松,杨世锡
function[PF,A,SI]=lmd1(m)
%最后一个PF是残余分量
%A是瞬时赋值
%SI是纯调频函数,求它的瞬时频率就是需要的频率
wucha1=0.001;
n_l=nengliang(m);
&&& k=k+1;
[pf,a,si]=zhaochun1(a,h,wucha1);
c_pos=pos(c);
n_c=nengliang(c);
n_pf=nengliang(pf);
&&& %停止调节
%1.emd用的是三次样条求包络,要求至少3个极值点,所以这里c的极值点个数也应该至少为3
%2.如果上一个PF的极值点数比下一个PF的极值点数少,说明结果也不正确(这个也可以作为停止条件考虑进去)
%上面一句是否可以等价于当前PF的极值点个数一定要大于等于残量(c)的极值点个数(目前是用这个作为停止条件的一个参考写入程序)
%3.当前PF分量的能量应该大于残量c的能量(这个有待商榷)
%4.残余能量不能大于信号能量
length(c_pos)&3 ||
n_c&n_l/10& ||k==3%||
n_pf&n_c%||n_c&n_l
PF(k+1,:)=c;
%%%%%%%%%%%%%%%%%%nengliang函数%%%%%%%%%%
function p=nengliang(y)
% my=mean(y);
% p=(y-my).*(y-my);
% p=sum(p);
p=sum(abs(y).^2);
%%%%%%%%%%%%%找纯函数%%%%%%%%%%%%%%%%%
function [pf,a,si]=zhaochun1(a,h,wucha1)
chun_num=0;
chun_num=chun_num+1;
t=1:length(h);
[envmin,envmax,envmoy,indmin,indmax,indzer] =
envelope(t,h,'spline');
mi=(envmax+envmin)./2;
ai=abs(envmax-envmin)./2;
si=(h-mi)./
ai_funmax=max(ai);
ai_funmin=min(ai);
(ai_funmax&=1+wucha1&&ai_funmin&=1-wucha1)
function [envmin, envmax,envmoy,indmin,indmax,indzer] =
envelope(t,x,INTERP)
%computes envelopes and mean with various interpolations
NBSYM = 2;&&% 边界延拓点数
DEF_INTERP = 'spline';
if nargin & 2
&t = 1:length(x);
&INTERP = DEF_INTERP;
if nargin == 2
&if ischar(x)
&&INTERP =
&&t = 1:length(x);
if ~ischar(INTERP)
&error('interp parameter must be ''linear'''',
''cubic'' or ''spline''')
if ~any(strcmpi(INTERP,{'linear','cubic','spline'}))
&error('interp parameter must be ''linear'''',
''cubic'' or ''spline''')
if min([size(x),size(t)]) & 1
&error('x and t must be vectors')
s = size(x);
if s(1) & 1
s = size(t);
if s(1) & 1
if length(t) ~= length(x)
&error('x and t must have the same length')
lx = length(x);
[indmin,indmax,indzer] = extr(x,t);
%boundary conditions for interpolation
[tmin,tmax,xmin,xmax] =
boundary_conditions(indmin,indmax,t,x,NBSYM);
% definition of envelopes from interpolation
envmax = interp1(tmax,xmax,t,INTERP);&
envmin = interp1(tmin,xmin,t,INTERP);
if nargout & 2
&&& envmoy =
(envmax + envmin)/2;
function [tmin,tmax,xmin,xmax] =
boundary_conditions(indmin,indmax,t,x,nbsym)
% computes the boundary conditions for interpolation (mainly mirror
&lx = length(x);
&% 判断极值点个数
&if (length(indmin) + length(indmax)
&&error('not enough
% 插值的边界条件
&if indmax(1) & indmin(1)%
第一个极值点是极大值
&if x(1) & x(indmin(1))%
以第一个极大值为对称中心
fliplr(indmax(2:min(end,nbsym+1)));
fliplr(indmin(1:min(end,nbsym)));
indmax(1);
如果第一个采样值小于第一个极小值,则将认为该值是一个极小值,以该点为对称中心
fliplr(indmax(1:min(end,nbsym)));
[fliplr(indmin(1:min(end,nbsym-1))),1];
&&if x(1) &
x(indmax(1))% 以第一个极小值为对称中心
fliplr(indmax(1:min(end,nbsym)));
fliplr(indmin(2:min(end,nbsym+1)));
indmin(1);
如果第一个采样值大于第一个极大值,则将认为该值是一个极大值,以该点为对称中心
[fliplr(indmax(1:min(end,nbsym-1))),1];
fliplr(indmin(1:min(end,nbsym)));
序列末尾情况与序列开头类似
&if indmax(end) & indmin(end)
&&if x(end) &
x(indmax(end))
fliplr(indmax(max(end-nbsym+1,1):end));
fliplr(indmin(max(end-nbsym,1):end-1));
indmin(end);
[lx,fliplr(indmax(max(end-nbsym+2,1):end))];
fliplr(indmin(max(end-nbsym+1,1):end));
&&if x(end) &
x(indmin(end))
fliplr(indmax(max(end-nbsym,1):end-1));
fliplr(indmin(max(end-nbsym+1,1):end));
indmax(end);
fliplr(indmax(max(end-nbsym+1,1):end));
[lx,fliplr(indmin(max(end-nbsym+2,1):end))];
将序列根据对称中心,镜像到两边
&tlmin = 2*t(lsym)-t(lmin);
&tlmax = 2*t(lsym)-t(lmax);
&trmin = 2*t(rsym)-t(rmin);
&trmax = 2*t(rsym)-t(rmax);
&% in case symmetrized parts do not extend enough%
如果对称的部分没有足够的极值点
&if tlmin(1) & t(1) | tlmax(1)
& t(1)% 对折后的序列没有超出原序列的范围
&&if lsym == indmax(1)
fliplr(indmax(1:min(end,nbsym)));
fliplr(indmin(1:min(end,nbsym)));
&&if lsym == 1%
这种情况不应该出现,程序直接中止
&&&error('bug')
&&lsym = 1;&%
直接关于第一采样点取镜像
2*t(lsym)-t(lmin);
2*t(lsym)-t(lmax);
序列末尾情况与序列开头类似
&if trmin(end) & t(lx) | trmax(end)
&&if rsym == indmax(end)
fliplr(indmax(max(end-nbsym+1,1):end));
fliplr(indmin(max(end-nbsym+1,1):end));
&if rsym == lx
&&error('bug')
2*t(rsym)-t(rmin);
2*t(rsym)-t(rmax);
% 延拓点上的取值
&xlmax =x(lmax);
&xlmin =x(lmin);
&xrmax =x(rmax);
&xrmin =x(rmin);
% 完成延拓
&tmin = [tlmin t(indmin) trmin];
&tmax = [tlmax t(indmax) trmax];
&xmin = [xlmin x(indmin) xrmin];
&xmax = [xlmax x(indmax) xrmax];
%---------------------------------------------------------------------------------------------------
% 极值点和过零点位置提取
function [indmin, indmax, indzer] = extr(x,t);
%extracts the indices corresponding to extrema
if(nargin==1)
& t=1:length(x);
m = length(x);
if nargout & 2
&x1=x(1:m-1);
&x2=x(2:m);
&indzer = find(x1.*x2&0);
&if any(x == 0)
&& iz = find( x==0 );
&& indz = [];
&& if any(diff(iz)==1)
zer = x == 0;
dz = diff([0 zer 0]);
debz = find(dz == 1);
finz = find(dz == -1)-1;
indz = round((debz+finz)/2);
&& indzer = sort([indzer
d = diff(x);
n = length(d);
d1 = d(1:n-1);
d2 = d(2:n);
indmin = find(d1.*d2&0 &
indmax = find(d1.*d2&0 &
% when two or more consecutive points have the same value we
consider only one extremum in the middle of the constant area
% 当连续多个采样值相同时,把最中间的一个值作为极值点,处理方式与连0类似
if any(d==0)
& imax = [];
& imin = [];
& bad = (d==0);
& dd = diff([0 bad 0]);
& debs = find(dd == 1);
& fins = find(dd == -1);
& if debs(1) == 1
length(debs) & 1
debs = debs(2:end);
fins = fins(2:end);
debs = [];
fins = [];
& if length(debs) & 0
&&& if fins(end)
if length(debs) & 1
debs = debs(1:(end-1));
fins = fins(1:(end-1));
debs = [];
fins = [];
& lc = length(debs);
& if lc & 0
&&& for k =
if d(debs(k)-1) & 0
if d(fins(k)) & 0
imax = [imax round((fins(k)+debs(k))/2)];
if d(fins(k)) & 0
imin = [imin round((fins(k)+debs(k))/2)];
& if length(imax) & 0
&&& indmax =
sort([indmax imax]);
& if length(imin) & 0
&&& indmin =
sort([indmin imin]);
%%%%%%%%%%%%%%%%%%pos%%%%%%%%%%%%
function poss=pos(y)
%功能:找序列极值点位置坐标
%y:输入序列
%pos:极值点的序列位置坐标
[indmin,indmax]=position(y);
minmax=cat(2,indmin,indmax);
poss=sort(minmax);
%%%%%%%%%%%%%%position%%%%%%%
%返还极大值和极小值位置下标
function [indmin,indmax]=position(y)
m = length(y);
d = diff(y);
n = length(d);
d1 = d(1:n-1);
d2 = d(2:n);
indmin = find(d1.*d2&0 &
indmax = find(d1.*d2&0 &
if any(d==0)
& imax = [];
& imin = [];
& bad = (d==0);
& dd = diff([0 bad 0]);
& debs = find(dd == 1);
& fins = find(dd == -1);
& if debs(1) == 1
length(debs) & 1
debs = debs(2:end);
fins = fins(2:end);
debs = [];
fins = [];
& if length(debs) & 0
&&& if fins(end)
if length(debs) & 1
debs = debs(1:(end-1));
fins = fins(1:(end-1));
debs = [];
fins = [];
& lc = length(debs);
& if lc & 0
&&& for k =
if d(debs(k)-1) & 0
if d(fins(k)) & 0
imax = [imax round((fins(k)+debs(k))/2)];
if d(fins(k)) & 0
imin = [imin round((fins(k)+debs(k))/2)];
& if length(imax) & 0
&&& indmax =
sort([indmax imax]);
& if length(imin) & 0
&&& indmin =
sort([indmin imin]);
%说明每个程序要单独保存成m文件,放在同一个文件夹下调用
使用实例:
(2+cos(90*t).*cos(500*t+1800.*t.*t));
t=0:1/fs:0.341;
subplot(5,1,1);plot(t,y);xlabel('原始信号');
[pf,a,si]=lmd1(y);
subplot(5,1,2);plot(t,pf(1,:));xlabel('PF1');
subplot(5,1,3);plot(t,pf(2,:));xlabel('PF2');
subplot(5,1,4);plot(t,pf(3,:));xlabel('PF3');
subplot(5,1,5);plot(t,pf(4,:));xlabel('残量信号');
从上图可以看出,成功将第一个分量和第二个分量分离出来,但是残余分量存在很大的问题,这是因为分解过程中的骑行波没有去处导致的,至于怎样完善LMD局域均值分解算法,目前个人没有时间研究了,希望得到指点。
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。OverviewLMD-Tools SE CRS 2007, C++ Builder is a software program developed by LMD Innovative. Relative to the overall usage of users who have this installed on their PCs, most are running Windows Vista (SP2) and Windows 8. Most users that have installed this software come from the United States.
Program details
Help link:
Installation folder: C:\lmd2011
Uninstaller: C:\LMD2011\UNWISE.EXE /Z /A C:\LMD2011\INSTALL.LOG
(Wise Installer is used for installing and uninstalling this software.)
Files installed by LMD-Tools SE CRS 2007, C++ Builder
UNWISE.EXE (by Symantec) - WISE (WiseScript Uninstaller)
How do I remove LMD-Tools SE CRS 2007, C++ Builder?
Quickly and completely remove LMD-Tools SE (CRS 2007, C++ Builder) (remove only) from your computer by downloading "Should I Remove It?", its 100% FREE and installs in seconds (click the button below).
Or, you can uninstall LMD-Tools SE CRS 2007, C++ Builder from your computer by using the Add/Remove Program feature in the Window's Control Panel.
On the Start menu (for Windows 8, right-click the screen's bottom-left corner), click Control Panel, and then, under Programs, do one of the following:
Windows Vista/7/8: Click Uninstall a Program.
Windows XP: Click Add or Remove Programs.
When you find the program LMD-Tools SE (CRS 2007, C++ Builder) (remove only), click it, and then do one of the following:
Windows Vista/7/8: Click Uninstall.
Windows XP: Click the Remove or Change/Remove tab (to the right of the program).
Follow the prompts. A progress bar shows you how long it will take to remove LMD-Tools SE CRS 2007, C++ Builder.
OS VERSIONS
Win Vista (SP2)&50%
USER ACTIONS
Uninstall it&3%
Keep it&97%
COUNTRY POPULARITY
United States
Which Windows OS versions does it run on?
Windows Vista
Which OS releases does it run on?
Windows 8.1 Pro with Medi...
Windows Vista Home Premiu...
100.00% of installs come from the United States
Which countries install it?
&&United States
PC manufacturers
What PC manufacturers (OEMs) have it installed?
Hewlett-Packard
About (from LMD Innovative)
Software developing, researching, consulting. Our main product line is components for Embarcadero RAD Studio.
Publisher URL:
No one has commented yet. Help others learn more about this software, share your comments.
&|&&|&&|&&|&&|&&|&&C++Builder is an award-winning C++ development environment
Advertisement
Last Week downloads: 7 Total downloads: 16,925
Rank: 11 in
User reviews
3 out of 5 based on 38 ratings for C++Builder 2010
For C++Builder 2010 Publisher's description
Advertisement
C++Builder 2010 is a Development software developed by Embarcadero Technologies, Inc. After our trial and test, the software is proved to be official, secure and free. Here is the official description for C++Builder 2010:EditByBSEditor: C++Builder is an award-winning C++ development environment for building interactive, UI-oriented desktop, workstation, touch-screen, kiosk, and Web applications. Millions of developers worldwide choose C++Builder over other C++ development tools because it provides them with the world’s only true two-way visual RAD C++ development environment with outstanding features for quickly building rich UI and database applications. With C++Builder, you can:
* Rapidly build native Windows applications using the C++ language and libraries * Speed development with visual drag-and-drop tools and a powerful component
* Build data-driven applications that connect to all your data across multiple sources and tiers * Increase your productivity with a timesaving IDE and tools you can
For C++Builder 2010 Related Software
973,628 downloads 609,841 downloads 204,598 downloads 202,076 downloads
For C++Builder 2010
Please be aware that Brothersoft do not supply any crack, patches, serial numbers or keygen for C++Builder 2010,and please consult directly with program authors for any problem with C++Builder 2010.
Top Android Apps
Top Freeware in
Top Shareware in
Popular Searches
New Software in
POPULAR DOWNLOADS}

我要回帖

更多关于 www.c.scslmd.com 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信