write
Write values in WPTREE fields
Description
Examples
Write Coefficients to Terminal Nodes
Load a signal. Create a wavelet packet tree.
load wecg x = wecg; t = wpdec(x,3,"db3"); t = wpjoin(t,[4;5]);
Plot the tree.
plot(t)
The terminal nodes at (2,1), (2,2), and (3,0) have indices 4, 5, and 7, respectively. The terminal node (3,0) corresponds to filtering the signal at the lowest frequency subband. Set the coefficients at the three nodes to 0.
sNod = read(t,"sizes",[4,5,7]); cfs4 = zeros(sNod(1,:)); cfs5 = zeros(sNod(2,:)); cfs7 = zeros(sNod(3,:)); t = write(t,"cfs",4,cfs4,"cfs",5,cfs5,"cfs",7,cfs7);
Plot the tree again, and view the data at the root node. The plot shows the reconstruction of the signal after setting the coefficients at the three terminal nodes to 0.
plot(t)
Input Arguments
T
— Wavelet packet tree
wptree
object
Wavelet packet tree, specified as a wptree
object.
node
— Terminal node index
integer
Terminal node index, specified as an integer.
coefs
— Coefficients
vector
Coefficients to write for the terminal node, specified as a vector.
The vector must have the correct size for the specified terminal node. You
can use s = read(T,"sizes",
to
obtain the correct size. To obtain the sizes of multiple terminal nodes, use
node
)s = read(T,"sizes",[node1;node2;…])
, where
node1
, node2
, …, are the node
indices.
Version History
Introduced before R2006a
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)