GUITAR TUNER

The requirements on the guitar tuner

 

In order to set the requirements on our hardware/firmware we need to define what exactly we want to achieve.

We want to capture the guitar signal and determine the exact frequency of the guitar note, display the note and the difference to the ideal pitch, in order to tune the guitar.

First problem to deal with: nothing is absolute exact in this universe; so: How precise do we have to determine the frequency?

As good as a commercial available tuning device (in the range of 10-20 USD).  I had a close look at a commercial available tuning device. I generated sinus signals of different frequency with a signal generator, feed them to the tuning device and noticed  how exact the device is. The conclusion is that we need to measure the frequency with two decimals after comma and the interval for a note to be consider tuned is ±0.15% of the ideal value.

.

I have a feeling that this will not be an easy task.

On the other hand, most commercially tuners are displaying the tone but not the octave. Mine should display the octave too!

Next. What are we measuring?  or in other words, how does the signal we are measuring looks like? How is the  wave form and the amplitude at a certain time, and their evolution over time?

I looked for some pictures with e-guitar signal, but I didn’t found.

Nothing relevant out there. So I had to make some measurements myself. I put them here for others like me who have looked but did not found, and for the future generations. No, no need to thank me,

I plugged the guitar directly to an oscilloscope and played the E2 chord . The E2 note is defined as a 82.41 Hz frequency.

This is what I got at different times as the vibration of the chord faded away

 

 

 

 

 

All measured with 20mV/division and time base of 5ms/div.

We see that the signal is periodic but not a pure sinus. It is a superposition of multiple sinus waves of different frequencies and amplitudes. Actually it is made by a main frequency called the fundamental, which is the frequency we want to tune to (in our case E2 with a frequency of 82.41 Hz) and multiples of this frequency called harmonics. It’s the Fourier analysis who teach us this. Actually I was teach by my teacher, and he was by his teacher , and so on backward till Monsieur  who started all this mess.

We also see that the signal is evolving over time, due to the fact that the vibration of the chord is decreasing in amplitude as the energy of the chord is give away (which means decreasing of the amplitude of the signal generated by the pickups) . The signal also change his shape over time as different harmonics are decreasing with different rates.

Each instrument type has his own mix of harmonics and different ways in which the harmonics are decreasing and therefore each instrument type (or even each single instrument) sounds totally different even when playing the exact same note (the same fundamental).

I also measured the signal with a much longer time base

 

This one is measured with 20mV/division and time base of 500ms/div.

We see that the amplitude (peak – peak) of the signal starts at about 300mV but decline rapidly toward 150mV and then slowly toward some tents of mV. Therefore the amplitude of the signal we need to measure will be from some mV up to some hundreds mV. This is relatively low for an usual analog to digital converter (ADC) input and we will need to amplify the signal. But we will decide about this when we will know exactly what ADC we will use, and what is the input range for this ADC.

The signal is available for 5-10 sec. After that a new sound (signal) has to be generated by pinching the chord again.

And now the same for the E4 chord

 

 

 

 

 

 

Note that the amplitude of the signal is lower as we use the higher chords cause higher chords are vibrating with a lower mechanical amplitude than the lower ones. Besides higher chords are declining more rapidly than the lower ones due to the fact that the energy is given away from the chord to the ambient a little bit on every vibration and therefore more often with the higher frequency chords. That makes the higher chords to vibrate shorter during tuning , before a new pinch of the chord is needed. For the highest chord , which is E4, the signal is available only for 2-4 sec.

Conclusion:

  1. the signal is relatively small (some mV to a couple of hundred mV) and we will have to amplify it
  2. it is not a sinus , but a complex periodic signal, out of which we will need to extract somehow the fundamental in order to measure it with an accuracy of 2 decimals after comma.
  3. the signal duration is between 2 and 10sec. We need to determine the fundamental often enough in order to allow a comfortable tuning procedure, even in the worst case of a signal duration of only 2 seconds.

We will continue by looking at the different methods to determine the fundamental of a signal.