html5 - Web Audio Pitch Detection for Tuner -


so have been making simple html5 tuner using web audio api. have set respond correct frequencies, problem seems getting actual frequencies. using input, create array of spectrum highest value , use frequency 1 feed tuner. problem when creating analyser in web audio can not become more specific fft value of 2048. when using if play 440hz note, closest note in array 430hz , next value seems higher 440. therefor tuner think playing these notes when infact loudest frequency should 440hz , not 430hz. since frequency not exist in analyser array trying figure out way around or if missing obvious.

i new @ appreciated.

thanks

there number of approaches implementing pitch detection. paper provides review of them. conclusion using ffts may not best way go - however, it's unclear quite fft-based algorithm did.

if you're tuning guitar strings fixed frequencies, simpler approaches exist. building chromatic tuner not know a-priori frequency expect hard.

the fft approach you're using entirely possible (i've built robust musical instrument tuner using approach being used white-label number of 3rd parties). need significant amount of post-processing of fft data.

to start, solve resolution problem using short timer fft (stft) - or more precisely - succession of them. process described nicely in article.

if intend building tuner guitar , bass guitar (and let's face it, asks question here is), you'll need t least 4092-point dft overlapping windows in order not violate nyquist rate on bottom e1 string @ ~41hz.

you have bunch of other algorithmic , usability hurdles overcome. not least, perceived pitch , spectral peak aren't same. taking spectral peak stft doesn't work reliably (this why basic auto-correlation approach broken).


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

jquery - Keeping Kendo Datepicker in min/max range -