riadok1 = 0; riadok2 = 0; riadok3 = 0;
riadok4 = 0; riadok5 = 0; riadok6 = 0;
[hh,gg,h,g] = wfilters('Db1');

riadok1(1,1) = roundn(sum(h),-4); riadok1(2,1) = roundn(sqrt(2),-4); 

for k = 0:size(h,2);
    h1 = zeros(1,size(h,2)*3); 
    h1(1,1 + size(h,2):size(h,2)*2) = h;
    h2 = zeros(1,size(h,2)*3);  
    h2(1,2*k+1:2*k+size(h,2)) = h;
    riadok2(k+1) = roundn(sum(h1.*h2),-4);
end;   

h1 = zeros(1,size(h,2)/2); 
h1(1,1:size(h,2)/2) = h(1,1:2:size(h,2));
h2 = zeros(1,size(h,2)/2);  
h2(1,1:size(h,2)/2) = h(1,2:2:size(h,2));
riadok3(1) = roundn(sum(h1),-4); 
riadok3(2) = roundn(sum(h2),-4);

riadok4(1,1) = roundn(sum(g),-4); riadok4(2,1) = 0;

h1 = zeros(1,size(h,2)); % M = size(h,2);
h1(1, size(h,2) : -1: 1) = h;
h2 = zeros(1,size(h,2)); 
h2(1,1:2:size(h,2)) = ones(1,round((size(h,2))/2));
h2 = h2.*2-1;
riadok5 = zeros(1,size(g,2));
riadok5(1,:) = h1.*h2; riadok5(2,:) = g;

for k = 0:size(h,2);
    h1 = zeros(1,size(h,2)*3); 
    h1(1,1 + size(h,2):size(h,2)*2) = h;
    g1 = zeros(1,size(h,2)*3);  
    g1(1,2*k+1:2*k+size(h,2)) = g;
    riadok6(k+1) = roundn(sum(h1.*g1),-4);
end; 

figure(1); plot(riadok1,'-ob');
figure(2); stem([1:size(riadok2,2)]-round(size(riadok2,2)/2),riadok2);
figure(3); plot(riadok3,'-ob'); 
figure(4); plot(riadok4,'-ob');
figure(5); hold on; plot(riadok5(1,:),'-b'); plot(riadok5(2,:),'--y');
figure(6); stem([1:size(riadok6,2)]-round(size(riadok6,2)/2),riadok6);