Wavelet Toolbox |
Wavelet packet tree construction from coefficients
Syntax
Description
CFS2WPT
builds a wavelet packet tree (T) and the related analyzed signal or image (X) using the following input information:
WNAME
: name of the wavelet used for the analysis
SIZE_OF_DATA
: size of the analyzed signal or image
TN_OF_TREE
: vector containing the terminal node indices of the tree
ORDER
: 2 for a signal or 4 for an image
CFS
: coefficients used to reconstruct the original signal or image. CFS
is optional. When CFS2WPT
is used without the CFS
input parameter, the wavelet packet tree structure (T) is generated, but all the tree coefficients are null (including X).
Examples
% Example 1: Using cfs2wpt with the CFS argument % Loading an image load detail % Building the wavelet packet tree decomposition t = wpdec2(X,2,'sym4'); % Reading the coefficient values from the tree cfs = read(t,'allcfs'); % Adding noise to the coefficients noisyCfs = cfs + 40*rand(size(cfs)); % Building the wavelet packet tree object and the reconstructed % noisy image from the noisyCfs using cfs2wpt noisyT = cfs2wpt('sym4',size(X),tnodes(t),4,noisyCfs); % Plotting the new tree and clicking the node (0) or (0,0) plot(noisyT) % Example 2: Using cfs2wpt without the CFS argument % Building an empty wavelet packet tree object t = cfs2wpt('sym4',[1 1024],[3 9 10 2]',2); % Getting the terminal node sizes sN = read(t,'sizes',[3,9]); sN3 = sN(1,:); sN9 = sN(2,:); % Building coefficient values vectors and writing them in the tree cfsN3 = ones(sN3); cfsN9 = randn(sN9); t = write(t,'cfs',3,cfsN3,'cfs',9,cfsN9); % Plotting the updated tree and clicking the node (9) or (3,2) plot(t)
centfrq | cgauwavf |
© 1994-2005 The MathWorks, Inc.