Recall the 1-D Haar transform from our previous discussion.
(
y1
y2
)=T(
x1
x2
)
y
1
y
2
T
x
1
x
2
(1)
where
T=12(
11
1-1
)
T
1
2
1
1
1
-1
We can write this in expanded form as:
y1=12x1+12x2
y
1
1
2
x
1
1
2
x
2
(2)
y2=12x1−12x2
y
2
1
2
x
1
1
2
x
2
(3)
More generally if
xx is a longer
sequence and the results are placed in two separate sequences
y0
y0
and
y1
y1
, we define the process as:
y0
n=12xn−1+12xn
y0
n
1
2
x
n
1
1
2
x
n
(4)
y1
n=12xn−1−12xn
y1
n
1
2
x
n
1
1
2
x
n
(5)
These can be expressed as 2 FIR filters with tap vectors
h0
=(
1212
)
h0
1
2
1
2
and
h1
=(
12-12
)
h1
1
2
-1
2
. Hence as z-transforms,
Equation 4 and
Equation 5 become:
Y0
z=
H0
zXz
Y0
z
H0
z
X
z
(6)
where
H0
z=12(z-1+1)
H0
z
1
2
z
1
Y1
z=
H1
zXz
Y1
z
H1
z
X
z
(7)
where
H1
z=12(z-1−1)
H1
z
1
2
z
1
.
(We shall later extend these filters to be more complicated.)
In practice, we only calculate
y0
n
y0
n
and
y1
n
y1
n
at alternate (say even) values of
nn so that the total number of
samples in
y0
y0
and
y1
y1
is the same as in xx.
We may thus represent the Haar transform operation by a pair
of filters followed by downsampling by 2, as shown in Figure 1(a). This is known as a 2-band
analysis filter bank.
In this
equation in our discussion of the Haar transform, to
reconstruct xx from
yy we calculated
x=TTy
x
T
y
. For long sequences this may be written:
∀n,n=even:xn−1=12
y0
n+12
y1
n
n
n
even
x
n
1
1
2
y0
n
1
2
y1
n
(8)
∀n,n=even:xn=12
y0
n−12
y1
n
n
n
even
x
n
1
2
y0
n
1
2
y1
n
(9)
Since
y0
n
y0
n
and
y1
n
y1
n
are only calculated at even values of
nn, we may assume that they are
zero at odd values of
nn. We may
then combine
Equation 8 and
Equation 9 into a single expression for
xn
x
n
, valid for all
nn:
xn=12(
y0
n+1+
y0
n)+12(
y1
n+1−
y1
n)
x
n
1
2
y0
n
1
y0
n
1
2
y1
n
1
y1
n
(10)
or as z-transforms:
Xz=
G0
z
Y0
z+
G1
z
Y1
z
X
z
G0
z
Y0
z
G1
z
Y1
z
(11)
where
(
G0
z=12(z+1))∧(
G1
z=12(z−1))
G0
z
1
2
z
1
G1
z
1
2
z
1
(12)
In
Equation 11 the signals
Y0
z
Y0
z
and
Y1
z
Y1
z
are not really the same as
Y0
z
Y0
z
and
Y1
z
Y1
z
in
Equation 6 and
Equation 7 because those in
Equation 6 and
Equation 7 have not had alternate samples set to
zero. Also, in
Equation 11
Xz
X
z
is the reconstructed output whereas in
Equation 6 and
Equation 7 it is the input signal.
To avoid confusion we shall use
X
^
X
^
,
Y0
^
Y0
^
and
Y1
^
Y1
^
for the signals in Equation 11
so it becomes:
X
^
z=
G0
z
Y0
^
z+
G1
z
Y1
^
z
X
^
z
G0
z
Y0
^
z
G1
z
Y1
^
z
(13)
We may show this reconstruction operation as upsampling
followed by 2 filters, as in
Figure 1(b).
If
Y0
^
Y0
^
and
Y1
^
Y1
^
are not the same as
Y0
Y0
and
Y1
Y1
, how do they relate to each other?
Now
∀n,n=even:
y0
^
n=
y0
n
n
n
even
y0
^
n
y0
n
(14)
∀n,n=odd:
y0
^
n=0
n
n
odd
y0
^
n
0
(15)
Therefore
Y0
^
z
Y0
^
z
is a polynomial in
zz,
comprising
only the terms in even powers
of
zz from
Y0
z
Y0
z
. This may be written as:
Y0
^
z=∑even n
y0
nz−n=∑all n12(
y0
nz−n+
y0
n−z−n)=12(
Y0
z+
Y0
−z)
Y0
^
z
even n
y0
n
z
n
all n
1
2
y0
n
z
n
y0
n
z
n
1
2
Y0
z
Y0
z
(16)
Similarly
Y1
^
z=12(
Y1
z+
Y1
−z)
Y1
^
z
1
2
Y1
z
Y1
z
(17)
This is our general model for downsampling by 2, followed by
upsampling by 2 as defined in
Equation 14 and
Equation 15.