函数wdencmp
功能:小波去噪,得到去噪后的图像
[XC,CXC,LXC,PERF0,PERFL2] = WDENCMP('gbl',X,'wname',N,THR,SORH,KEEPAPP) 其中XC为去噪后的图像信号
在wdencmp中通过xc = waverec2(cxc,lxc,w) ,重构函数得到信号xc
Waverec2如何工作的呢?
X = W A VEREC2(C,S,'wname') reconstructs the matrix X
based on the multi-level wavelet decomposition structure
[C,S]
利用经过阈值处理过得系数C和它对应的长度S按照分解时选择的小波来重构;Waverec2涉及到的函数x = appcoef2(c,s,varargin{:},0)
Appcoef2函数得到x的方法:x= idwt(a,d,Lo_R,Hi_R,l(imax-p)),综合滤波器重构
Idwt中包含了上采用和卷积函数upsconv1
x = upsconv1(a,Lo_R,lx,dwtEXTM,shift) + upsconv1(d,Hi_R,lx,dwtEXTM,shift);
里面分别调用了采样函数和卷积函数
完成!!
函数wavedec2
功能:返回N层小波分解系数,使用指定滤波器
[C,S] = WA VEDEC2(X,N,'wname') returns the wavelet decomposition of the matrix X at level N,using the wavelet named in string 'wname' ,输出C小波系数,S是对应的系数长度;Wavedec2中通过dwt获得低频系数和小波系数
for i=1:n
[x,h,v,d] = dwt2(x,Lo_D,Hi_D); % decomposition
c = [h(:)' v(:)' d(:)' c]; % store details
s = [size(x);s]; % store size
end
% Last approximation.
c = [x(:)' c];
s = [size(x) ; s];
Dwt2函数如何实现此功能?包含卷积conv2和下采样convdown函数
根据二维mallat变换
输入信号先与滤波器卷积conv2,再下采样得到系数[x,h,v,d] ;