Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wavelets, convolution, dwt2

102 views
Skip to first unread message

Alex

unread,
Nov 3, 2011, 3:40:14 PM11/3/11
to
Hi 2 all, sorry for my English)

I started to use wavelets for image denoising. Matlab has a great function dwt2, which gives the output approximation coefficients matrix cA and details coefficients matrices cH, cV, and cD.

I want to manually repeat the process of calculation dwt2, but I was confused a couple of points.

1) The base of transformation is a convolution. Since the dimension of the wavelet-functions, or scale-functions (Haar and Daubechies) greater than 1, then the convolution "inflates" the dimension of the output signal.

For example, if we have vector x = [1 2 3 4 5 6], after its convolution with the Haar wavelet-function h = [1 1] we obtain the vector dimension of 6 + 2 - 1 = 7.

When I use dwt2 for an image 512 * 512 I get four matrices 256 * 256. So the convolution does not affect the dimension. The main reason why i get 256 * 256 is downsampling.

2) I was trying to understand the source code of dwt2, as the developers have implemented it, but do not quite understand the principle. Confuse such things as the function wextend, convdown and variables dwtEXTM, sizeEXT.

Please explain in some words the convolution algorithm without changing the dimension of output signal / image. Code examples are not excess =))

Thx!

Wayne King

unread,
Nov 4, 2011, 8:19:14 AM11/4/11
to
"Alex " <ind...@i.ua> wrote in message <j8uqmu$757$1...@newscl01ah.mathworks.com>...
Hi Alex, I agree dwt2() is great.

The theory of the DWT uses infiinite signals (images). When you have to implement convolution with finite length signals (images), then you run into problems.

The convolution asks for x(-1) for example. The wavelet (and scaling) filters are finite-length so the problem is not in the middle of the signal (image), the problem comes at the ends (edges).

wextend() extends the image to handle this border distortions. The length of the filter you use and the value of dwtmode affect how this extension is done and what the length of the extension is.

Wayne

Alex

unread,
Nov 6, 2011, 4:45:30 PM11/6/11
to

> Hi Alex, I agree dwt2() is great.
>
> The theory of the DWT uses infiinite signals (images). When you have to implement convolution with finite length signals (images), then you run into problems.
>
> The convolution asks for x(-1) for example. The wavelet (and scaling) filters are finite-length so the problem is not in the middle of the signal (image), the problem comes at the ends (edges).
>
> wextend() extends the image to handle this border distortions. The length of the filter you use and the value of dwtmode affect how this extension is done and what the length of the extension is.
>
> Wayne

I think I understood how it works)
Your answer and source core of dwt2 helped me)
0 new messages