Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Electronic Guitar Tuners

74 views
Skip to first unread message

rickman

unread,
Aug 13, 2012, 6:52:30 PM8/13/12
to
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

Eric Jacobsen

unread,
Aug 13, 2012, 7:14:22 PM8/13/12
to
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

rickman

unread,
Aug 13, 2012, 7:49:16 PM8/13/12
to
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

glen herrmannsfeldt

unread,
Aug 13, 2012, 8:34:54 PM8/13/12
to
In comp.dsp rickman <gnu...@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

Eric Jacobsen

unread,
Aug 13, 2012, 8:43:50 PM8/13/12
to
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

unread,
Aug 13, 2012, 8:48:09 PM8/13/12
to
On Mon, 13 Aug 2012 19:49:16 -0400, rickman <gnu...@gmail.com> 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

Dave

unread,
Aug 14, 2012, 8:54:57 AM8/14/12
to
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

Bruce Varley

unread,
Aug 14, 2012, 9:16:38 AM8/14/12
to

"rickman" <gnu...@gmail.com> wrote in message
news:k0c0fs$rhs$1...@dont-email.me...
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 guitarists I know generally use phone apps nowadays.


Roberto Waltman

unread,
Aug 14, 2012, 11:17:50 AM8/14/12
to
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 ]

Jon Kirwan

unread,
Aug 14, 2012, 12:20:59 PM8/14/12
to
On Tue, 14 Aug 2012 00:48:09 GMT, eric.j...@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

lang...@fonz.dk

unread,
Aug 14, 2012, 4:29:48 PM8/14/12
to
I've always assumed, (maybe wrongly) that they basically amplify and
clip to
one bit, and something like a simple IQ demod

-Lasse

rickman

unread,
Aug 14, 2012, 6:19:15 PM8/14/12
to
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

rickman

unread,
Aug 14, 2012, 6:31:34 PM8/14/12
to
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

glen herrmannsfeldt

unread,
Aug 14, 2012, 7:01:53 PM8/14/12
to
In comp.dsp rickman <gnu...@gmail.com> wrote:

(snip)

> 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 ones I know of don't tell you which octave, only which note.
So the second harmonic is just as good.

-- glen

Eric Jacobsen

unread,
Aug 14, 2012, 7:35:38 PM8/14/12
to
Except that for stringed instruments the harmonics aren't at exact
multiples of the fundamental, so tuning to a harmonic may put the
fundamental at a slightly different frequency.

People tune guitars accurately by ear using the harmonics (sort of)
all the time, though, so it could be that the difference isn't
significant.

robert bristow-johnson

unread,
Aug 14, 2012, 8:43:37 PM8/14/12
to
On 8/14/12 7:35 PM, Eric Jacobsen wrote:
>
> Except that for stringed instruments the harmonics aren't at exact
> multiples of the fundamental, so tuning to a harmonic may put the
> fundamental at a slightly different frequency.
>
> People tune guitars accurately by ear using the harmonics (sort of)
> all the time, though, so it could be that the difference isn't
> significant.

i think the error to be first concerned about is not that the harmonics
are slightly sharp of their integer-multiple value (relative to the
fundamental). it's that just intonation (which is what you get when
tuning strictly with the harmonics and nodal points) is not the same as
equal temperament.

specifically: 2^(5/12) is not exactly the same as 4/3 .


--

r b-j r...@audioimagination.com

"Imagination is more important than knowledge."


glen herrmannsfeldt

unread,
Aug 14, 2012, 8:45:55 PM8/14/12
to
In comp.dsp Eric Jacobsen <eric.j...@ieee.org> wrote:

(snip, I wrote)
>>The ones I know of don't tell you which octave, only which note.
>>So the second harmonic is just as good.

> Except that for stringed instruments the harmonics aren't at exact
> multiples of the fundamental, so tuning to a harmonic may put the
> fundamental at a slightly different frequency.

That is true, but for most they aren't so far apart.
The piano bass strings use copper wire wrapped steel to add
more mass, but not so much more stiffness. (It is stiffness
that shifts the harmonics.)

> People tune guitars accurately by ear using the harmonics
> (sort of) all the time, though, so it could be that the
> difference isn't significant.

If you want to get that close, then you have to worry about
the difference between well-tempered and equal-tempered,
and most people don't do that. The ear is especially sensitive
to beats, but not so sensitive (compared to a frequency counter)
to absolute pitch. Also, if a higher harmonic is louder, then
that is likely the one you will hear.

Though the tuners I know about aren't specifically for guitars.
They are used for flutes, violins, and many other instruments,
though those could still have significant harmonics.

-- glen

Les Cargill

unread,
Aug 14, 2012, 8:50:18 PM8/14/12
to
That will bias you towards Just or even Pythagorean temperament.
Might be a problem, might not be.


>
> Eric Jacobsen
> Anchor Hill Communications
> www.anchorhill.com
>

--
Les Cargill

rickman

unread,
Aug 16, 2012, 7:52:48 PM8/16/12
to
On 8/14/2012 8:54 AM, Dave wrote:
>
> 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

Thanks, I did that and found a few dozen myself. I learned a lot from a
wikipedia page on commercial products including some that are high end
and strobe based. That might be a useful way to go. I just have to
find something that isn't too much work.

Rick

robert bristow-johnson

unread,
Aug 17, 2012, 10:09:40 PM8/17/12
to
do you think auto-correlation is too much work?

rickman

unread,
Aug 18, 2012, 10:50:08 PM8/18/12
to
I didn't get the question until now. By auto-correlation you mean a
sliding correlation so that each result is with a different delta in
time. No, I think that has comparable computation to a DFT and the
advantage of the DFT is that it can be done over a subset of the full
frequency range rather than always having to calculate the full range
like an FFT.

However, to find the frequency of interest a broader auto-corr or xFT
would need to be performed initially. Then a detailed analysis could be
done to hone in on the exact frequency.

I'm also intrigued by some of the "stroboscopic" methods, but I haven't
looked at how to implement them yet.

My current thinking is that no matter what method I go with, it needs to
be very high "performance", meaning highly accurate and reasonably fast.
I believe the market is not large for this particular device. So
better to go Cadillac and charge a price premium than to try to find a
spot in a crowded, high volume market.

So that means, will an auto-corr approach do a good job of resolving a
fraction of a cent for a tuner in less than say the two or three seconds
a note will sustain? I would have to consider just how accurate the
auto-corr might be.

Rick

robert bristow-johnson

unread,
Aug 18, 2012, 11:40:47 PM8/18/12
to
On 8/18/12 10:50 PM, rickman wrote:
> On 8/17/2012 10:09 PM, robert bristow-johnson wrote:
>> On 8/16/12 7:52 PM, rickman wrote:
...
>>> Thanks, I did that and found a few dozen myself. I learned a lot from a
>>> wikipedia page on commercial products including some that are high end
>>> and strobe based. That might be a useful way to go. I just have to find
>>> something that isn't too much work.
>>
>> do you think auto-correlation is too much work?
>
> I didn't get the question until now. By auto-correlation you mean a
> sliding correlation so that each result is with a different delta in
> time.

yup. i call that "delta" the "lag".

> No, I think that has comparable computation to a DFT and the
> advantage of the DFT is that it can be done over a subset of the full
> frequency range rather than always having to calculate the full range
> like an FFT.

you can compute the autocorrelation with a subset of lags. you don't
need to do it for every possible integer lag, but only the lags of interest.


> However, to find the frequency of interest a broader auto-corr or xFT
> would need to be performed initially. Then a detailed analysis could be
> done to hone in on the exact frequency.

yah.


> I'm also intrigued by some of the "stroboscopic" methods, but I haven't
> looked at how to implement them yet.
>
> My current thinking is that no matter what method I go with, it needs to
> be very high "performance", meaning highly accurate and reasonably fast.
> I believe the market is not large for this particular device. So better
> to go Cadillac and charge a price premium than to try to find a spot in
> a crowded, high volume market.

then i'm pretty sure that autocorrelation or AMDF or ASDF is what you'll
want to do.

> So that means, will an auto-corr approach do a good job of resolving a
> fraction of a cent for a tuner in less than say the two or three seconds
> a note will sustain? I would have to consider just how accurate the
> auto-corr might be.

pretty accurate, but *any* pitch detector *can* possibly have octave
errors (it's what can happen if you have inaudible sub-harmonics). then
you need to program the thing to have a little bit of common sense to
avoid some of the dumber octave errors. i think that looking for energy
at the frequency of the fundamental is a dumb octave error because there
could be more energy at the 2nd harmonic or the 3rd harmonic and your
alg might think that either of those is the fundamental frequency.

does your DSP or whatever processor have conditional branch
instructions? you don't need to compute the whole autocorrelation (all
of the lags) for each and every sample. in fact, you might just compute
*one* lag per sample and have a couple of special states where you set
up the autocorrelation and where you process or scan the results of the
autocorrelation to come up with a period length. and you can do some
interpolation-like stuff to get the period to a precision of a fraction
of a sample period. i.e. look for the peak where it falls between two
integer lags. it's not hard.

