<< Chapter < Page Chapter >> Page >
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


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:

Shifting the signal

Here, the blue signal is the original and the green signal is a copy of the original, shifted left by an amount nearing the fundamental period. Notice how the signals begin to align with each other as the shift amount nears the fundamental period.

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.

Autocorrelation function

The fundamental period is indentified as the first minimum of the autocorrelation function. Notice that the function is periodic, as we expect. r(s) measured the total difference between the signal and its shifted copy, so the shifs approach k*T, the signals again align and the difference approaches zero.

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


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

how does economics define me
clement Reply
what are the factors that determines the demand and supply
what are the importance of Economics
Betty Reply
tell me something very important about economics..
Fayaz Reply
how may I solve arithmetic mean ,,,all example
Cee Reply
what is agriculture
Itoe Reply
simple method of understanding cost concept
Oludare Reply
what is inflation
Christiana Reply
Inflation is a general increase in price levels
is the action of inflating something
inflation is the persistent increase in general price level of goods and services in an economy over a considerable period of time .
inflation is the general increase of a commodity in a particular period of time.
inflation is a general increase in price levels of commodities
what are the types of inflation?
inflation is the period of persistent rise in the general level of the price of goods services over time
we have creeping inflation, demand pull inflation ,cost push inflation, and galloping inflation .
how can a location of a firm create difference between producers
joy Reply
what is monetary policy
is a monetary from policy that's authorized of country encharces
What would you say about the the mobility of enterprise as a factor of production?
Cathryn Reply
how can I connect myself to this Ambrose platform
kanu Reply
I am good and you I am from sierra Leone and I am new her
kanu Reply
u are welcome bro, here is a good platform for you to be
That i know,thanks bro.
what the main definition of economic
Uhara Reply
the main definition is given by prof Lionel Robbins as a social science which studies human behavior between ends and scarce which have alternative uses
what covers macro economics.
Essay about Microsoft
Kwena Reply
what is economics
Julie Reply
what do you mean by means in economics
economic is the wealth of a country.
monetary policy is refer to as being expansionary or contractionary.
pls who can help me to explain money market and capital market
money market is base on short term loan which is within one year period while capital market is long term loan more than one year...
money market is a market were short term loans are dealt with while capital market is a market were long term loans are traded
What is mean by monetory policy
monetary polices are rules that control the rate of monetary exchange in an economic as a whole.
wealth of the nation
important of unemployment
Otwe Reply
Important of unemployed
While the American heart association suggests that meditation might be used in conjunction with more traditional treatments as a way to manage hypertension
Beverly Reply
in a comparison of the stages of meiosis to the stage of mitosis, which stages are unique to meiosis and which stages have the same event in botg meiosis and mitosis
Leah Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Ece 301 projects fall 2003. OpenStax CNX. Jan 22, 2004 Download for free at http://cnx.org/content/col10223/1.5
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 301 projects fall 2003' conversation and receive update notifications?