YIN algorithm