Hi everyone,(adsbygoogle = window.adsbygoogle || []).push({});

I have a sound wave representing a piano piece played at a steady tempo, and would like to get a graph of the saliency of each beat (essentially, a probability distribution for how strong each possible tempo is). I understand that this is done by plotting the autocorrelation function, however I don't quite understand why a graph of r coefficients against each possible lag value (which is, as far as I understand, the deffinition of an autocorrelogram) would have anything to do with beats.

The following Matlab code produces a graph that doesn't in any way suggest anything to do with the actual steady beat of the piece (60 BPM):

Clearly I'm understanding autocorrelation wrongly. For instance, in this very simple example, the frequency of the sine hidden in noise is nowhere visible from the autocorrelation graph - or is it? Furthermore, that frequency would actually be the pitch of the sound, and not any rhythm-related measure!Code (Text):[y,Fs] = wavread('d:\bach.wav');

[r,lags]=xcorr(y,'coeff');

plot(lags,r)

The MIR toolbox for Matlab has a function specifically for finding the tempo of a waveform - however what I'm after now is understanding these things at a theoretical level.

Anticipated thanks for any clarifications!!

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Finding the strongest beat in a sound wave using autocorrelation

Loading...

Similar Threads for Finding strongest beat | Date |
---|---|

Finding the Torque vs RPM curve for a 3-phase AC induction motor | Mar 18, 2018 |

Need to find an old variable capacitor | Feb 9, 2018 |

3N187, where to find this type of MOSFET in LTSpice | Dec 20, 2017 |

Need to Find the Total Resistance | Nov 23, 2017 |

What source puts out the strongest power signal on earth? | Jan 21, 2009 |

**Physics Forums - The Fusion of Science and Community**