I am trying to figure out fundamental frequency of sound
I try to detect fundamental frequency with autocorrelation.
I found this code:
corr = np.correlate(signal, signal, mode='full')
maxcorr = np.argmax(corr)
corr = corr / corr[maxcorr]
corr = corr[corr.size / 2:]
I got this graph from the code above:
index of maximum value is 3145. and my sample rate is 44100.
so... I got fundamental frequency 44100/3145 = 14.02.
This is way too wrong since the sound is Piano C4 which should be around 261Hz.
How can I get fundamental frequency with autocorrelation?
ADDED: