Autocorrelation

Hi,

is there some way to do autocorrelation using Web Audio API?

I'm trying to write a simple guitar tuner app and thus need some way
to detect a pitch. I have no previous background in DSP and after
reading about pitch estimation a bit I found 2 easy ways to do it - by
finding max amplitude in frequency domain data or using
autocorrelation.

The former method is not accurate enough, as with fftSize of 2048 I'd
have to set sampling frequency to 1024 to get 1Hz precision (Fs / bin
count), if I understand it correctly.

The latter looks more promising, but it seems that I can perform
autocorrelation only in time domain, because
AnalyserNode#getFloatFrequencyData doesn't return phase components
(http://lists.w3.org/Archives/Public/public-audio-dev/2013Mar/0023.html).
I've implemented a simple pitch estimation using autocorrelation in
time domain (http://jsfiddle.net/szimek/hGRva/2 - works in Chrome and
probably in Firefox nightly), but it doesn't return accurate results
as well. I'm not sure if it's because of my crappy implementation
(very possible) or it's because the time data is 8 bit only.

Maybe it's somehow possible to do autocorrelation using ConvolverNode
with the reverse of input signal?

Any suggestions are very welcome.

Cheers,
Szymek

Received on Sunday, 9 June 2013 05:59:37 UTC