1.代码
clear clc % Load a signal. load noisdopp % Decompose the signal at level 3 with db1 wavelet packets using Shannon entropy. wpt=wpdec(noisdopp,3,'db1','shannon'); % Plot the wavelet packet tree. plot(wpt) %Decompose packet(3,0) wpt=wpsplt(wpt,[3 0]); % or equivalently wpsplt(wpt,7). % Plot wavelet packet tree wpt. plot(wpt) %Obtain the coefficients at the node (3,0). Plot the signal and coefficients. cfs=wpcoef(wpt,[3 0]); subplot(2,1,1) plot(noisdopp) title('Signal') axis tight subplot(2,1,2) plot(cfs) title('Packet (3,0) Coefficients') axis tight
2.运行结果