%



% This file is a part of CS 515, assignment 4. You do not have



% permission to distribute this file to people outside of the



% course. 



%



% 



% 



%%%%%%%%



% 1st test: Haar:



f = [1/sqrt(2), 1/sqrt(2)];



r = ( (-1).^(1:length(f)) ).*f;



r = [f; r(length(r):-1:1)];



% now rescale so the sum of absolute values is 1, not sqrt(2):



r = r/sqrt(2);



display('Testing 1st matrix of masks');



checkIfTight(r)



%%%%%%%%%%



% 2nd test: Daub 4:



f = [   .482962913145   .836516303738   ...

      .224143868042   -.129409522551  ];



r = ( (-1).^(1:length(f)) ).*f;



r = [f; r(length(r):-1:1)];



r = r/sqrt(2);



display('Testing 2nd matrix of masks');



checkIfTight(r)



%%%%%%%%%%



% 3rd test: Daub 6:



f = [   .332670552950   .806891509311   ...

      .459877502118   -.135011020010  ...

      -.085441273882  .035226291882   ];



r = ( (-1).^(1:length(f)) ).*f;



r = [f; r(length(r):-1:1)];



r = r/sqrt(2); 



display('Testing 3rd matrix of masks');



checkIfTight(r)



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



% From now on, who knows whether the conditions are satisfied or



% not?



%%%%%%%%%%%



% 4th test:



a = [1/64*(1-sqrt(5))* ...

      [2, 5 - sqrt(5), -4*sqrt(5), -10 - 6*sqrt(5), ...

	-10 - 4*sqrt(5), -3 - sqrt(5); 

    3 + sqrt(5), -10 - 4*sqrt(5), 10 + 6*sqrt(5), ...

	- 4*sqrt(5), -5 + sqrt(5),2];



  sqrt(5)/16*[-1, 0, 2,0, -1, 0];



  sqrt(5)/16*[0,-1,0, 2, 0, -1]];



display('Testing 4th matrix of masks');



checkIfTight(a)



%%%%%%%%%%%



% 5th test:



a = [1/64*(1-sqrt(5))* ...

      [2, 4 - sqrt(5), -4*sqrt(5), -10 - 6*sqrt(5), ...

	-10 - 4*sqrt(5), -3 - sqrt(5); 

    3 + sqrt(5), -10 - 4*sqrt(5), 10 + 6*sqrt(5), ...

	- 4*sqrt(5), -4 + sqrt(5),2];



  sqrt(5)/16*[-1, 0, 2,0, -1, 0];



  sqrt(5)/16*[0,-1,0, 2, 0, -1]];



display('Testing 5th matrix of masks');



checkIfTight(a)



%%%%%%%%%%%



% 6th test:



a = [1/64*(1-sqrt(5))* ...

      [2, 4 - sqrt(5), -4*sqrt(5), -10 - 6*sqrt(5), ...

	-10 - 4*sqrt(5), -3 - sqrt(5); 

    3 + sqrt(5), -10 - 4*sqrt(5), 10 + 6*sqrt(5), ...

	- 4*sqrt(5), -5 + sqrt(5),2];



  sqrt(5)/16*[-1, 0, 2,0, -1, 0];



  sqrt(5)/16*[0,-1,0, 2, 0, -1]];



display('Testing 6th matrix of masks');



checkIfTight(a)



%%%%%%%%%%%



% 7th test:



a = [1/64*(1-sqrt(5))* ...

      [2, 5 - sqrt(5), -4*sqrt(5), -10 - 6*sqrt(5), ...

        -10 - 4*sqrt(5), -3 - sqrt(5); 

    3 + sqrt(5), -10 - 4*sqrt(5), 10 + 6*sqrt(5), ...

        - 4*sqrt(5), -5 + sqrt(5),2];



  sqrt(5)/16*[sqrt(2), 0, 2,0, sqrt(2), 0];



  sqrt(5)/16*[0,0 ,0, 2, 0, 0]];



display('Testing 7th matrix of masks');



checkIfTight(a)



