Thread Subject: Wavelets, convolution, dwt2

Subject: Wavelets, convolution, dwt2

From: Alex

Date: 3 Nov, 2011 19:40:14

Message: 1 of 3

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!

Subject: Wavelets, convolution, dwt2

From: Wayne King

Date: 4 Nov, 2011 12:19:14

Message: 2 of 3

"Alex " <indi_88@i.ua> wrote in message <j8uqmu$757$1@newscl01ah.mathworks.com>...
> 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!

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

Subject: Wavelets, convolution, dwt2

From: Alex

Date: 6 Nov, 2011 21:45:30

Message: 3 of 3


> 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)

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
wavelet convolu... Alex 3 Nov, 2011 15:44:29
rssFeed for this Thread

Contact us at files@mathworks.com