联系QQ:

2181264433

新闻资讯
联系我们
联系:张女士
微信:扫一扫右侧二维码
QQ :2181264433
邮箱:2181264433@qq.com
地址:浙江省-嘉兴市-南湖区
网址:www.mhslogic.com
您当前位置:首页 > 国内资讯 > 正文国内资讯
MATLAB代做|FPGA代做|simulink代做——小波包络提取
添加时间:2020-5-30 来源:本站整理





% load image file
% function [A1]=wavelet(A0)
% dimension=size(A0);
% N=dimension(1);
function [A11 A12 A13 A14]=waveletdecompose(A)
N=size(A,1);
A0=double(A);
% 9-7 wavelet (index from -4 to 4)
h=[0.0378 -0.0238 -0.1106 0.3774 0.8527 0.3774 -0.1106 -0.0238 0.0378];
hstar=[-0.0645 -0.0407 0.4181 0.7885 0.4181 -0.0407 -0.0645];
% g and gstar (index from -2-4 and -3-5)
for n=1:7
    g(n)=(-1)^(n-3)*hstar(5-(n-3));
end

% construct matrix H and G
   % H
    for j=1:9
        if j<=5
        for i=1:N+(j-5)
        H(i-(j-5),i)=h(j);
        end
        else
            for i=1:N-(j-5)
                H(i,i+(j-5))=h(j);
            end
        end
    end
    Hadd1=[h(1) h(2) h(3) h(4); 0 h(1) h(2) h(3); 0 0 h(1) h(2); 0 0 0 h(1)];
    Hadd2=[h(9) 0 0 0; h(8) h(9) 0 0; h(7) h(8) h(9) 0; h(6) h(7) h(8) h(9)];
    Hadd=[zeros(4,N-4),Hadd1; zeros(N-8,N); Hadd2, zeros(4,N-4)];
    H=H+Hadd;
  % G
  for j=1:7
      if j<=3
          for i=1:N+(j-3)
              G(i-(j-3),i)=g(j);
          end
      else
          for i=1:N-(j-3)
              G(i,i+(j-3))=g(j);
          end
      end
  end
  Gadd1=[g(1) g(2); 0 g(1)];
  Gadd2=[g(7) 0 0 0; g(6) g(7) 0 0; g(5) g(6) g(7) 0; g(4) g(5) g(6) g(7)];
  Gadd=[zeros(2,N-2) Gadd1; zeros(N-6,N); Gadd2 zeros(4,N-4)];
  G=G+Gadd;
% processing per line
A_row_lp=H*(A0');
A_row_lp=(A_row_lp)';
A_row_hp=G*(A0');
A_row_hp=(A_row_hp)';
for k=1:N/2
    AL(:,k)=A_row_lp(:,2*k-1);
    AH(:,k)=A_row_hp(:,2*k-1);
end
ALL=H*AL;
ALH=G*AL;
AHL=H*AH;
AHH=G*AH;
for k=1:N/2
    A11(k,:)=ALL(2*k-1,:);
    A12(k,:)=ALH(2*k-1,:);
    A13(k,:)=AHL(2*k-1,:);
    A14(k,:)=AHH(2*k-1,:);
end
A10=[A11,A13;A12,A14];
A1=uint8(A10);
imshow(A1);










扫一扫,关注我们