From: anant on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <hjn9ng$lhi$1(a)fred.mathworks.com>...
> "anant " <anantvu(a)gmail.com> wrote in message <hjkqr8$md9$1(a)fred.mathworks.com>...
> > HI Wayne, what i mean is that I am not able to understand the function which is given in help files. So it would be nice if i could write a simpler function by myself for this purpose.
>
> Hi Anant, just to give you an illustration for a simple wavelet filter, the Haar, let:
>
> x = [ 1 4 1 1; 1 1 1 1; 1 1 1 1; 1 1 1 1];
> % First compute level-1 2D-DWT using the Haar in Matlab
> [cA,cH,cV,cD] = dwt2(x,'haar');
> % Next let
> H = [1/sqrt(2) 1/sqrt(2) 0 0; 0 0 1/sqrt(2) 1/sqrt(2)];
> G = [1/sqrt(2) -1/sqrt(2) 0 0; 0 0 1/sqrt(2) -1/sqrt(2)];
> % Now look at
> ApproxCoeffs = H*x*H';
> % compare the above to cA. Next compute
> VerticalDetails = H*x*G';
> % compare the above to cV. Next compute
> HorizDetails = G*x*H';
> %compare the above to cH. Finally, compute
> DiagDetails = G*x*G';
>
>
> If you divide the matrix x into 2x2 block matrices
>
> C{1}=[1 4; 1 1]; C{2}=[1 1; 1 1]; C{3}=[1 1; 1 1]; C{4}= [1 1; 1 1];
>
> You'll see that ApproxCoeffs is 2x2 matrix where the (1,1) element is proportional to the average of all the elements in C{1} and so on for the other blocks.
>
> Then look at VerticalDetails. The (1,1) element is proportional to the difference between the two columns of C{1} and so on for the other blocks.
>
> HorizDetails is the same as above except the differences are between the rows. DiagDetails-- the same as above except the differences are between elements on the diagonals.
>
> Hope that helps,
> Wayne
>
Thanks a lot, Wayne. I will check up with what u said and inform u the results. Where r u from?