that's all you get for free.

rickman

unread,
Aug 21, 2012, 9:27:20 AM8/21/12
to
On 8/20/2012 7:20 AM, kalvi...@gmail.com wrote:
> Some sort of bandpass filtering for each string's center frequency might also turn out to be useful.
>
> - Calvin

Thanks Calvin,

Yes, I thought of that, but to make it as general as possible it would
need to accommodate alternate tunings. I would like to make this a
chromatic tuner capable of tuning to any note on the scale.

Rick

rickman

unread,
Aug 21, 2012, 9:31:05 AM8/21/12
to
On 8/18/2012 11:40 PM, robert bristow-johnson wrote:
> On 8/18/12 10:50 PM, rickman wrote:
>> No, I think that has comparable computation to a DFT and the
>> advantage of the DFT is that it can be done over a subset of the full
>> frequency range rather than always having to calculate the full range
>> like an FFT.
>
> you can compute the autocorrelation with a subset of lags. you don't
> need to do it for every possible integer lag, but only the lags of
> interest.

Yes, that is what I meant, the auto-corr and the DFT are the same in
that regard, but the FFT - not so much.


>> I'm also intrigued by some of the "stroboscopic" methods, but I haven't
>> looked at how to implement them yet.
>>
>> My current thinking is that no matter what method I go with, it needs to
>> be very high "performance", meaning highly accurate and reasonably fast.
>> I believe the market is not large for this particular device. So better
>> to go Cadillac and charge a price premium than to try to find a spot in
>> a crowded, high volume market.
>
> then i'm pretty sure that autocorrelation or AMDF or ASDF is what you'll
> want to do.

I'll have to lookup the AMDF and ASDF.


>> So that means, will an auto-corr approach do a good job of resolving a
>> fraction of a cent for a tuner in less than say the two or three seconds
>> a note will sustain? I would have to consider just how accurate the
>> auto-corr might be.
>
> pretty accurate, but *any* pitch detector *can* possibly have octave
> errors (it's what can happen if you have inaudible sub-harmonics). then
> you need to program the thing to have a little bit of common sense to
> avoid some of the dumber octave errors. i think that looking for energy
> at the frequency of the fundamental is a dumb octave error because there
> could be more energy at the 2nd harmonic or the 3rd harmonic and your
> alg might think that either of those is the fundamental frequency.

Yes, but the harmonics will fall at certain ratios which won't match if
you pick a harmonic in place of the fundamental. Also, won't the energy
of the harmonics add into the lag for the fundamental?


> does your DSP or whatever processor have conditional branch
> instructions? you don't need to compute the whole autocorrelation (all
> of the lags) for each and every sample. in fact, you might just compute
> *one* lag per sample and have a couple of special states where you set
> up the autocorrelation and where you process or scan the results of the
> autocorrelation to come up with a period length. and you can do some
> interpolation-like stuff to get the period to a precision of a fraction
> of a sample period. i.e. look for the peak where it falls between two
> integer lags. it's not hard.

I get the interpolation thing, that's fairly obvious, but I don't
understand the comment about the one lag per sample and special states.
The problem with interpolation is that it can only interpolate to some
extent. Essentially this is a method of measuring the period of
signals. The sample rate has to be fast enough to provide a decent
resolution. There are also the same issues found in the FFT of energy
splattering across bins. I suppose a window function can help with that.


> that's all you get for free.

Thanks,

Rick

robert bristow-johnson

unread,
Aug 21, 2012, 1:41:15 PM8/21/12
to
On 8/21/12 9:31 AM, rickman wrote:
> On 8/18/2012 11:40 PM, robert bristow-johnson wrote:
>> On 8/18/12 10:50 PM, rickman wrote:
>>>
>>> My current thinking is that no matter what method I go with, it needs to
>>> be very high "performance", meaning highly accurate and reasonably fast.
>>> I believe the market is not large for this particular device. So better
>>> to go Cadillac and charge a price premium than to try to find a spot in
>>> a crowded, high volume market.
>>
>> then i'm pretty sure that autocorrelation or AMDF or ASDF is what you'll
>> want to do.
>
> I'll have to lookup the AMDF and ASDF.
>

