Reputation:
I think I might be a bit confused using the AnalyserNode. I currently have my userAudio stream "line-in" connected to an AnalyserNode. I then fill up a Uint8Array using getByteFrequencyData()
.
When I play a single 440Hz tone, the frequency with the highest intensity in my array will either be 468Hz or 421Hz (depending on how much I vary it). Is there a way that I can increase the resolution around these frequencies, so that it has more frequencies between 468 and 421Hz?
When I plot the fft data with a 440Hz tone, you can see the two intense frequencies at 468Hz and 421Hz. Is there a way to average out the FFT data into a separate array, so that the intensities of the 468Hz and 421Hz (among other points) data points are averaged? I guess it would be like interpolating the data in between the frequencies...
JSFiddle: http://jsfiddle.net/puYw3/ (I'm not sure if this actually works because I don't have a microphone on my current computer).
Upvotes: 2
Views: 462
Reputation: 2600
The is coming a little late, but maybe someone will find it useful.
You can increase the "resolution" of the fft with the property fftSize of AnalyserNode.
Since the fftSize maximum value is limited (I believe something around 2^15 at the time writing this) you will still end up with rather imprecise values. It is possible to increase the precision using parabolic peak interpolation
Upvotes: 1