[2] Walden, A.T., and A. Contreras Cristan. âThe phase-corrected undecimated discrete wavelet packet transform and its application to interpreting the timing of ...
modwptdetails Maximal overlap discrete wavelet packet transform details
Syntax w w w w
= = = =
modwptdetails(x) modwptdetails(x,wname) modwptdetails(x,lo,hi) modwptdetails( ___ ,lev)
[w,packetlevs] = modwptdetails( ___ ) [w,packetlevs,cfreq] = modwptdetails( ___ ) [ ___ ] = modwptdetails( ___ ,Name,Value)
Description w = modwptdetails(x) returns the maximal overlap discrete wavelet packet transform (MODWPT) details for the 1-D real-valued signal, x. The MODWPT details provide zero-phase filtering of the signal. By default, modwptdetails returns only the terminal nodes, which are at level 4 or at level floor(log2(numel(x))), whichever is smaller.
example
Note To decide whether to use modwptdetails or modwpt, consider the type of data analysis you need to perform. For applications that require time alignment, such as nonparametric regression analysis, use modwptdetails. For applications where you want to analyze the energy levels in different packets, use modwpt. For more information, see Algorithms
w = modwptdetails(x,wname) uses the orthogonal wavelet filter specified by the character vector wname.
example
w = modwptdetails(x,lo,hi) uses the orthogonal scaling filter, lo, and wavelet filter, hi.
example
w = modwptdetails( ___ ,lev) returns the terminal nodes of the wavelet packet tree at positive integer level lev. [w,packetlevs] = modwptdetails( ___ ) returns a vector of transform levels corresponding to the rows of w.
example
[w,packetlevs,cfreq] = modwptdetails( ___ ) returns, w, the center frequencies of the approximate passbands corresponding to the MODWPT details in . [ ___ ] = modwptdetails( ___ ,Name,Value) returns the MODWPT with additional options specified by one or more Name,Value pair arguments.
Examples
example collapse all
MODWPT Details Using Default Wavelet
Obtain the MODWPT of an electrocardiogram (ECG) signal using the default length 18 Fejer-Korovkin ('fk18') wavelet and the default level, 4.
Try it in MATLAB
load wecg; wptdetails = modwptdetails(wecg); Demonstrate that summing the MODWPT details over each sample reconstructs the signal. The largest absolute difference between the original signal and the reconstruction is on the order of , which demonstrates perfect reconstruction. xrec = sum(wptdetails); max(abs(wecg-xrec')) ans = 1.7903e-11
MODWPT Details for Two Sine Waves
Obtain the MODWPT details for a signal containing 100 Hz and 450 Hz sine waves. Each row of the modwptdetails output corresponds to a separate frequency band.
Try it in MATLAB
dt = 0.001; fs = 1/dt; t = 0:dt:1; x = (sin(2*pi*100*t)+sin(2*pi*450*t)); [lo,hi] = wfilters('fk22'); wptdetails = modwptdetails(x,lo,hi); Use modwpt to obtain the energy and center frequencies of the signal. Plot the energy in the wavelet packets. The fourth and fifteenth frequency bands contain most of the energy. Other frequency bands have significantly less energy. The frequency ranges of fourth and fifteenth bands are approximately 94-125 Hz and 438-469 Hz, respectively. [wpt,~,cfreqs,energy] = modwpt(x,lo,hi); figure bar(1:16,energy); xlabel('Packet')
ylabel('Packet Energy') title('Energy by Wavelet Packet')
Plot the power spectral density of the input signal. pwelch(x,[],[],[],fs,'onesided'); title('Power Spectral Density of Input Signal')
Show that the MODWPT details have zero-phase shift from the 100 Hz input sine. p4 = wptdetails(4,:); plot(t,sin(2*pi*100*t).*(t>0.3 & t0.3 & t0.3 & t0.3 & t