logarithm - MATLAB semilog scaling -


i'm new matlab, , working on program deals frequency of human voice based on microphone input. biggest problem running musical notes (what dealing in project) increase in frequency exponentially, 1.059463^x each semitone in musical scale.
in program dealing with, need both scale graph detected frequency close note number corresponds scale data can work note numbers in terms of notes , musical cents frequency graph can converted midi data.
other option have found has been create library of frequencies recorded frequencies compared to, unnecessarily complicated , time consuming.
so, in essence, trying scale data a2, frequency of 110hz, correspond note number 45. there way this?

i think want:

f = 110; %// frequency in hz n = log10(f/440)/log10(2)*12+69; %// 440 hz (note a4) note 69 note = round(n); cents = round((n-note)*100); 

examples: f = 110 gives

note =     45 cents =      0 

f = 345 gives

note =     65 cents =    -21 

in accordance this reference , this converter.


Comments

Popular posts from this blog

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -

How to run C# code using mono without Xamarin in Android? -