// filtre triangulaire
function result = triangleFilter(value)

  if (value < 0.0) 
    value = -value;
  end;

  if (value < 1.0) 
    result = 1.0 - value;
  else
    result = 0.0; 
  end;

endfunction;