Wavelet packet spectrum
[...] = wpspectrum(WPT,Fs,
[...,TNFO] = wpspectrum(...)
a matrix of wavelet packet spectrum estimates,
for the binary wavelet packet tree object,
the sampling frequency in Hertz.
SPEC is a 2J-by-N matrix
where J is the level of the wavelet packet transform
and N is the length of the time series.
a 1-by-N vector of times and
a 1-by-2J vector of
the terminal nodes of the wavelet packet tree in frequency order.
TNFO] = wpspectrum(...)
Sampling frequency in Hertz as a scalar of class double.
The character vector
Wavelet packet spectrum.
The frequency spacing between the rows of
This example shows wavelet packet spectrum for signal consisting of two sinusoids with disjoint support.
fs = 500; t = 0:1/fs:4; y = sin(32*pi*t).*(t<2) + sin(128*pi*t).*(t>=2); plot(t,y); axis tight title('Analyzed Signal');
Define wavelet packet spectrum.
level = 6; wpt = wpdec(y,level,'sym6'); figure; [S,T,F] = wpspectrum(wpt,fs,'plot');
Create the chirp signal.
fs = 1000; t = 0:1/fs:2; % create chirp signal y = sin(256*pi*t.^2);
Plot the analyzed signal.
plot(t,y); axis tight title('Analyzed Signal');
Get the wavelet packet spectrum estimates.
level = 6; wpt = wpdec(y,level,'sym8'); figure; [S,T,F] = wpspectrum(wpt,fs,'plot');
The wavelet packet spectrum contains the absolute values of the coefficients from the frequency-ordered terminal nodes of the input binary wavelet packet tree. The terminal nodes provide the finest level of frequency resolution in the wavelet packet transform. If J denotes the level of the wavelet packet transform and Fs is the sampling frequency, the terminal nodes approximate bandpass filters of the form:
At the terminal level of the wavelet packet tree, the transform divides the interval from 0 to the Nyquist frequency into bands of approximate width
wpspectrum computes the wavelet packet
spectrum as follows:
Extract the wavelet packet coefficients corresponding to the terminal nodes. Take the absolute value of the coefficients.
Order the wavelet packet coefficients by frequency ordering.
Determine the time extent on the original time axis corresponding to each wavelet packet coefficient. Repeat each wavelet packet coefficient to fill in the time gaps between neighboring wavelet packet coefficients and create a vector equal in length to node 0 of the wavelet packet tree object.
Wickerhauser, M.V. Lectures on Wavelet Packet Algorithms, Technical Report, Washington University, Department of Mathematics, 1992.