b'How geophysics ruined musicFeatureRather than calculate this autocorrelation at other lags and then identify the pitch, the assumption is made that the pitch has not changed, to confirm this we just need to calculate the autocorrelation value at a lag equal to the period LLH i ( L ) =x j x jL (4)j=0The value at the next sample is then simply involves taking the previous value H i1 (L) subtracting the value from the start of the previous window x iL x i2Land adding the value from the end of the new window x i x iL .H i ( L ) =H i1 ( L ) x iL x i2L +x i x iL (5)If we only calculate the autocorrelation over a range of lags equal Figure 5.(a) An original audio signal with the boundary of each periodto twice the period then the autocorrelation value at a lag value indicated by the red lines. (b) A spectrogram of the same signal with time windowsequal to the period will be half that at the zero lag. This is illustrated equal is size. (c) The signal after the length of each period has been equalised. in Figure 7a which shows three waves with periods equal to 0.9 (red line), 1 (blue line) and 1.1 (green line) seconds. Figure 7b shows the Additionally, the autocorrelation value at any lag value approachesautocorrelations of these three waves, note how at a lag of 1 s the the value at t=0 only if the lag is a multiple of the period. autocorrelation of the blue wave is exactly half the zero lag value The autocorrelation can therefore be used to track for thewhilst the values of the other two waves are lower. If this condition periodicity (pitch) of signals but computing the autocorrelationis met then the frequency has not changed.is compute intensive. Mathematically, the auto-correlation ofIn his patent Hildebrand describes two methods for applying a signal with a finite length L at lag n is given by sum of thehis algorithm, the first is referred to as detection mode. In piecewise multiplication of the original signal and the signalthis mode the autocorrelation is calculated at 109 lag values after being shifted by n samples ranging from 0.36 to 19.9 ms (50.1 to 2,756Hz) and the peak L value of the autocorrelation across the lags used to determineL (n)=x j x jn (1) the frequency. For example, in Figure 7 the peak of the first lobe j=0 of the autocorrelation of the red curve occurs at a lag of ~0.91 s which is the period of the data. The other mode correction The peak of the autocorrelation (n=0) is the energy of the signalrequires the pitch to be continuously tracked, to reduce the which is the sum of the sample amplitudes x jsquared. In thiscomputational effort required the range of L values is shifted so case we limit ourselves to calculating the peak autocorrelationthat it is constrained by the previous pitch. Figure 8 shows how value over two periods L of the data this technique can be applied to calculate the instantaneous frequency of a vibroseis sweep overlain on a conventional spectrogram, the jitter at the end of the trace is due to issues 2LE i ( L ) =x2(2) with the sampling interval.jj=0 Correction mode can be used to either snap the detected frequency to the closest note or to match the frequency As we move along the signal lags we only need to take the valuewith an input signal. This mode works by checking the for the previous window E i1 (L) subtract the first value fromratio between the zero-autocorrelation value and the value the current window x2and add the next value outside theat a lag equal to the period of the previous sample, if the current window x2. 2L ratio differs significantly from a threshold value then the i correction is initiated. The correction works by calculating E i ( L ) =E i1 ( L ) x2 +x2(3) the autocorrelation at a larger range of lag values to identify 2L i the new frequency. Rather than use the new frequency Figure 6.(a) A sine wave with a period equal to 1s. (b) The autocorrelation of the sine wave, note how the amplitude of the autocorrelation at a lag of 0s isFigure 7.(a) Three sine waves with periods of 0.9s (red), 1s (blue) and 1.1s equal to that at multiples of the period (1 s, 2 s,). (green). (b)Shows the autocorrelations of the three signals.45 PREVIEW APRIL 2022'