DIGITAL GUITAR AUTO-TUNER PROJECT

...

That seems to suggest that good performance depends in part on a low-pass filter, and that the cut-off is higher than optimum for low instruments. That also suggests that an improved model might have a variable filter or a choice of fixed ones. It tales longer to count cycles in low notes, but I think that effect must be secondary.

...

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins
Loading thread data ...

You are incorrect, because you didn't think of the real-world problem here.

You can't use as many points as you want, for two reasons: the guitar string signal doesn't last forever, and as I said, it evolves in various "nasty" (well, to the engineer) ways while it lasts.

To increase resolution, you have to increase the number of points, hence the duration of the take. As I just said, this is not a real option. Besides, even if the played open string lasted long enough (which is not that obvious), the longer the time it takes for your tuner to give you the pitch, the more useless your tuner is (just try to tune a guitar with a tuner that needs 5 seconds to give you the current pitch, good luck).

Padding with zeros to artificially increase the number of points without having to analyze a longer take will quickly prove not very useful either in this particular application because of all the transients.

But don't take my word for it. Just do it. I did and I claim it's not the way to go. You'll see. If you can come up with a usable and accurate guitar tuner using an FFT only, please show us. I'll be glad to hear from it. Meanwhile, no commercial tuner that I know of uses an FFT.

Reply to
Guillaume

Done badly? I'm talking about the obvious FFT resolution, which is the sample frequency divided by the number of points. So yes, it could be (and is) insufficient signal length. But more length means longer time to get a result, and as I said in my other reply, the tuner becomes unusable. Besides, as the time goes by, the guitar string signal changes a lot and you won't get a lot of useful information out of the FFT.

This is extremely wrong. First, a Fourier analysis doesn't deal well at all with transients as it is meant to analyze periodic signals. A guitar sound is nothing but periodic when you look at it. It might "sound" so, but it isn't.

Wavelets could be a way of better dealing with this.

But as I said to the other person, don't take my word for it. If you think an FFT will do the job, please be my guest.

Pitch analysis is most often based on autocorrelation techniques. Search the web, you'll find plenty of research articles on the subject.

Reply to
Guillaume

I read in sci.electronics.design that Jon Harris wrote (in ) about 'DIGITAL GUITAR AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

Well, yes, that's precisely why equal temperament was invented.

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

Alas, the stated problem is different from that of just using the mathematical definition of frequency given an FT; it's more about whether and how humans would *perceive* a pitch, and, if so, whether it's sharp or flat. An FFT is just one of several computationally efficient mechanisms to help with estimating the results of a human ear-brain response, given the current lack of a complete and accurate model of this system.

IMHO. YMMV.

--
Ron Nicholson
rhn AT nicholson D o T c O m
Reply to
rhnlogic

I read in sci.electronics.design that Al Clark wrote (in ) about 'DIGITAL GUITAR AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

Loose wrapping.

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

I read in sci.electronics.design that Guillaume wrote (in ) about 'DIGITAL GUITAR AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

Thanks for the explanation. It gels with my thinking on the subject.

Indeed: a very cogent point.

You said it! Digits are NOT always the answer. Particularly FFT.

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

Most of them use a simple design. You can find one on CircuitCellar, and that's pretty much how this is done in commercial products.

It consists of an input stage, which is basically a good low-pass filter filtering everything above the maximum fundamental frequency it's supposed to deal with (probably something like 1000 or 1500 Hz), usually a 2nd order active filter. Then it's followed by a comparator set with some hysteresis, which can also be an amplifier based on some AOP with a lot of gain - so that the AOP clips the signal, which is easily transformed into a digital signal with a schmitt trigger, for instance. This circuit basically extracts the fundamental frequency of the input signal with a reasonable usability.

Then the comparator's output can be dealt with in various ways. Some can be rather crude (just measuring the frequency of the resulting digital signal), some are more clever, and I like the one that's used in the CircuitCellar project. The comparator's output goes to a digital I/O pin of a microcontroller, of course set as an input. The algorithm used consists of measuring the delay between two consecutive raising edges - but this is not all. To make sure the measure is meaningful, several consecutive measures are compared, and only if we get a few (like 10, for instance) consecutive measures that are close enough to one another, do we consider this is the fundamental frequency. The latter is computed from the period, using for instance an average of the 10 given "meaningful" past measures.

By comparing the frequency with a few preset ranges, the tuner can even guess what the string it is you're trying to tune, and automatically give you how far away you are from the nominal frequency for this string.

As to how the above input stage, based on a filter and a saturation stage, translates in the frequency domain (in other words, how the spectrum of the original signal is transformed), I'll let you think about it. It resembles, but is not quite like simply looking at zero-crossings - because the saturation on the signal actually tends to "ignore" the harmonics, whereas simple zero-crossing analysis has to deal with them.

All in all, this is a working approach and it's much simpler than any sophisticated DSP analysis you might try.

Reply to
Guillaume

I read in sci.electronics.design that Jerry Avins wrote (in ) about 'DIGITAL GUITAR AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

It stands for a very great deal, and it's the newsgroup you are participating in.

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

I read in sci.electronics.design that Jerry Avins wrote (in ) about 'DIGITAL GUITAR AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

Why would gold be better? If it's density, depleted uranium should be even better!

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

Yes indeed.

Use a 32 or 64 point FFT (with about 10 Hz bins) to detect the lowest frequency. This can be done in a few hundred milliseconds.

