I'm trying to make a program that catch and audio signal of a bass and show the notes that have been played. My program:
- Gets the sound and put it in a double data type array. (48 000Hz, 16bits) (1 frame in array per sample)
- Splits the array into many arrays, with 4~5 arrays in a second approx.
- Applies FFT algorithm to every array and left the same number of array's that have been created in the last step with frequency domain instead of time domain.
- Obtains the highest number of each array. That's the note that I have played with the bass.
This works and get the frequency when I don't split the array, for most of the times, but when I split it doesn't work even for the half of the results, maybe I have to use another way for get several notes instead of splitting. But the results are good too, so I think the problem is that I have to apply some filters.
The first one has to be a filter for the range of the bass (41 - 784), assuming that I'm not playing anything that time if it's out of that range.
Many times, if I play 41Hz (E1), the program interpret that I'm playing 82Hz (E2), or even a higher harmonic, and I don't know what to do with that. I could turn into 0Hz every note that has been played after the same note or one of its harmonics, but then how could I play the same note several times.
- Some advice for deal with this problems?
- Should I split the original array into more/less array's for get more accuracy?
- Which filters should I apply on my frequency or time domain array for get all the notes that have been played, with the right frequency and avoiding their harmonics?
If you are calculating frequency from harmonics, how could i stipulate what octave has been played?
I've been looking for cepstral analysis.
PD: I don't use a microphone, I'm using a bass-usb cable connected to my computer, and the sound is nice. It has some noise, but i think that it's pretty clean.
– Meliodas Mar 24 '20 at 09:18What do you refer about "A parametric estimator within and across windows"?
– Meliodas Mar 24 '20 at 09:32