Manager for data structure.
Syntax
[OUT1,OUT2] = wdatamgr(O,D,IN3,IN4,IN5)
Description
wdatamgr is a tree management utility.
[OUT1,OUT2] = wdatamgr(O,D,IN3,IN4,IN5) where D is the data structure and O is a string option. The possible options are:
'write_cfs': writes coefficients for a terminal node
data = wdatamgr('write_cfs',data,tree,node,coefs);
'read_cfs': reads coefficients for a terminal node
coefs = wdatamgr('read_cfs',data,tree,node);
'read_ent': reads the entropy vector
ent = wdatamgr('read_ent',data,nodes);
'read_ento': reads the optimal entropy vector
ento = wdatamgr('read_ento',data,nodes);
'read_tp_ent': reads the type and the parameter for entropy
[type_ent,param] = wdatamgr('read_tp_ent',data);
'read_wave': reads the name of the wavelet
wave = wdatamgr('read_wave',data);
Examples
% Load signal.
load noisdopp; x = noisdopp;
% Decompose x at depth 3 with db1 wavelet packets
% using Shannon entropy.
[t,d] = wpdec(x,3,'db1','shannon');
% Read entropy name.
ent_name = wdatamgr('read_tp_ent',d)
ent_name =
shannon
% Read wavelet name.
wav_name = wdatamgr('read_wave',d)
wav_name =
db1
% Read packet (3,2) coefficients.
cfs = wdatamgr('read_cfs',d,t,[3 2]);
% Read packet (3,2) entropy and optimal entropy.
ind_node = depo2ind(2,[3 2]);
ent = wdatamgr('read_ent',d,ind_node)
ent =
-318.4298
% Optimal entropy is NaN because no optimization has been done.
ento = wdatamgr('read_ento',d,ind_node)
ento =
NaN
% Modify packet (3,2) coefficients.
ncfs = cos(cfs); % or any other modification !
% Update packet (3,2) coefficients.
d = wdatamgr('write_cfs',d,t,[3 2],ncfs);
% Update nodes entropy.
d = entrupd(t,d,'shannon');
nent = wdatamgr('read_ent',d,ind_node)
nent =
22.2830
See Also
wpdec, wpdec2, wtreemgr
[ Previous | Help Desk | Next ]