Autocorrelation and cross-correlation | Algorithms | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Autocorrelation and cross-correlation
June 11, 2016 - 3:23 pm
Member Since: September 12, 2013
Forum Posts: 43
sp_UserOfflineSmall Offline

Hi Will,

I am looking for a fast algorithm to measure auto- and crosscorrelation of audio signals. Do you have an idea or a good example (float would be great). Is it necessary to window the sample blocks (Hamming etc.) like in FFT ?
Another question regarding autocorrelation is:
If I have a sample buffer of let's say 512 samples is it necessary to have the following buffer to do the autocorrelation for this buffer or not?
(I presume that the lower frequency range of my measurement will be limited by the buffer size - but this is ok).

thanks for help

kind regards


June 14, 2016 - 12:39 am
Member Since: January 29, 2017
Forum Posts: 698
sp_UserOfflineSmall Offline

Hi Peter

I don't have much experience in auto/cross correlation with moving signals (music signals), only fixed buffers of captured data for analysis (on a project I worked on involving a video geometry correction IC for National Semiconductor) so windowing was not needed. I am guessing you are doing beat or pitch detection here and unfortunately I don't have any C++ code ready for that. You can also do autocorrelation with FFT and IFFTs so on a moving signal I would guess that windowing would be appropriate. Sorry I don't have a better answer for you.

- Will

June 14, 2016 - 10:21 pm
Member Since: September 12, 2013
Forum Posts: 43
sp_UserOfflineSmall Offline

Hi Will

thanks for your reply. I found a small peace of code wich seems to work. Your guess is right, I use autocorrelation to find out when a trigger signal (2k eg.) is in my incoming audio buffer. I don't have much experience in autocorrelation either - and my buffer is small to keep the delay low - so I have to play a little bit with my settings. If you are interested in this subject - I spotted an interesting PDF in the net : YIN, a fundamental frequency estimator (easy to google). I read that Paul Stoffregen (from teensy) uses this algorithm for his pitch estimation routine.

kind regards


Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

StevieD: 46

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

Nickolai: 43

clau_ste: 39

jeanlecode: 37

Member Stats:

Guest Posters: 2

Members: 786

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 853

Posts: 3385

Moderators: W Pirkle: 698