python - YIN algorithm to find fundamental frequency -


i try find fundamental frequency several algorithms.

i found yin algorithm(http://audition.ens.fr/adc/pdf/2002_jasa_yin.pdf)

i follow steps , write code.

the autocorrelation function document is:

enter image description here

and expected graph :

enter image description here

so sample code is:

def auto(lag, samples):     window_size = 1100     total_index = len(samples)     zero_padded = np.append(samples, np.zeros(window_size))     corr = []     t in range(total_index):         r = 0         j in range(t+1, t+window_size):             r += zero_padded[j] * zero_padded[j+lag]         corr.append(r)      plt.plot(corr)     plt.show() 

but got graph: enter image description here zoomed

how should edit code?


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -