DSPRelated.com
Forums

Electronic Guitar Tuners

Started by rickman August 13, 2012
I play in a big band and use an iPhone app as a tuner. When I am tuning, my neighbors are also tuning and the app will pick out the loudest instrument and give a very accurate pitch value. I don't think any of the time domain algorithms good be so robust in poor snr situations. 
As I mentioned before, you can interpolate around fft peaks to drastically improve accuracy. 
On 8/14/12 12:53 PM, Robert Adams wrote:
> I play in a big band and use an iPhone app as a tuner. When I am tuning, my neighbors are also tuning and the app will pick out the loudest instrument and give a very accurate pitch value. I don't think any of the time domain algorithms good be so robust in poor snr situations.
autocorrelation (with interpolation between discrete lags)?
> As I mentioned before, you can interpolate around fft peaks to drastically improve accuracy.
as long as the el-cheapo chip is not overwhelmed (by either size of code or computational demands), whether it's doing something sophisticated like FFT or not doesn't matter. it just seems to me that a cheap tuner wouldn't bother with the FFT. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Tue, 14 Aug 2012 04:21:07 -0700 (PDT), Robert Adams
<robert.adams@analog.com> wrote:

>Guitar notes are interesting in that the harmonics are slightly out of tune= > relative to the fundamental so that the waveform does not look periodic in= > the time domain. Also a string has both a lateral and a longitudinal mode = >which are not quite the same. If you take a succession of fft frames you wi= >ll find that the fundamental sometimes drops out and then reappears later o= >n. So simple methods like zero crossing fail spectacularly.=20 > >My guess as to what they do is to use a moderate length fft, followed by a = >cubic fit to the fft peak and the upper and lower neighbors, which can then= > find the true frequency peak. Note that i was looking for that algorithm m= >yself recently and found it on comp.dsp.=20
Cubic fit to the peak is not the best algorithm in many (if not most) cases. Quick survey here: http://www.ingelec.uns.edu.ar/pds2803/Materiales/Articulos/AnalisisFrecuencial/04205098.pdf There are more thorough treatments of the topic around as well. These do assume that the tone being estimated is reasonably isolated, which may not always be the case for a tuning application.
> >Given that the fundamental sometimes disappears, I guess they do this for t= >he N highest fft peaks and then look for data that can be grouped into harm= >onic frequency relationships. Some of the low end micro controllers can do = >an fft even if the fft benchmarks are kind of lousy.=20 > >You can avoid this complexity by only playing in delusional rock bands with= > tone-deaf guitarists, which is the solution I tend to use.=20 > >Bob
Eric Jacobsen Anchor Hill Communications www.anchorhill.com
On 14 Aug., 00:52, rickman <gnu...@gmail.com> wrote:
> I am being asked to design a gadget that has some special features, but > also includes a guitar tuner. &#4294967295;I have looked at the web a bit, but not > found any good references that show exactly how a tuner works. &#4294967295;One > paper I found talked about a rather complex "constant Q transform". &#4294967295;I > just don't think the $10 tuner I have uses anything that complex. &#4294967295;I'm > thinking they are doing a PLL sync to the input or something more like > that. > > One reference I found talks about using a peak detect to measure period > rather than frequency like an FFT. &#4294967295;I would think the FFT has too little > resolution unless it is very long. > > Anyone know how the commercial low end gadgets really work? &#4294967295;Maybe I'll > take mine apart, but my bet is they are using chip on board with the die > under a dab of black goo. > > Rick
I've always assumed, (maybe wrongly) that they basically amplify and clip to one bit, and something like a simple IQ demod -Lasse
great article, thanks for the link!

Bob
great article, thanks for the link!

