-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How are the note bandwidths in your readme calculated? #3
Comments
Hi @aceamarco! I'm happy you liked it :) Very interesting question regarding the bandwidth. Conceptually, the musical note frequencies are the centers of the frequency bands. For instance, the center is 440.0Hz for A4, but if you pick a bandwidth wide enough when analyzing the signal, you'll also detect neighbour notes! So, for detection of notes, you need a bandwidth around the center frequency that does not overlap with the bandwidth of a neighbour note center frequency. The most intuitive value for the bandwidth is the difference (delta) between the center frequencies of 2 adjacent notes. But here's where it gets confusing: the difference between A4 & A#4 (next note) is ~26.2Hz; and the difference between A4 & G#4 (previous note) is ~24.7Hz! And of course the difference gets smaller for the lower octaves, and bigger for the higher octaves... On the other hand, what happens when the band around the central frequency is much narrower? Then the detector loses sensitivity for slightly out-of-tune instruments, since it has lower "tolerance", to speak so. Ultimately, very narrow bandwidth of, say, 0.1Hz, would imply very heavy processing, and it would be only good for detecting high-quality pitchforks, as opposed to real musical instruments ¯_(ツ)_/¯ Anyways, what I am actually using as "note bandwidth" is an approximation chosen in such way that it does not overlap with the next/previous note :) Hope this helps |
Again, thanks for making me curious :)
|
Oooh I see @creaktive, thank you for such a thorough explanation, this was really helpful! I hadn't intuited that the piano frequencies aren't evenly spaced on both sides. Would you say that the ideal bandwidth is the smaller of the two distances to a key's neighboring frequencies? For example, with the distances you mentioned for key A4, a bandwidth <= 24.7Hz would be ideal (because is the smaller distance compared to A4 to A#4 of 26.2Hz) since it doesn't overlap with either key. |
I wouldn't dare to say it is ideal, but, generally speaking, lowest possible bandwidth that does not overlap with the neighbour frequencies works really well :) |
Hello,
Thank you for making such a detailed README! I've really enjoyed reading through your theory section. However, I'm having trouble intuiting where your values for the 'note bandwidth' column are coming from. I understand where the 'estimated bandwidth' is coming from (if I understand it correctly it is the
sample_rate / N
. The Wikipedia page you linked with the piano key frequencies does not mention their bandwidths.The text was updated successfully, but these errors were encountered: