DWT filter bank time-domain wavelets
Create a seven-level DWT filter bank with a signal length of 1000 samples, using the Daubechies
db2 wavelet and a sampling frequency of 1 kHz.
wv = "db4"; len = 1000; lev = 7; Fs = 1e3; fb = dwtfilterbank('Wavelet',wv,'SignalLength',len,'Level',lev,'SamplingFrequency',Fs);
Plot the time-domain and centered wavelets corresponding to the wavelet bandpass filters.
[psi,t] = wavelets(fb); plot(t,psi') grid on title('Time-domain Wavelets')
Plot the finest scale time-domain wavelet and the one-sided magnitude frequency response of the corresponding wavelet bandpass filter.
sc = 1; [psidft,f] = freqz(fb); subplot(2,1,1) plot(t,psi(sc,:)) grid on xlabel('Time (sec)') ylabel('Magnitude') title(['Level ',num2str(sc),' Time-Domain Wavelet']) subplot(2,1,2) plot(f(len/2:end),abs(psidft(sc,len/2:end))) grid on xlabel('Hz') ylabel('Magnitude') title('Magnitude Frequency Response')
psi— Time-centered wavelets
Time-centered wavelets corresponding to the wavelet passband filters,
returned as an L-by-N matrix, where
L is the filter bank
N is the
wavelets are ordered in
psi from the finest scale
resolution to the coarsest scale resolution.
t— Sampling instants
Sampling instants, returned as a real-valued vector
of length N, where N is the filter
SignalLength. Sampling instants lie in the interval , where DT is the filter bank sampling
period (reciprocal of the filter bank sampling frequency).