Bob
On 8/13/2012 8:48 PM, Eric Jacobsen wrote:
> On Mon, 13 Aug 2012 19:49:16 -0400, rickman<gnuarm@gmail.com> wrote: > >> On 8/13/2012 7:14 PM, Eric Jacobsen wrote: >>> On Mon, 13 Aug 2012 18:52:30 -0400, rickman<gnuarm@gmail.com> wrote: >>> >>>> I am being asked to design a gadget that has some special features, but >>>> also includes a guitar tuner. I have looked at the web a bit, but not >>>> found any good references that show exactly how a tuner works. One >>>> paper I found talked about a rather complex "constant Q transform". I >>>> just don't think the $10 tuner I have uses anything that complex. I'm >>>> thinking they are doing a PLL sync to the input or something more like >>>> that. >>>> >>>> One reference I found talks about using a peak detect to measure period >>>> rather than frequency like an FFT. I would think the FFT has too little >>>> resolution unless it is very long. >>>> >>>> Anyone know how the commercial low end gadgets really work? Maybe I'll >>>> take mine apart, but my bet is they are using chip on board with the die >>>> under a dab of black goo. >>>> >>>> Rick >>> >>> I think you're generally right. It has to be very simple, and since >>> the proper frequencies of the notes are deterministic and reasonably >>> spaced it allows some simplifying assumptions. >>> >>> That said, by far my favorite type of guitar tuner is an LED optical >>> tuner: >>> >>> http://www.amazon.com/Planet-Waves-PW-CT-06-S-O-S-Guitar/dp/B000FJEL9C >>> >>> That's even simpler to build and has a number of advantages, like you >>> can use it in a noisy environment. I've also found that I can tune >>> more accurately with one of these than a chromatic tuner. >>> >>> If your application allows that sort of thing it might be worth >>> considering. >>> >>> >>> Eric Jacobsen >>> Anchor Hill Communications >>> www.anchorhill.com >> >> >> Interesting idea. By optical I assume it means this is a stroboscope. >> The description talks about the "two out-of-phase LED light beams", but >> I assume that is just for brightness or do you think they are doing >> something fancy with timing? Are the two LEDs the same color? I guess >> if you pulse one LED at the fundamental and another at 1/3 the >> fundamental a 2x or 4x harmonic string will be fuzzy while just using >> the fundamental will also look right for any harmonic strings. It also >> doesn't require picking just one string. I may have to build this just >> for my own curiosity! >> >> I don't think the customer will go for this, but I can't say until I >> talk to them about it. It won't work in really bright light, but I >> don't know if this is a problem. >> >> Thanks, >> >> Rick > > Update: If you search YouTube for PlanetWaves SOS Tuner you'll find a > few vids, but this one seems to have the best view of how it looks on > a string: > > http://www.youtube.com/watch?v=VLPghJtAxUk&feature=endscreen
That is a pretty good illustration of how it works. I would not have thought about using the two LEDs to in essence do the same thing as quadrature sampling. I think I'll push the customer to use this. Since you are familiar with the unit, I assume it doesn't get washed out if the room is brightly lit? I would think it wouldn't work so well outside. Of course the other downside is that you have to tell the unit what the note is, so it only works for a fixed set of notes. Actually I could come up with something that would sample the note to control the LED rate rather than use a control. Actually, for the other functions, the unit has to be plugged into the guitar so the customer might not like this, but it is worth a try. It is definitely the inexpensive option, both recurring and non-recurring costs. Rick
On 8/14/2012 9:16 AM, Bruce Varley wrote:
> "rickman"<gnuarm@gmail.com> wrote in message > news:k0c0fs$rhs$1@dont-email.me... >> I am being asked to design a gadget that has some special features, but >> also includes a guitar tuner. I have looked at the web a bit, but not >> found any good references that show exactly how a tuner works. One paper I >> found talked about a rather complex "constant Q transform". I just don't >> think the $10 tuner I have uses anything that complex. I'm thinking they >> are doing a PLL sync to the input or something more like that. >> >> One reference I found talks about using a peak detect to measure period >> rather than frequency like an FFT. I would think the FFT has too little >> resolution unless it is very long. >> >> Anyone know how the commercial low end gadgets really work? Maybe I'll >> take mine apart, but my bet is they are using chip on board with the die >> under a dab of black goo. >> >> Rick > > AFAIAA, the algorithm generally works on cross correlation between the input > and a reference frequency, which would be the intended frequency of the > string. That's the way I'd do it.
The fundamental is not necessarily the strongest. Often the second harmonic is stronger... or first harmonic depending on your terminology (0/1 based). I have done similar things, but not where I didn't know the input freq. Here you have to first figure out which string is being played. The cross corr will give you a number. I'm not sure it tells you much about the frequency. If you sweep the ref freq, you can get a function of frequency which should give a peak at the fundamental... once you know where to look. I guess trial and error of the six basic notes would work for most situations.
> The guitarists I know generally use phone apps nowadays.
There's no accounting for taste! This is one function of a multi-function device. I didn't even know they wanted it to do the tuner part until an email yesterday. I have some ideas now to try. I like sweeping the cross corr. A quick sweep will give the note. Then sweep around the note with progressively slower passes to refine the frequency. An NCO will do a good job of that with very high resolution. Rick
rickman wrote:
> [snip] > I think I'll push the customer to use this. >
Back in the 60's I was TV service tech. I had to learn when and HOW to diplomatically "fix the customer".
On Tue, 14 Aug 2012 17:47:12 -0500
Richard Owlett <rowlett@pcnetinc.com> wrote:

> rickman wrote: > > [snip] > > I think I'll push the customer to use this. > > > > Back in the 60's I was TV service tech. > I had to learn when and HOW to diplomatically "fix the > customer". >
That's generally pretty simple. A pair of scissors, needle, thread, and a big plastic cone to keep them from scratching at it after. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix.