- function re = d_lo0(A,n)
- %平滑的谱
- [l,ll]=size(A);
- if l<ll,
- l=ll;
- A=A';
- end
- re=zeros(l,1);
- nn=floor(n/2);
- if nn>0
- ss=sum(A(1:nn+1));
- ll=1+nn;
- for i=1:nn
- re(i)=ss/ll;
- ss=ss+A(nn+i+1);
- ll=ll+1;
- end
- for i=nn+1:l-nn-1
- re(i)=ss/ll;
- ss=ss+A(nn+i+1)-A(i-nn);
- end
- for i=l-nn:l
- re(i)=ss/ll;
- ss=ss-A(i-nn);
- ll=ll-1;
- end
- else
- re=A;
- end