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

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:

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

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

how does economics define me
clement Reply
what are the factors that determines the demand and supply
sillah
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
Zuko
is the action of inflating something
Abdifatah
inflation is the persistent increase in general price level of goods and services in an economy over a considerable period of time .
Tetteh
inflation is the general increase of a commodity in a particular period of time.
Turay
inflation is a general increase in price levels of commodities
shehu
what are the types of inflation?
Ebrima
inflation is the period of persistent rise in the general level of the price of goods services over time
Emmanuel
we have creeping inflation, demand pull inflation ,cost push inflation, and galloping inflation .
Emmanuel
how can a location of a firm create difference between producers
joy Reply
what is monetary policy
joy
hello
Abdifatah
is a monetary from policy that's authorized of country encharces
Abdifatah
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
Alie
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
olajumoke
what covers macro economics.
Fayaz
Essay about Microsoft
Kwena Reply
what is economics
Julie Reply
what do you mean by means in economics
Julie
economic is the wealth of a country.
Moussa
monetary policy is refer to as being expansionary or contractionary.
Abdul
pls who can help me to explain money market and capital market
Au
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...
Muhammad
money market is a market were short term loans are dealt with while capital market is a market were long term loans are traded
Ebrima
What is mean by monetory policy
Lovely
monetary polices are rules that control the rate of monetary exchange in an economic as a whole.
Ebrima
wealth of the nation
Uhara
important of unemployment
Otwe Reply
Important of unemployed
Otwe
important?
Aneela
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?

Ask