Monday, January 6, 2020

audio - How to deal with low fundamental when using AMDF for pitch extraction?


I am using the Average Magnitude Difference Function to estimate the fundamental frequency of a quasi-periodic audio signal. The AMDF is defined as


$$ D_n = \frac{1}{N-n}\sum_{k=n}^{N-1}|S_k - S_{k-n}| $$


where $N$ is the length of the signal. This function exhibits a minimum when the signal is shifted by an amount equal to its period.



This is the code I am using to extract the pitch (in Matlab):


 a = amdf(f);
a = a/max(a);
[p l] = findpeaks(-a, 'minpeakprominence', 0.6);
pitch = round(sample_freq/l(1);

However, I am dealing with an audio signal where the fundamental frequency is very low:


spectrum of the audio signal


As a consequence, a pitch doubling problem arises: the detected minimum corresponds to half the period of the signal (i.e. the second harmonic):


AMDF of the signal above



I tried to extract the largest peak and not just the first, but sometimes this problem remains. How can I improve my code and/or the AMDF function in order to deal with low fundamental?




No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...