Interpreting Autocorrelation Results

Help for Audacity on macOS.
Forum rules
ImageThis forum is for Audacity on macOS 10.4 and later.
Please state which version of macOS you are using,
and the exact three-section version number of Audacity from "Audacity menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
starlite
Posts: 6
Joined: Thu Jun 11, 2020 6:21 pm
Operating System: macOS 10.13 High Sierra

Interpreting Autocorrelation Results

Post by starlite » Thu Jun 11, 2020 6:40 pm

Hello! I'm using Audacity 2.4.1 for birdsong analysis and I'm hoping to use autocorrelation to get information on key frequencies of the call. I have a couple questions, listed below:

1. Does autocorrelation show the center frequency? If not, what is the difference?

2. What exactly does autocorrelation show? The audacity manual says it is "the key frequencies," does this just mean the most prominent/ the ones with the highest amplitude?

3. I'm attaching some images below, showing the spectrogram and the plots.
the spectrogram:
Screen Shot 2020-06-11 at 11.29.15 AM.png
spectrogram
Screen Shot 2020-06-11 at 11.29.15 AM.png (1.7 MiB) Viewed 185 times
the plot spectrum:
Screen Shot 2020-06-11 at 11.29.38 AM.png
plot spectrum
Screen Shot 2020-06-11 at 11.29.38 AM.png (208.31 KiB) Viewed 185 times
the standard autocorrelation:
Screen Shot 2020-06-11 at 11.30.00 AM.png
standard autocorrelation
Screen Shot 2020-06-11 at 11.30.00 AM.png (157.89 KiB) Viewed 185 times
the enhanced autocorrelation:
Screen Shot 2020-06-11 at 11.30.17 AM.png
enhanced autocorrelation
Screen Shot 2020-06-11 at 11.30.17 AM.png (184.13 KiB) Viewed 185 times
The highest peak I get from the FFT spectrum vs. the autocorrelation spectrum are different -- why is this and which one should I trust?

4. How should I decide what bin size to use for the autocorrelation?

5. Does it matter if I use enhanced vs standard autocorrelation? Is there a possibility of getting skewed results if I choose one and what are some precautions to take?

Thank you so much in advance 8-)

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Interpreting Autocorrelation Results

Post by steve » Thu Jun 11, 2020 6:42 pm

Wikipedia explain autocorrelation better than I can: https://en.wikipedia.org/wiki/Autocorrelation
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

starlite
Posts: 6
Joined: Thu Jun 11, 2020 6:21 pm
Operating System: macOS 10.13 High Sierra

Re: Interpreting Autocorrelation Results

Post by starlite » Thu Jun 11, 2020 10:53 pm

Hi! Thanks for the link! So what I'm getting is an autocorrelation just shows frequencies that reappear many times in a signal?

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Interpreting Autocorrelation Results

Post by steve » Thu Jun 11, 2020 11:13 pm

This is the way that I think of autocorrelation:

Imagine that you have a sine wave, with a frequency of 100 Hz. That waveform has peaks at intervals of 0.01 seconds.
Now imagine that you make a duplicate copy of it, and align the two waveforms one above the other - the two waveforms will exactly correlate.

Now gradually shift the duplicate waveform slowly to the right.
At first the correlation between the two waveforms decreases.
When the duplicate has been shifted (delayed) by 0.005 seconds, the two waveforms are exactly out of phase - peaks in one are where the troughs appear in the other.
But then if you continue shifting the duplicate copy, the peaks gradually start lining up again- correlation is increasing.
When the duplicate has shifted by 0.01 seconds, the peaks once again line up - we have correlation again.

As we continue shifting the duplicate, we see that maximum correlation occurs every 0.01 seconds.
If we draw a graph with the "delay time" on the X axis, and the amount of correlation on the Y axis, we get a graph like this:
(Audacity's other types of autocorrelation are variations of this algorithm, which may show points of interest more clearly, depending on what you are looking for.)

autocorrelation.png
autocorrelation.png (53.98 KiB) Viewed 177 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

starlite
Posts: 6
Joined: Thu Jun 11, 2020 6:21 pm
Operating System: macOS 10.13 High Sierra

Re: Interpreting Autocorrelation Results

Post by starlite » Fri Jun 12, 2020 2:24 am

Hi! Thank you so much, that absolutely clears things up! So autocorrelation doesn't really give information about frequencies, more about the periodicity of a signal?

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Interpreting Autocorrelation Results

Post by steve » Fri Jun 12, 2020 9:31 am

Yes, though if you know the periodicity of a signal, then you know the frequency because frequency = 1/periodicity, or as more commonly stated:
frequency=1/wavelength
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

starlite
Posts: 6
Joined: Thu Jun 11, 2020 6:21 pm
Operating System: macOS 10.13 High Sierra

Re: Interpreting Autocorrelation Results

Post by starlite » Fri Jun 12, 2020 7:09 pm

Oh, awesome that makes so much more sense. Thank you for your help and detailed replies!

starlite
Posts: 6
Joined: Thu Jun 11, 2020 6:21 pm
Operating System: macOS 10.13 High Sierra

Re: Interpreting Autocorrelation Results

Post by starlite » Fri Jun 12, 2020 7:22 pm

Actually! I just wanted to clarify one more thing -- so for the example Autocorrelation spectrum in your post, the maximum correlation occurs every 0.01 seconds. So if the period is 0.01s, the key frequency is 100 Hz? What do the frequency values on the other peaks indicate? Thanks again!

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Interpreting Autocorrelation Results

Post by steve » Sat Jun 13, 2020 9:52 am

starlite wrote:
Fri Jun 12, 2020 7:22 pm
if the period is 0.01s, the key frequency is 100 Hz? What do the frequency values on the other peaks indicate?
They're just multiples of the "key frequency".

starlite wrote:
Thu Jun 11, 2020 6:40 pm
I'm using Audacity 2.4.1 for birdsong analysis and I'm hoping to use autocorrelation to get information on key frequencies of the call
I think that the normal spectrum view (and track spectrogram view) will be more useful.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

starlite
Posts: 6
Joined: Thu Jun 11, 2020 6:21 pm
Operating System: macOS 10.13 High Sierra

Re: Interpreting Autocorrelation Results

Post by starlite » Sat Jun 13, 2020 9:35 pm

Cool, thank you so much for helping me with this! I'll look into the other views you suggested as well. Thanks again!!

Post Reply