【正文】
title(39。小波包 [2,1]的系數(shù) 39。)。 subplot(324)。 plot(cfs22)。 title(39。小波包 [2,2]的系數(shù) 39。)。 subplot(325)。 plot(cfs31)。 title(39。小波包 [3,1]的系數(shù) 39。)。 subplot(326)。 plot(cfs32)。 title(39。小波包 [3,2]的系數(shù) 39。)。 0 200 400 600 800 1000 1200 1 050510原始信號(hào)0 50 100 150 200 250 300 2 0 1 001020小波包 [ 2 , 0 ] 的系數(shù)0 50 100 150 200 250 30050510小波包 [ 2 , 1 ] 的系數(shù)0 20 40 60 80 100 120 140 4 0 2 0020小波包 [ 3 , 0 ] 的系數(shù)0 20 40 60 80 100 120 140 1 050510小波包 [ 3 , 1 ] 的系數(shù)十六、 wprcoef 功能:小波包分解系數(shù)的重構(gòu); 格式: x= wprcoef( t, n) 說(shuō)明: wprcoef是一個(gè)一維或二維的小波包分析函數(shù),計(jì)算節(jié)點(diǎn) n的小波包分解系數(shù)的重構(gòu)信號(hào)。 X= wprcoef( t)= wprcoef( t, 0) 該函數(shù)一次只能對(duì)一個(gè)節(jié)點(diǎn)進(jìn)行重構(gòu),不能同時(shí)對(duì)多點(diǎn)進(jìn)行重構(gòu),可以通過(guò)多次調(diào)用實(shí)現(xiàn)。 load noisdopp。 x=noisdopp(1:1000)。 figure(1) subplot(311) plot(x) title(39。原始信號(hào) 39。) t=wpdec(x,3,39。db139。,39。shannon39。)。 rcfs=wprcoef(t,[2,0])。 cfs21=wpcoef(t,[2,0])。 subplot(312) plot(cfs21) title(‘小波包節(jié)點(diǎn)( 2, 0)系數(shù) 39。) subplot(313) plot(rcfs) title(‘重構(gòu)小波包節(jié)點(diǎn)( 2, 0)信號(hào) 39。) 十七、 wpfun 功能:小波包函數(shù) 格式: [WPWS,X] = WPFUN(39。wname39。,NUM,PREC) putes the wavelets packets for a wavelet 39。wname39。 (see WFILTERS), on dyadic intervals of length 1/2^PREC. PREC must be a positive integer. Output matrix WPWS contains the W functions of index from 0 to NUM, stored rowwise as [W0。 W1。...。 Wnum]. Output vector X is the corresponding mon Xgrid vector. [WPWS,X] = WPFUN(39。wname39。,NUM) is equivalent to [WPWS,X] = WPFUN(39。wname39。,NUM,7). 十八、 wpsplt 功能:分解(分割)小波包 格式: t= wpsplt(t,n) returns the modified tree t corresponding to the deposition of the node n. [t,ca,cd] = wpsplt(t,n) with ca = approximation and cd = detail of node n for a 1D deposition. [t, ca,ch,cv,cd] = WPSPLT(T,N) with ca = approximation and ch, cv, cd = (Horiz., Vert. and Diag.) details of node n for a 2D deposition(二維小波變換) 舉例 load noisdopp。 x=noisdopp(1:1000)。 figure(1) subplot(311) plot(x) title(39。原始信號(hào) 39。) t=wpdec(x,3,39。db139。,39。shannon39。)。 plot(t) [wpt,wpd]=wpsplt(t,[3,0])。 plot(wpt) 十九、 wpjoin 功能:重新組合小波包 格式及說(shuō)明: t = wpjoin(t,n) returns the modified tree t corresponding to a reposition of the node n. t = wpjoin(t) is equivalent to t = wpjoin(t,0). [t,x] = wpjoin(t,n) also returns the coefficients of the node n。 [t,x] = wpjoin (t) is equivalent to [t,x] = wpjoin(t,0) load noisdopp。 x=noisdopp(1:1000)。 figure(1) subplot(321) plot(x) title(39。原始信號(hào) 39。) t=wpdec(x,3,39。db139。,39。shannon39。)。 plot(t) [wpt,wpc]=wpjoin(t,[1,1])。 plot(wpt) figure(1) subplot(322) plot(wpc) title(39。節(jié)點(diǎn) 2的小波包分解系數(shù) 39。) 二十、 wpcutree 功能:剪切小波包分解樹(shù) 格式及說(shuō)明: t = wpcutree(t,L) cuts the tree t at level L. In addition, [t,rn] = wpcutree(t,L) returns the vector rn which contains the indices of the reconstructed nodes. 舉例 load noisdopp。 x=noisdopp(1:1000)。 figure(1) subplot(211) plot(x) title(39。原始信號(hào) 39。) t=wpdec(x,3,39。db139。,39。shannon39。)。 plot(t) [wpt,rn]=wpcutree(t,2)。 plot(wpt) rn=3, 4, 5, 6 二十一、 besttree 功能:計(jì)算最佳樹(shù) 格式及說(shuō)明: BESTTREE putes the optimal subtree of an initial tree with respect to an entropy type criterion. The resulting tree may be much smaller than the initial one. T = BESTTREE(T) putes the modified tree T corresponding to the best entropy value. [T,E] = BESTTREE(T) returns the best tree T and in addition, the best entropy value E. The optimal entropy of the node whose index is j1 is E(j). [T,E,N] = BESTTREE(T) returns the best tree T, entropy value E and in addition, the vector N containing the indices of the merged nodes. 舉例 load noisdopp。 x=noisdopp。 t=wpdec(x,3,39。db139。,39。shannon39。)。 x1=wprec(t)。 [wpt,wpca,wpcd]=wpsplt(t,[3,0])。 plot(wpt) [bt,e,n]=besttree(wpt)。 plot(bt) e39。 ans = +004 * Columns 1 through 8 Columns 9 through 11 n= 2 二十二、 bestlevt 計(jì)算完整最佳小波包樹(shù) BESTLEVT putes the optimal plete subtree of an initial tree with respect to an entropy type criterion. The resulting plete tree may be of smaller depth than the initial one. T = BESTLEVT(T) putes the modified tree T corresponding to the best level tree deposition. [T,E] = BESTLEVT(T) returns best tree T and in addition, the best entropy value E. The optimal entropy of the node whose index is j1 is E(j). load noisdopp。 x=noisdopp。 t=wpdec(x,3,39。db139。,39。shannon39。)。 [wpt,wpca,wpcd]=wpsplt(t,[3,0])。 plot(wpt) [blt,e]= bestlevt(wpt)。 plot(blt) e39。 ans = +004 * Columns 1 through 8 Columns 9 through 15 二十三、 wp2wtree 從小波包樹(shù)中提取小波樹(shù) WP2WTREE Extract wavelet tree from wavelet packet tree. t = wp2wtree(t) putes the modified tree T corresponding to the wavelet deposition tree. load noisdopp。 x=noisdopp。 t=wpdec(x,4,39。db139。,39。shannon39。)。 plot(t) wt=wp2wtree(t)。 plot(wt)