Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Wavelet 1D - inverse transform

emma01
Beginner
356 Views
Hi,
I'm trying to use the 1D wavelet transforms in IPP and I really have trouble to understand the use of some of the parameters (delay line and offset). I think I figured out how the forward transform works, but I'm completely lost with the inverse transform. I work with non-streaming data and try, for a start, to achieve perfect reconstruction. I have a few questions:
1) About the delay line length, I found the following in the IPP manual (WTInvSetDlyLine):


"The following expression defines the length of the delay line vector of the low frequency component filter in terms of the C language (integer division by two is used here for simplicity):

dlyLowLen= (lenLow+offsLow- 1) / 2,

wherelenLowandoffsLoware respectively the length and additional delay of the low frequency component filter."

The way I understand it, to set the delay line is similar to setting some border extensions. If, for example, we have some approximation and detail coefficient, both of length 15, and our low and high pass filters have length 4, the convolution of the 4-element filter with a signal of length 30 (signal of length 15 after upsampling) will give us an output of length 30-4+1=27. In order to get an output of length 30, we need a border extension of length 3. Now according to the above, the delay line has length 1 (if we set the offset to be 0, as in the IPP manual example). Assuming that it is upsampled as well, we get a border extension of 2, which is still not enough. How do we get to a signal of the right length in the end?!?!?!?!?

2) I cannot understand if the delay line is added at the beginning or at the end of the signal.

3) In the documentation (WTInv), there is a nice figure of the one dimensional inverse transform. The delay line seems to be added AFTER upsampling and filtering... how is this possible? What does this means?

I'm trying to play with the parameters and to understand how do I get to the results I see, but I really cannot figure it out.... if I cannot even get this, I don't think I have any chance of setting the parameters correctly for any input slightly different from the examples in the IPP manual.

Could someone please help me? I feel a bit desperate...

Thank you

0 Kudos
2 Replies
Igor_B_Intel1
Employee
356 Views
Hi,
Lets try to separete delay line and offset terms.
1. IPP wavelet transform designed to use FIR filters. So for correct filtration in streaming case need to provide "hystory" samples for the filter in the lenght of half of taps len. (It is OK to use zero dly line values in other case). For more details pls see FIR filters description.
2. In wavelet transform we use 2 different FIR filters for high and low frequencies. When they got different taps len then occurs some unsyncronization ofcoefficients for low andand high freqs in time domain.For precise ananlysis better to have them alighned.Thats why "offset" (different for low and high freqs) paramis introduced. It measured in samples. For simplicity this is half of diffrence between taps len of high-pass and low-pass filters.
So, in general to get high and low compoonents syncronized in time domain we should take in to the account FIR filters taps len and their difference to calculate exact dly line length. Please see an WTFwd function usage example.

in you case you've got filters with equal taps len, so them already syncronized and you need to use offets equal to -1 for FWD transform and equal to 0 for INV transform.
0 Kudos
emma01
Beginner
356 Views
Thank you for your answer.

My high pass and low pass filters have the same length. Unfortunately, with the offsets -1 and 0, using for example db8 wavelet filters, I do not manage to get perfect reconstruction. There are always problems on the borders that are not acceptable for my application. I tried both with a delay line as in the example and zero delay line. By the way, the example given in the manual is for non streaming data, and they do make use of a non zero delay line.
I also don't understand why you say that the length of the delay line needs to be (always) half of taps length.... For the forward transform the length must be, according to the manual, equal to[fwdFltLenL + fwdFltOffsL - 1], while for the inverse, it is [invFltLenL + invFltOffsL - 1]/2... I assumed that it wasrelated to the upsampling that is supposedto be done before the filtering, but maybe I'm wrong.
Is there any way to explain me what happens when we set the delay line and the offset, in terms of signal, border extensions,convolutions(or filtering) and upsampling/downsampling?
Thank you
0 Kudos
Reply