DSPRelated.com
Forums

Electronic Guitar Tuners

Started by rickman August 13, 2012
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
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
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
In comp.dsp 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.
I always thought that they did zero-cross detection, but never looked inside. For the price, it has to be a microprocessor with very little analog circuitry. Maybe a digital version of a PLL, but I doubt an analog one. $10 tuner, minus store markup, doesn't give much to buy the parts with. -- glen
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
Two red LEDs, and I *think* they just strobe at the expected fundamental freq. They're separated in space over about 1/4" when projected onto a string, so you see the beat motion of the string when the rates don't match and the two illuminated parts of the string are still when the rates match (i.e., it is in tune). For six bucks you can buy one and play with it. I bought a bunch of them on sale once, and haven't used any other type of tuner since (for guitars, anyway). Eric Jacobsen Anchor Hill Communications www.anchorhill.com
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 Eric Jacobsen Anchor Hill Communications www.anchorhill.com
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 will find that the fundamental sometimes drops out and then reappears later on. So simple methods like zero crossing fail spectacularly. 

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 myself recently and found it on comp.dsp. 

Given that the fundamental sometimes disappears, I guess they do this for the N highest fft peaks and then look for data that can be grouped into harmonic frequency relationships. Some of the low end micro controllers can do an fft even if the fft benchmarks are kind of lousy. 

You can avoid this complexity by only playing in delusional rock bands with tone-deaf guitarists, which is the solution I tend to use. 

Bob
On Aug 13, 6:52&#4294967295;pm, 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
There's a whole sub-culture of there of DIY guitar players - making their own stompboxes etc. So using the almighty google and searching "DIY guitar tuner" gives some useful results. You can take a look at the circuitry in some of these links to see what they're using: http://www.schickt.de/comments.php?y=08&m=06&entry=entry080606-004307 http://www.diystompboxes.com/smfforum/index.php?topic=88097.0 http://www.groupdiy.com/index.php?topic=4416.0 http://www.instructables.com/id/Visual--Aural-Guitar-Tuner-The-Tune-Trainer/?ALLSTEPS Cheers, Dave
 rickman wrote:
>One reference I found talks about using a peak detect to measure period >rather than frequency like an FFT.
Since you are interested only on the fundamental frequency, not the harmonic content, my first crude attempt would be to low-pass filter, amplify, clip and measure the period. No, I don't know how they do it either. If I find it, I may vivisect the tuner I have *somwhere* at home. -- Roberto Waltman [ Please reply to the group, return address is invalid ]
On Tue, 14 Aug 2012 00:48:09 GMT, eric.jacobsen@ieee.org
(Eric Jacobsen) wrote:

>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
Thanks, Eric. That makes the whole thing dead-obvious as to how it works. And it illustrates how to use electronics to supplement and augment the human brain and anatomy to produce something cheap and effective and appropriate all in one go. I just love stuff like that. Damn easy to do. I could punch one out in short order right now, just seeing that. (Kind of like Galileo just hearing about the invention of the telescope and from that and nothing else knowing what needed to be done to make one. hehe. Though I'm no where near as smart.) Jon