Non-linear distance based filter