Main Content

wavelets

DWT filter bank time-domain wavelets

Description

psi = wavelets(fb) returns the time-domain and centered wavelets corresponding to the wavelet passband filters in the discrete wavelet transform (DWT) filter bank fb.

example

[psi,t] = wavelets(fb) returns the sampling instants t.

Examples

collapse all

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')

Figure contains an axes object. The axes object with title Time-domain Wavelets contains 7 objects of type line.

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')

Figure contains 2 axes objects. Axes object 1 with title Level 1 Time-Domain Wavelet contains an object of type line. Axes object 2 with title Magnitude Frequency Response contains an object of type line.

Input Arguments

collapse all

Discrete wavelet transform (DWT) filter bank, specified as a dwtfilterbank object.

Output Arguments

collapse all

Time-centered wavelets corresponding to the wavelet passband filters, returned as an L-by-N matrix, where L is the filter bank Level and N is the SignalLength. The wavelets are ordered in psi from the finest scale resolution to the coarsest scale resolution.

Sampling instants, returned as a real-valued vector t of length N, where N is the filter bank SignalLength. Sampling instants lie in the interval [½NDT,½NDT), where DT is the filter bank sampling period (reciprocal of the filter bank sampling frequency).

Introduced in R2018a