Accelerating the pace of engineering and science

# qmf

Scaling and Wavelet Filter

Y = qmf(X,P)
Y = qmf(X)
Y = qmf(X,0)

## Description

Y = qmf(X,P) changes the signs of the even index entries of the reversed vector filter coefficients X if P is even. If P is odd the same holds for odd index entries. Y = qmf(X) is equivalent to Y = qmf(X,0).

Let x be a finite energy signal. Two filters F0 and F1 are quadrature mirror filters (QMF) if, for any x,

${‖{y}_{0}‖}^{2}+{‖{y}_{1}‖}^{2}={‖x‖}^{2}$

where y0 is a decimated version of the signal x filtered with F0 so y0 defined by x0 = F0(x) and y0(n) = x0(2n), and similarly, y1 is defined by x1 = F1(x) and y1(n) = x1(2n). This property ensures a perfect reconstruction of the associated two-channel filter banks scheme (see Strang-Nguyen p. 103).

For example, if F0 is a Daubechies scaling filter and F1 = qmf(F0), then the transfer functions F0(z) and F1(z) of the filters F0 and F1 satisfy the condition (see the example for db10):

$|{F}_{0}\left(z\right){|}^{2}+|{F}_{1}\left(z\right){|}^{2}=1$

## Examples

% Load scaling filter associated with an orthogonal wavelet.
subplot(321); stem(db10); title('db10 low-pass filter');

% Compute the quadrature mirror filter.
qmfdb10 = qmf(db10);
subplot(322); stem(qmfdb10); title('QMF db10 filter');

% Check for frequency condition (necessary for orthogonality):
% abs(fft(filter))^2 + abs(fft(qmf(filter))^2 = 1 at each
% frequency.
m = fft(db10);
mt = fft(qmfdb10);
freq = [1:length(db10)]/length(db10);
subplot(323); plot(freq,abs(m));
title('Transfer modulus of db10')
subplot(324); plot(freq,abs(mt));
title('Transfer modulus of QMF db10')
subplot(325); plot(freq,abs(m).^2 + abs(mt).^2);
title('Check QMF condition for db10 and QMF db10')
xlabel(' abs(fft(db10))^2 + abs(fft(qmf(db10))^2 = 1')

% Editing some graphical properties,
% the following figure is generated.

% Check for orthonormality.
df = [db10;qmfdb10]*sqrt(2);
id = df*df'

id =
1.0000 0.0000
0.0000 1.0000

## References

Strang, G.; T. Nguyen (1996), Wavelets and Filter Banks, Wellesley-Cambridge Press.