Forums

Help with 5/3 IDWT needed

Started by sapoverde June 8, 2009
Hello everyone,

I have a question related to the DWT. I'm trying to understand how it
works using the well-known 5/3 wavelet. I found some code examples online
implementing it but the most of them utilize the so-called lifting
algorithm. But the main point of my interest is to understand the
generalized decomposition/recomposition scheme.

I succeded on performing the analysis comparing both the lifting and
convolution approaches on the following input signal:

z[8] = {130, 29, 96, 3, -15, 12, -25, 9};

I perform the decomposition using the following filter set:

H0(z) = {-1, 2, 6, 2, -1} / 8;
H1(z) = {-1, 2, -1} / 2;

Here an example of the filtering process:

y0[1] = (-z[-2] + z[-1]*2 + z[0]*6 + z[1]*2 - z[2]) / 8;
y1[1] = (-z[0]  + z[1]*2  - z[2]) / 2;

where "y0" is the output of the low-pass filter and "y1" is the output of
the high-pass one.
The low-pass filtering is performed on even coeffs and the high-pass - on
odd ones. The resulting arrays "y0" and "y1" are only the half of the input
size (downsampled).

Here the resulting wavelet coefficients:

y0[4] = { 88,  65, -16, -15};
y1[4] = {-84, -37,  32,   4};

Now I want to do the inverse DWT. If I understand right I need to upsample
both y0 and y1 by inserting zeroes before filtering. That leads to the
following arrays:

y0[8] = { 88, 0,  65, 0, -16, 0, -15, 0};
y1[8] = {-84, 0, -37, 0,  32, 0,   4, 0};

When I try to apply the synthesis filters to the coeffs above I get an
output that doesn't even closely match my input signal! I must doing
something really wrong!

Here's how I'm doing it:

tmp  = (84 + 0*2 - 37*6 + 0*2 - 32) / 8;
tmp += (65 + 0*2 - 16) / 2;

I know it looks definitely wrong...

Could anyone help me to understand this by showing how to perform the
inverse filtering properly?

What looks really strange to me is the fact that some filter coeffs should
be multiplied by zeroes from the upsampled signal! This looks redundand to
me...

Any help would be appreciated!

Regards
Maxim