Enhanced Autocorrelation

Feedback and Reviews for Audacity 2.x
Forum rules
This board is ONLY for general feedback and discussion about Audacity 2.X.

If you require help, or think you have found a "bug", please post on the forum board relevant to your operating system.
Mac OS X
GNU/Linux and Unix-like
Post Reply
Posts: 1
Joined: Fri Mar 16, 2018 1:30 pm
Operating System: Windows 7

Enhanced Autocorrelation

Post by matiasH » Fri Mar 16, 2018 2:00 pm

I'm working as an accoustic engineer for Rocket Science and thus often use Audio Analysis. I recently discovered the feature of the enhance autocorrelation and realized, that it gives very exactinformation about the Frequencies, so I dug a little to implement this feature in my own programs. While checking if my code works properly, I ralized that my solution is a little off to the one that audacity proposes. At first I thought that this is an error on my side, but now I'm not so sure anymore. The reason for this ist, because For this particular file I tested it, there is a peak at about 35Hz in my program for both, the FFT and the enhance autocorrelation, in audacity, the FFT also shows the peak at about 35Hz but the enhanced autocorrelation shows one at about 40Hz. So either I missunderstood something completely about this enhanced autocorrelation or I guess there is a small bug in your version (maybe an indexing mistake that shifts autocorrelation?).

I used Audacity version 2.2.1 on Windows 7.
I uploaded the audio file I used on: https://wetransfer.com/downloads/7d1895 ... 559/55e611
I made screenshots of the enhanced autocorrelation and the spectrum from both, Audacity and my octave script (and since it is sometimes difficult to see the exact values underlined the peak frequencies with red).
enhanced autocorrelation.PNG
Enhanced autocorrelation Audacity
enhanced autocorrelation.PNG (37.36 KiB) Viewed 538 times
Spectrum Audacity
Spectrum.PNG (54.64 KiB) Viewed 538 times
Spectrogram Octave
spectrogram-octave.PNG (155.75 KiB) Viewed 538 times
Enhanced Autocorrelation Octave
enhancedAutocorrelation-octave.PNG (43.18 KiB) Viewed 538 times

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

Re: Enhanced Autocorrelation

Post by steve » Fri Mar 16, 2018 2:37 pm

Hi matiasH,
As can be seen from the track spectrogram, it is going to be difficult to get a single figure for the frequency because the frequency is not constant:
spectrogram.png (232.1 KiB) Viewed 532 times
These are the settings that I used (note that these settings are very slow)
settings.png (106.27 KiB) Viewed 532 times
I'm certainly no expert on autocorrelation, but I'm aware there are a number of different implementations. Audacity's implementation can be found here: https://github.com/audacity/audacity/bl ... ectrum.cpp

For your "engineering" use case, it may be better to just export the raw FFT data from Plot Spectrum, and the apply your own analytical model to the data (perhaps in a spreadsheet). Exporting the data is described in the manual: http://manual.audacityteam.org/man/plot_spectrum.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply