资源简介

一个实时提升小波,滤波程序,它可以滤除噪声

资源截图

代码片段和文件信息

function [xxt]=liftingwave(yiLbeginover)
%%  2.提升小波(db4小波处理)
p1=-0.322275887997141;
u11=-1.117123605160594;
u12=-0.300142258748544;
p21=-0.018808352726244;p22=0.117648086798478;
u21=2.131816712755220;u22=0.636428271190659;
p31=-0.469083478911028;p32=0.140039237732612;p33=-0.024791238157195;
k=0.734124527683251;k1=1.362166720073770;   %   预测算子和更新算子定义
l=7;
%-----------------------------------------------------------
y=zeros(1length(yi));
for i=1:1:length(yi)
    y(i)=yi(i);
end
layer_coef=zeros(12500);
layer=zeros(1l);
for p=1:1:l
     yy=zeros(1length(y)+8);
     for i=1:1:length(yy)
         if i<=4
             yy(i)=y(5-i);
         elseif i<=length(y)+4
             yy(i)=y(i-4);
         elseif i>length(y)+4
             yy(i)=y(2*length(y)+5-i);
         end

     end
     %-----------------------------------------延拓
         d1=zeros(1fix(length(yy)/2));
    for i=2:2:length(yy)
        d1(i/2)=yy(i);
    end
    
    s1=zeros(1fix(length(yy)/2));
    for i=1:2:length(yy)-1
        s1((i+1)/2)=yy(i);
    end                  %分裂得到奇数组s1(近似),偶数组d1(小波系数)
    %---------------------------------------------------
    d11=zeros(1fix(length(yy)/2));
    for i=1:1:length(s1)-1
        d11(i)=d1(i)+p1*s1(i+1);
    end
        d11(i+1)=d1(i+1);                    %用偶数组预测奇数组
  %----------------------------------------------------  
  s11=zeros(1length(s1));
    s11(1)=s1(1)+u11*d11(1); 
    for i=2:1:length(s1)
        s11(i)=s1(i)+u11*d11(i)+u12*d11(i-1);
    end                                       
                                             %更新偶数组
  %-------------------------------------------------------
     d12=zeros(1length(s1));
     
     
     for i=1:1:length(s1)-2
         d12(i)=d11(i)+p21*s11(i+2)+p22*s11(i+1);
     end
     d12(i+1)=d11(i+1)+p22*s11(i+2);      
     d12(i+2)=d11(i+2);                      %再预测奇数组
 %------------------------------------------------------------  
      s12=zeros(1length(s1));
      s12(1)=s11(1)+u21*d12(1);
      for i=2:1:length(s12)
         s12(i)=s11(i)+u21*d12(i)+u22*d12(i-1);
      end                                        %更新偶数组
 %-----------------------------------------------------------
      d13=zeros(1length(s1));
      d13(1)=d12(1)+p31*s12(1);
      d13(2)=d12(2)+p31*s12(2)+p32*s12(1);
      
      for i=3:1:length(d13)
          d13(i)=d12(i)+p31*s12(i)+p32*s12(i-1)+p33*s12(i-2);
      end
 %-------------------------------------------------预测奇数组     
      
 
 s13=zeros(1length(s1));
 d14=zeros(1length(s1));
    for i=1:1:length(s1)
       s13(i)=s12(i)*k;
       d14(i)=d13(i)*k1;
    end                                    %得到低高频系数
 %--------------------------------------------------------
%     a=d14(length(d14)/2)/0.6745;
%     b=a*sqrt(2*log(length(d14))/log(2));
%      for i=1:1:length(d14)
%         if (d14(i)<10)||d14(i)>((-1)*10)
%            d14(i)=0;       
%         end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       6131  2012-06-13 11:18  liftingwave.m

     文件      11213  2012-06-13 11:18  realtime_main.m

     文件        111  2012-06-13 11:18  RMSE.m

     文件        128  2012-06-13 11:18  SNR.m

----------- ---------  ---------- -----  ----

                17583                    4


评论

共有 条评论