Average Magnitude/Squared Difference Function


>
>>> So that means, will an auto-corr approach do a good job of resolving a
>>> fraction of a cent for a tuner in less than say the two or three seconds
>>> a note will sustain? I would have to consider just how accurate the
>>> auto-corr might be.
>>
>> pretty accurate, but *any* pitch detector *can* possibly have octave
>> errors (it's what can happen if you have inaudible sub-harmonics). then
>> you need to program the thing to have a little bit of common sense to
>> avoid some of the dumber octave errors. i think that looking for energy
>> at the frequency of the fundamental is a dumb octave error because there
>> could be more energy at the 2nd harmonic or the 3rd harmonic and your
>> alg might think that either of those is the fundamental frequency.
>
> Yes, but the harmonics will fall at certain ratios which won't match if
> you pick a harmonic in place of the fundamental. Also, won't the energy
> of the harmonics add into the lag for the fundamental?

then you'll be sweeping some kinda comb on the data.

>> does your DSP or whatever processor have conditional branch
>> instructions? you don't need to compute the whole autocorrelation (all
>> of the lags) for each and every sample. in fact, you might just compute
>> *one* lag per sample and have a couple of special states where you set
>> up the autocorrelation and where you process or scan the results of the
>> autocorrelation to come up with a period length. and you can do some
>> interpolation-like stuff to get the period to a precision of a fraction
>> of a sample period. i.e. look for the peak where it falls between two
>> integer lags. it's not hard.
>
> I get the interpolation thing, that's fairly obvious, but I don't
> understand the comment about the one lag per sample and special states.

it's a programming issue. some samples you will compute *one* point of
the autocorrelation. and when you have filled up the table, you need to
examine what you computed, that is a special mode of your program and
you won't have time to compute a new point of autocorrelation and you
won't need to. it's a manner to distribute the work over many different
sampling periods to reduce the worst-case timing cost.

> The problem with interpolation is that it can only interpolate to some
> extent. Essentially this is a method of measuring the period of signals.

yup and that period may very well not be an integer number of samples.

> The sample rate has to be fast enough to provide a decent resolution.
> There are also the same issues found in the FFT of energy splattering
> across bins. I suppose a window function can help with that.
>


rickman

unread,
Aug 22, 2012, 1:44:19 AM8/22/12
to
On 8/21/2012 1:41 PM, robert bristow-johnson wrote:
> On 8/21/12 9:31 AM, rickman wrote:
>> On 8/18/2012 11:40 PM, robert bristow-johnson wrote:
>>>
>>> then i'm pretty sure that autocorrelation or AMDF or ASDF is what you'll
>>> want to do.
>>
>> I'll have to lookup the AMDF and ASDF.
>>
>
> Average Magnitude/Squared Difference Function

Yes, I found the name easily enough. I need to read up on how to
calculate it and why it is different from the auto-corr.


>>> pretty accurate, but *any* pitch detector *can* possibly have octave
>>> errors (it's what can happen if you have inaudible sub-harmonics). then
>>> you need to program the thing to have a little bit of common sense to
>>> avoid some of the dumber octave errors. i think that looking for energy
>>> at the frequency of the fundamental is a dumb octave error because there
>>> could be more energy at the 2nd harmonic or the 3rd harmonic and your
>>> alg might think that either of those is the fundamental frequency.
>>
>> Yes, but the harmonics will fall at certain ratios which won't match if
>> you pick a harmonic in place of the fundamental. Also, won't the energy
>> of the harmonics add into the lag for the fundamental?
>
> then you'll be sweeping some kinda comb on the data.

Not sure what you mean by this. I am suggesting that with an
auto-correllation the harmonics of the frequency that corresponds to the
lag will also be added into the sum. Any frequency with an integer
multiple of its period being approximately equal to the lag should
accumulate. So when the lag is tuned to the fundamental of a note, all
harmonics should add into the result giving this the largest peak, no?


>>> does your DSP or whatever processor have conditional branch
>>> instructions? you don't need to compute the whole autocorrelation (all
>>> of the lags) for each and every sample. in fact, you might just compute
>>> *one* lag per sample and have a couple of special states where you set
>>> up the autocorrelation and where you process or scan the results of the
>>> autocorrelation to come up with a period length. and you can do some
>>> interpolation-like stuff to get the period to a precision of a fraction
>>> of a sample period. i.e. look for the peak where it falls between two
>>> integer lags. it's not hard.
>>
>> I get the interpolation thing, that's fairly obvious, but I don't
>> understand the comment about the one lag per sample and special states.
>
> it's a programming issue. some samples you will compute *one* point of
> the autocorrelation. and when you have filled up the table, you need to
> examine what you computed, that is a special mode of your program and
> you won't have time to compute a new point of autocorrelation and you
> won't need to. it's a manner to distribute the work over many different
> sampling periods to reduce the worst-case timing cost.

