【】Matlab_小波工具箱入门【DOC精选】.docVIP

  • 2
  • 0
  • 约3.36千字
  • 约 11页
  • 2017-02-16 发布于江苏
  • 举报

【】Matlab_小波工具箱入门【DOC精选】.doc

【】Matlab_小波工具箱入门【DOC精选】

使用 MATLAB 小波工具箱进行小波分析: ?? ? 如上图所示的小波分解过程,可以调用 wfilters 来获得指定小波的分解和综合滤波器系数,例如: % Set wavelet name. wname = db5; % Compute the four filters associated with wavelet name given % by the input string wname. [Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(wname); subplot(221); stem(Lo_D); title(Decomposition low-pass filter); subplot(222); stem(Hi_D); title(Decomposition high-pass filter); subplot(223); stem(Lo_R); title(Reconstruction low-pass filter); subplot(224); stem(Hi_R); title(Reconstruction high-pass filter); xlabel(The four filters for db5) % Editing some graphical properties, % the following figure is generated.?   ? 以上例子,得到’db5’小波的分解和综合滤波器系数,并显示出来。下面是wfilters的具体用法: Wname 可指定为列表中的任意一种小波,直接调用 [Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(wname) 会返回分解和综合滤波器系数。如果只想返回其中的一些而不是全部,可以调用 [F1,F2] = wfilters(wname,type) 其中’type’可指定为4种类型,每种类型的具体意义详见matlab wfilters帮助。 ? ? 查看具体小波的信息 waveinfo(‘wname’) ? 获得一个标准的正交变换/双正交变换 的尺度和小波函数(数字近似值) [PHI,PSI,XVAL] = wavefun(wname,ITER) [PHI1,PSI1,PHI2,PSI2,XVAL] = wavefun(wname,ITER) 例如 % Set number of iterations and wavelet name. iter = 10; wav = sym4;? % Compute approximations of the wavelet function using the % cascade algorithm. for i = 1:iter ??? [phi,psi,xval] = wavefun(wav,i); ??? plot(xval,psi); ??? hold on end title([Approximations of the wavelet ,wav, ... ?????? for 1 to ,num2str(iter), iterations]); hold off? ? ? 如果已知小波分解滤波器系数,计算小波变换的最简单方法就是 [C,S] = wavedec2(X,N,wname) [C,S] = wavedec2(X,N,Lo_D,Hi_D) ? 反过来,已知小波综合滤波器系数,计算反小波变换,只需 X = waverec2(C,S,wname) X = waverec2(C,S,Lo_R,Hi_R) %?? 图片的小波分解 clear all clc? im? = imread(../../std_images/lena.bmp);? %灰度 im? = double(im);? [Lo_D,Hi_D] = wfilters(haar,d); [C,S]?????? = wavedec2(im,1,Lo_D,Hi_D);? isize?????? = prod(S(1,:)); % cA?? = C(1:isize); cH? = C(isize+(1:isize)); cV? = C(2*isize+(1:isize)); cD? = C(3*isize+(1:isize)); % cA?? = reshape(cA,S(1,1),S(1,2)); cH? = reshape(cH,S(2,1),S(2,2)); cV? = reshape(cV,S(2,1),S(2,2)); cD? = reshape(cD,S(2,1),S(2,2)); % figure,colormap gray

文档评论(0)

1亿VIP精品文档

相关文档