After this decision, you are within about 10 Hz of the actual frequency. If you have enough memory, buffer the first tap on the string and rescan the samples to determine the frequency error.

If no data memory is available, analyze the next tap on the string to determine the frequency error.

Paul

Reply to
Paul Keinanen

The Fourier analysis assumes that you have a constant amplitude _repeatable_ waveform, unfortunately a string instrument does not generate such signals, so you have to analyze some part after the initial transient.

Paul

Reply to
Paul Keinanen

I read in sci.electronics.design that Bob Monsen wrote (in ) about 'DIGITAL GUITAR AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

Look for a winding handle at about waist-level. (;-)

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

Thank you for the thorough explanation!

The tuners I've been using seem to be able to guess the tone within one half, i.e. 5.9% in frequency. This seems to work pretty well, even though the detection is sometimes inconviniently slo.

However, I've always suspected the tuner measures the frequency directly and after that finds the nearest note from a LUT and then calculates the remainder. There is a LED bar display to show which note (A, A#, B, C, ...) is playing and then an analog meter to show the deviation from the even temperament (+-50 cents).

The tuner is quite fine with violins, flutes, and even piccolo flutes, but not very good with cellos, double basses, bass viols or other low instruments. It does find the correct note, but the detection is then very sensitive to higher-frequency noise.

But wouldn't a combination of an AGC and a hysteretic comparator be still better? The saturating stage does give some false zero crossings even though it filters out a lot. But shouldn't hysteresis filter all false crossings out, if the sum of amplitudes of harmonics is smaller than the hysteresis?

--
PLL, anyone? DPLL? In a way a PLL would be the right way to do this,
as the frequency under measurement changes slowly. Locking is,
 Click to see the full signature
Reply to
Ville Voipio

THERE HAVE BEEN A LITTLE LESS THAN A HUNDRED REPLIES ON THIS THREAD BUT UNDOUBTLY, IT TOTALLY CLEAR THAT YOU'RE THE ONLY ASSHOLE HANGING AROUND WITH SERIOUS THINKERS. IF IT SO HAPPENED THAT ALL OF THE OTHERS RESPONDED THE WAY YOU DID, MAYBE I WOULD THINK I WAS BEING AN ASSHOLE.

GUESS WHAT? YOU'RE THE SOLE STINKING SHIT SURROUNDED BY DECENT INTELLIGENT PEOPLE.

IM GETTING THINGS QUITE FAST NOW AND I CAN SAY THAT I CAN FINISH THE PROJECT ON TIME. THANKS FOR ALL THE GREAT MINDS WHO SHARED THEIR VIEWS AND EXPERTISE. SO IM KEEPING MY JOB, IM GETTING A LOT MORE LEARNING THAN EVER BEFORE AND I FOUND NEW GREAT FRIENDS ALL OVER THE WORLD.

AS FOR YOU, SAY SORRY TO YOUR MOTHER BECAUSE YOU JUST PROVED THAT SHE DEFINITELY FAILED TO RAISE YOU WELL...

Reply to
dhaevhid

Depends on the fretted instrument. The idea of fixed frets is a new one, older instruments tend to have movable frets. My viol (viola da gamba) has tied frets, and I really have to move them depending on the temperament. Actually, the deviation from even temperament is very visible (some frets are closer to each other than others). And talking about bending... some of the frets are actually non-horizontal to give better temperament.

Pianos are sometimes tuned in even temperament. Sometimes not, many tuners like to make them slightly tempered some way or another. It is a common misconception that the even temperament was invented by J.S.Bach (Wohl-temperierte Klavier). The even temperament was well known in the baroque era -- well known to be a bad compromise. What Bach discovered was yet another temperament system which allowed him to play in all keys. The keys sound fine but different.

I want to make it clear that I don't have any golden ears, which would be able to detect the frequency down to microhertz. But the fact is that I have to tune my frets to suit the needs and temperament of the rest of the band. In that task a tuner makes life much easier (without the golden ears I can only say something is wrong :)

I know it sounds a bit odd, but early music (especially baroque) players use auto-tuners a lot. For example, tuning a harpsichord without a tuner takes much longer. It is still possible with some experience on listening to the weak harmonic beats, but slower. Or, keeping a viol consort in tune during a longer concert is much easier with some fixed frequncy reference.

Yes, I know him (not personally, though). No, I am nowhere near that level.

(I just wonder if there was anything not off-topic in this posting?)

- Ville

--
Ville Voipio, Dr.Tech., M.Sc. (EE)
Reply to
Ville Voipio

Jerry Avins wrote in news:brydnYP4-My62 snipped-for-privacy@rcn.net:

It

Sounds like fun! but I'd take the Steinway.

Al

--
Al Clark
Danville Signal Processing, Inc.
 Click to see the full signature
Reply to
Al Clark

I read in sci.electronics.design that Jerry Avins wrote (in ) about 'DIGITAL GUITAR AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

An ichthyology group should be added, so that tuna experts can participate.

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

Thanks! And of course, need I mention how rare a clean limerick is? ;-)

Cheers! Rich

Reply to
Rich Grise

I read in sci.electronics.design that Rich Grise wrote (in ) about 'OT DIGITAL GUITAR AUTO-TUNER PROJECT', on Tue, 26 Apr 2005:

They are only rare because they are rarely quoted. Have you come across W S Gilbert's (he of the d'Oyly Carte operas) effort:

The was an old man of St Bees Who was stung on the arm by a wasp. When asked, 'Does it hurt?' He replied 'No, it don't. I'm so glad it wasn't a hornet.'

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.