Sorry, I'm not following this. For each input sample, I need to
accumulate a product for each of the lags being computed. I don't think
I will have a timing issue, if by timing you mean enough processor
speed. The device I am considering has 144 CPUs with >200 MIPS each.


>> The problem with interpolation is that it can only interpolate to some
>> extent. Essentially this is a method of measuring the period of signals.
>
> yup and that period may very well not be an integer number of samples.

Yes, but interpolation can only improve the resolution by some factor,
what, 5x? 10x? Noise and processing resolution will limit this at some
point.

It seems the frequency resolution of the human ear is not as good as I
thought. One source says it is 1 Hz below 500 Hz and about 0.6% above
1000 Hz. They don't mention the range 500 to 1000 Hz, but I assume it
is within this range. That should be entirely workable without
interpolation if the sample rate is high enough and I am pretty sure I
can do that.

Rick

rickman

unread,
Sep 1, 2012, 3:22:28 PM9/1/12
to
On 8/13/2012 6:52 PM, rickman 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've run some simulations on using auto-correlation to detect the pitch
and it has some very desirable properties. It seems to be relatively
immune from noise and out of band signals. It is not as sensitive to
the exact frequency as I would like, but likely this is more a
fundamental limitation of measuring frequency with a short time sequence.

I am going to try the measurement over a longer multiple of the
frequency of interest. I should be able to reason out the result, but
it is easier to just give it a try...

Rick

rickman

unread,
Sep 5, 2012, 4:13:46 PM9/5/12
to
I did some simulations looking at a tone in the presence of harmonics
and in the presence of noise using the autocorr, the ASDF and the AMDF
with the sample rate far above what is required by the Nyquist
criterion. The autocorr gives big fat peaks that are hard to pinpoint.
The ASDF has somewhat fat valleys but is not much disturbed by the
noise. The AMDF without noise has very sharp valleys which are very
easy to pinpoint, but with noise these get rounded. But with even high
amplitude noise the valleys of the AMDF are easier to distinguish than
the ASDF.

I read somewhere here that another poster preferred the ASDF in the
presence of noise. The values of the AMDF are more affected by the
noise than in the ASDF, but it looks to me like pinpointing the proper
peak (or is it anti-peak?) value is easier with the AMDF even with the
noise. I still have some other testing to do.

Meanwhile I expect my customer to pick the low cost spread and not do
the tuner option at all. But who knows? Customers can be strange beasts.

Rick

Ulf Samuelsson

unread,
Oct 22, 2012, 5:51:26 AM10/22/12
to
Didn't see the beginning of the thread, but if anyone wants a Guitar
tuner you can get the PolyTune from TC Electronics.

http://www.tcelectronic.com/polytune.asp

It should retail below $100.

There is also an iPhone app at $3.99
http://www.tcelectronic.com/polytune-iphone-app.asp

TC Electronics is a professional audio company. (U2 is/was one of their
customers) so it is not a cheap gizmo.
They have applied for a lot of patents on this technology, which
you would want to avoid.

BR
Ulf Samuelsson


robert bristow-johnson

unread,
Oct 22, 2012, 10:42:34 AM10/22/12
to
On 10/22/12 5:51 AM, Ulf Samuelsson wrote:
>
> TC Electronics is a professional audio company.

there is no doubt of that.

> (U2 is/was one of their
> customers) so it is not a cheap gizmo.
> They have applied for a lot of patents on this technology, which
> you would want to avoid.

the use of autocorrelation for pitch detection has existed long before
TC existed as a company. lotsa prior art. but i believe, especially
when they were involved with IVL and Helicon, that they developed some
patented pitch detection techniques.

if anyone is experimenting with pitch detection, either with AMDF, ASDF,
autocorrelation (which is ASDF turned upside down), feature detection
and matching, zero-crossing (which i don't recommend), etc. there is
little danger of stepping on someone else's *valid* patent.
0 new messages