Is it possible to recognize a guitar note using its frequency?

Hello !
We’re french students in high school, and we’re trying to make an automatic guitar tuner for our engeneering project, and we would like to know if it was possible to do so with EdgeImpulse. We’re complete beginners in this domain, and would appreciate some help ^^’.
What we’re looking for is a way to recognize (or isolate) the frequency of a guitar recording, so we can recognize the note that is played in the recording. If the detected frequency don’t match or is in between different notes, we’ll need to know the frequency gap between the recording and the closest note, so the motor attached to the tuner can precisely tighten or loosen the key.
So if you know a way to do this, or have any advices to help us, we would appreciate it. And if we weren’t clear enough, feel free to ask us any questions :wink:

Thank you for your time !

Hi @PinguBoi If you record two different notes, then use a spectrogram processing block can you see the difference? Distinct frequencies? If so, then train using that, or even bypass ML all together and just analyze the spectrogram in code.

1 Like

FYI, here’s a quick test using a piano:

C

image

F

image

There’s definitely something there:

Note that this is trained on 20 seconds of data (10 each), so don’t take it for granted :wink:

2 Likes

Hi, thank you for your help ! We’ll test this method in class with the guitar we have and we’ll let you know if it worked :slight_smile:

@PinguBoi

Is this what you looking for?

Automated Guitar Transcription with Deep Learning

Using Constant-Q Transform.

Maybe also useful?
GuitarSet
https://github.com/marl/GuitarSet

I think it might be what we need ! I didn’t know it was possible to create images based on audio files, but this method could be what we’re looking for. I’ll let you know as fast as possible !

Thank you so much for your help !

Hi @PinguBoi

You probably don’t want ML for tuning…b/c you just want the fundamental frequency when you play the note, right? And if it’s a little off, you want to tune that note to have more or less pitch? (Forgive me if I’m mistaken on your intent here, I don’t play any instruments, what I know about music I know from DSP)

I would recommend just taking an FFT and capturing the peak frequency, then using that to tune. If you respond back with some numbers about how accurate you need to be, I can recommend a size. Send your sample rate and I can tell you how to convert from frequency bin to frequency, if you’re not comfortable with that.

If that’s too slow, we can also get into creating a custom filter bank, etc. But start with the FFT, that will probably work fine.

1 Like

Hi, sorry for the late response^^’
I think we’ll need to learn edge impulse on simpler projects first:/ we’re just starting and it’s probably too big of a project for us at the moment. We’ll keep your ideas, we’ll try them later and I’ll let you know if we go back to work on this project. Thank you for your advices !