Two algorithms to detect the fundamental frequency of a signal: one in the time domain (Autocorrelation) and one in the frequency domain (Harmonic Product Spectrum / HPS)

Autocorrelation algorithm

Theory

Fundamentally, this algorithm exploits the fact that a periodic signal, even if it is not a pure sine wave, will be similar from one period to the next. This is true even if the amplitude of the signal is changing in time, provided those changes do not occur too quickly.

To detect the pitch, we take a window of the signal, with a length at least twice as long as the longest period that we might detect. In our case, this corresponded to a length of 1200 samples, given a sampling rate of 44,100 KHz.

Using this section of signal, we generate the autocorrelation function r(s) defined as the sum of the pointwise absolute difference between the two signals over some interval, perhaps 600 points.

Graphically, this corresponds to the following:

Intuitively, it should make sense that as the shift value s begins to reach the fundamental period of the signal T, the difference between the shifted signal and the original signal will begin to decrease. Indeed, we can see this in the plot below, in which the autocorrelation function rapidly approaches zero at the fundamental period.

We can detect this value by differentiating the autocorrelation function and then looking for a change of sign, which yields critical points. We then look at the direction of the sign change across points (positive difference to negative), to take only the minima. We then search for the first minimum below some threshold, i.e. the minimum corresponding to the smallest s. The location of this minimum gives us the fundamental period of the windowed portion of signal, from which we can easily determine the frequency using

Fast-autocorrelation

Clearly, this algorithm requires a great deal of computation. First, we generate the autocorrelation function r(s) for some positive range of s. For each value of s, we need to compute the total difference between the shifted signals. Next, we need to differentiate this signal and search for the minimum, finally determining the correct minimum. We must do this for each window.

In generating the r(s) function, we define a domain for s of 0 to 599. This allows for fundamental frequencies between about 50 and 22000 Hz, which works nicely for human voice. However, this does require calculating r(s) 600 times for each window.

Questions & Answers

where we get a research paper on Nano chemistry....?

Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest.
Rafiq

Rafiq

what is differents between GO and RGO?

Mahi

what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.?
How this robot is carried to required site of body cell.?
what will be the carrier material and how can be detected that correct delivery of drug is done
Rafiq

Rafiq

if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION

Anam

analytical skills graphene is prepared to kill any type viruses .

Anam

Any one who tell me about Preparation and application of Nanomaterial for drug Delivery

The nanotechnology is as new science, to scale nanometric

brayan

nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale

Damian

Is there any normative that regulates the use of silver nanoparticles?