>   

>    with(linalg):
with(plots):

First, we develop the FWT for the Haar wavelet

>    H8 := evalm( 1/2 * matrix(8,8,[
 1, 0, 0, 0,  1, 0, 0, 0,
1, 0, 0, 0, -1, 0, 0, 0,
 0, 1, 0, 0,  0, 1, 0, 0,
 0, 1, 0, 0,  0,-1, 0, 0,
 0, 0, 1, 0,  0, 0, 1, 0,
 0, 0, 1, 0,  0, 0,-1, 0,
 0, 0, 0, 1,  0, 0, 0, 1,
 0, 0, 0, 1,  0, 0, 0,-1]));

H4 := diag(
evalm(1/2 *
matrix(4,4,[ 1, 0,  1, 0,
             1, 0, -1, 0,
             0, 1,  0, 1,
             0, 1,  0,-1])),
diag(1$4));

H2 := diag(
evalm(1/2 *
matrix(2,2,[1,  1,
            1, -1])),
diag(1$6));

H8 := matrix([[1/2, 0, 0, 0, 1/2, 0, 0, 0], [1/2, 0, 0, 0, -1/2, 0, 0, 0], [0, 1/2, 0, 0, 0, 1/2, 0, 0], [0, 1/2, 0, 0, 0, -1/2, 0, 0], [0, 0, 1/2, 0, 0, 0, 1/2, 0], [0, 0, 1/2, 0, 0, 0, -1/2, 0], [0, ...

H4 := matrix([[1/2, 0, 1/2, 0, 0, 0, 0, 0], [1/2, 0, -1/2, 0, 0, 0, 0, 0], [0, 1/2, 0, 1/2, 0, 0, 0, 0], [0, 1/2, 0, -1/2, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, ...

H2 := matrix([[1/2, 1/2, 0, 0, 0, 0, 0, 0], [1/2, -1/2, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, ...

>    Haar_Wavelet_Transform := evalm( H8 &* H4 &* H2 );

Haar_Wavelet_Transform := matrix([[1/8, 1/8, 1/4, 0, 1/2, 0, 0, 0], [1/8, 1/8, 1/4, 0, -1/2, 0, 0, 0], [1/8, 1/8, -1/4, 0, 0, 1/2, 0, 0], [1/8, 1/8, -1/4, 0, 0, -1/2, 0, 0], [1/8, -1/8, 0, 1/4, 0, 0, 1...

>   

>   

Now:
 do the same analysis for
My Wavelet from Problem 1

>    alias( h0 = (1+sqrt(10))/4 );
alias( h1 = (1/2+sqrt(10))/4 );
alias( h2 = (1-sqrt(10))/4 );
alias( h3 = (1/2-sqrt(10))/4 );

T8 := evalm( 1/sqrt(2) * matrix(8,8,[
h0,  h1,  h2,  h3,   0,   0,   0,   0,
0,   0,  h0,  h1,  h2,  h3,   0,   0,
0,   0,   0,   0,  h0,  h1,  h2,  h3,
h2,  h3,   0,   0,   0,   0,  h0,  h1,
h3, -h2,  h1, -h0,   0,   0,   0,   0,
0,   0,  h3, -h2,  h1, -h0,   0,   0,
0,   0,   0,   0,  h3, -h2,  h1, -h0,
h1, -h0,   0,   0,   0,   0,  h3, -h2
]));

T4 := diag(
evalm(1/sqrt(2) *
matrix(4,4,[ h0,  h1,  h2,  h3,
             h2,  h3,  h0,  h1,
            h3, -h2,  h1, -h0,
             h1, -h0,  h3, -h2])),
diag(1$4));

T2 := diag(
evalm(1/sqrt(2) *
matrix(2,2,[h0+h2, h1+h3,
            h3+h1,-h0-h2])),
diag(1$6));

h0, h1, h2, h3

h0, h1, h2, h3

h0, h1, h2, h3

h0, h1, h2, h3

T8 := matrix([[1/2*2^(1/2)*h0, 1/2*2^(1/2)*h1, 1/2*2^(1/2)*h2, 1/2*2^(1/2)*h3, 0, 0, 0, 0], [0, 0, 1/2*2^(1/2)*h0, 1/2*2^(1/2)*h1, 1/2*2^(1/2)*h2, 1/2*2^(1/2)*h3, 0, 0], [0, 0, 0, 0, 1/2*2^(1/2)*h0, 1/...

T4 := matrix([[1/2*2^(1/2)*h0, 1/2*2^(1/2)*h1, 1/2*2^(1/2)*h2, 1/2*2^(1/2)*h3, 0, 0, 0, 0], [1/2*2^(1/2)*h2, 1/2*2^(1/2)*h3, 1/2*2^(1/2)*h0, 1/2*2^(1/2)*h1, 0, 0, 0, 0], [1/2*2^(1/2)*h3, 1/2*2^(1/2)*(-...

T2 := matrix([[1/4*2^(1/2), 1/8*2^(1/2), 0, 0, 0, 0, 0, 0], [1/8*2^(1/2), -1/4*2^(1/2), 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, ...

>    # W8 is the discrete Wavelet transform matrix

W8 := simplify(evalm( T2 &* T4 &* T8 ));

W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...
W8 := matrix([[49/512*2^(1/2)+3/256*5^(1/2), 89/1024*2^(1/2)+3/256*5^(1/2), 9/512*2^(1/2)+1/256*5^(1/2), 9/1024*2^(1/2)-1/256*5^(1/2), -31/512*2^(1/2)+3/256*5^(1/2), -71/1024*2^(1/2)+3/256*5^(1/2), 9/5...

>    v1 := [1,0,0,0, 0,0,0,0];
Hx := evalm( Haar_Wavelet_Transform &* v1 ):
matrix(8,1, (i,j) -> Hx[i] );

v1 := [1, 0, 0, 0, 0, 0, 0, 0]

matrix([[1/8], [1/8], [1/8], [1/8], [1/8], [1/8], [1/8], [1/8]])

>    Wx := evalm( W8 &* v1 ):
matrix(8,1, (i,j) -> Wx[i] );

matrix([[49/512*2^(1/2)+3/256*5^(1/2)], [117/512*2^(1/2)-1/256*5^(1/2)], [-1/64-1/64*10^(1/2)], [-1/64+7/64*10^(1/2)], [-1/16*2^(1/2)*(-1+2*2^(1/2)*5^(1/2))], [0], [0], [1/16*2^(1/2)*(1+2*2^(1/2)*5^(1/...

>    v2 := [1,1,1,1, 1,1,1,1];
Hx := evalm( Haar_Wavelet_Transform &* v2 ):
matrix(8,1, (i,j) -> Hx[i] );
Wx := evalm( W8 &* v2 ):
matrix(8,1, (i,j) -> Wx[i] );

v2 := [1, 1, 1, 1, 1, 1, 1, 1]

matrix([[1], [0], [1/2], [-1/2], [3/4], [-1/4], [1/4], [-3/4]])

matrix([[27/256*2^(1/2)], [-9/256*2^(1/2)], [-3/32], [-3/32], [-1/16*2^(1/2)*(-1+2*2^(1/2)*5^(1/2))+1/8*2^(1/2)*(-1+2^(1/2)*5^(1/2))+1/16*2^(1/2)*(1+2*2^(1/2)*5^(1/2))-1/8*2^(1/2)*(1+2^(1/2)*5^(1/2))],...

>    v3 := [1,-1,1,-1, 1,-1,1,-1];
Hx := evalm( Haar_Wavelet_Transform &* v3 ):
matrix(8,1, (i,j) -> Hx[i] );
Wx := evalm( W8 &* v3 ):
matrix(8,1, (i,j) -> Wx[i] );

v3 := [1, -1, 1, -1, 1, -1, 1, -1]

matrix([[3/4], [-1/4], [-3/4], [1/4], [1/2], [-1/2], [0], [1]])

matrix([[9/256*2^(1/2)], [-3/256*2^(1/2)], [-1/32], [-1/32], [-1/16*2^(1/2)*(-1+2*2^(1/2)*5^(1/2))-1/8*2^(1/2)*(-1+2^(1/2)*5^(1/2))+1/16*2^(1/2)*(1+2*2^(1/2)*5^(1/2))+1/8*2^(1/2)*(1+2^(1/2)*5^(1/2))], ...

>    v4 := [1,1,1,1, -1,-1,-1,-1];
Hx := evalm( Haar_Wavelet_Transform &* v4 ):
matrix(8,1, (i,j) -> Hx[i] );
Wx := evalm( W8 &* v4 ):
matrix(8,1, (i,j) -> Wx[i] );

v4 := [1, 1, 1, 1, -1, -1, -1, -1]

matrix([[0], [1], [-1/2], [1/2], [-1/4], [3/4], [-3/4], [1/4]])

matrix([[5/16*2^(1/2)+3/64*5^(1/2)], [15/16*2^(1/2)+9/64*5^(1/2)], [5/2-3/16*10^(1/2)], [-5/2+3/16*10^(1/2)], [-1/16*2^(1/2)*(-1+2*2^(1/2)*5^(1/2))+1/8*2^(1/2)*(-1+2^(1/2)*5^(1/2))+1/16*2^(1/2)*(1+2*2^...

>