0
$\begingroup$

I am using a MatLab audio feature extraction toolbox (MIRToolbox), and I am in the process of cross correlating an onset curve (envelope). I am aware of what the lag means when using Matlab's xcorr function since you normally pass in indices, but I am struggling to work out what the lag means when referred to in seconds on the x-axis.

According to the user manual, it has a minimum time of 0.2(s) and a maximum of 2(s) with onset envelopes. Does this mean it only cross correlates for 2 seconds? Its just that I have experimented with a 10(s), 30(s), and 3+(mins) edit of an audio file, and the plot is always showing 3 peaks, and looks more or less the same.

Onset Detection

Autocorr

$\endgroup$
2
  • $\begingroup$ Lag in seconds = lag in samples / sampling rate. That's the formula that explains what correlation in seconds boils down to. A minimum lag of 0.2(s) is still 0.2*sampling rate samples long. But I don't know what it means that there are three peaks consistently, unless you're autocorrelating, that would likely indicate the three harmonics (the first two if there is a peak at 0, but it looks like your cross correlation doesn't pass 0). This is surprising because usually the cross correlation goes from -time:+time. $\endgroup$
    – panthyon
    May 30, 2015 at 21:54
  • $\begingroup$ I've edited my post to provide two plots - oss and autocorrelation of a 3 minute song. What I meant about the peaks being consistent is that I have a 10 second and 30 second edit of this same song and the autocorrelation plot doesn't seem to change. Please correct me if I am wrong, but does that mean autocorrelation function is only going to correlate the oss with the first 88200 samples (2 secs * 44100) of my 3 minute song? $\endgroup$ Jun 2, 2015 at 10:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.