function [amdf] = twosignalAMDF(y1, y2) 
  
    pocet_vzorku_okna = length(y1);
    
    for shift = 0:1:pocet_vzorku_okna-1
        
        for j = 1:pocet_vzorku_okna-shift            
                
            rozdil(j,shift+1) = (y1(j+shift)-y2(j));
                        
        end
        
        amdf(shift+1) = sum( (abs(rozdil(:,shift+1)))/(pocet_vzorku_okna-shift) );
        
        
     end   
    
end