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 sp_TopicIcon
Autocorrelation and cross-correlation
No permission to create posts
June 11, 2016
3:23 pm
Forum Posts: 41
Member Since:
September 12, 2013
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
W Pirkle
Forum Posts: 187
Member Since:
January 29, 2017
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
Forum Posts: 41
Member Since:
September 12, 2013
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: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 41

Peter: 41

Frodson: 40

clau_ste: 39

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

JimmyM: 17

Member Stats:

Guest Posters: 1

Members: 495

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 31

Topics: 511

Posts: 1966

Newest Members:

CoraDias, Edoardo, knooierd, daniel, Merril Bradshaw, BillPlunkett, Pajczur, michaelwayneharwood, RickM, rainbow wind

Moderators: W Pirkle: 187

Administrators: Tom: 66, JD Young: 80, Will Pirkle: 0, W Pirkle: 187