Posted: September 1st, 2015
Algorithm Description
An input audio signal s(n) is to be analysed at regular time intervals – this is 512 samples in our case when using the sampling frequency Fs=48kHz. At a given time ‘n’, calculate the autocorrelation function using the previous N (set to 4096) samples of the signal as:
Set the values of ‘k’ from 40 to 500. Start calculating the autocorrelation function rn(k) the first time at then sample n=4596 and then at sample 5108, 5620, etc.
For a given ‘n’, find the first peak of the autocorrelation function in the above range of ‘k’, which has the normalised autocorrelation value rn(k)/rn(0) above 0.7. If such peak does exist, find the index of that peak, which we denote by Dn. The estimate of the pitch at time ‘n’ is then Pn=Fs/Dn. If there is no normalised autocorrelation peak value above 0.7, set Pnto 0.
Display the value of Pnusing LEDs such that a different LED is lit when the value is in intervals (0-50), (51-200), (201-400), (401-600), (601-800), (801-1000), and (1001-1200).
Looking for the best essay writer? Click below to have a customized paper written as per your requirements.
Place an order in 3 easy steps. Takes less than 5 mins.