I am looking for an algorithm that can match the saved pattern to the current pattern even if it is not exactly the same. For example, the saved pattern x
is 0, 400, 900, 1500, 2000
and the current pattern y
is 0, 300, 800, 1300, 1800
.
Is there an algorithm that can match x
and y
even if they are not an exact match?
Or do I need to apply a set of distances that if the difference of the x
and y
is <=
to the distance, then set to true
otherwise false
?
This is a knock detecting door lock. The value of x
and y
is the time interval between the knocks. I want an algorithm that can approximate the current pattern to the saved pattern even if it is not an exact match. Because it's hard to repeat the same knock with a specific time interval of your knocks.