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
Didn't find your answer? Ask the community — no account required.
P
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
J
Jon Harris
I know. I was just giving an example that was guitar-specific in response to a point that someone else made that equal temperament was bad.
J
Jerry Avins
Even though I have no idea what s.e.d. stands for, I doubt you can implement selectable intonation without getting into the firmware. In a YDP-233, one can chose among equal temperament (the default), or pure major, pure minor, Pythagorean, mean tone, Werkmeister, and Kirnberger, all with any base note. You can also transpose any number of half tones and pull the pitch of A440 in about .2 Hz increments from 427 to 453. It doesn't sound like the Steinway it replaced (my daughter has that now), but it's fun to play with as well as on. It will record two tracks and has a MIDI interface. More than I need.
Jerry
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
J
Jerry Avins
A piano's "stretch" over its 7.5 octaves is the better part of a semitone. By attaching discrete weights to the strings, most of the inharmonicity can be removed. (The windings on the low strings end well short of the bridges, reducing inharmonicity of the second partial.) A piano so doctored is tuned without stretch. It sounds awful!
Jerry
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
J
Jerry Avins
I agree. One point of quibble: even if the overtones were frequency locked, the wave shape would still change with time. Different overtones have different decay rates.
Jerry
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
J
John Woodgate
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
'What is a Moebius strip?'
http://www.jmwa.demon.co.uk Also see http://www.isce.org.uk
V
Ville Voipio
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,
as usual, a big challenge.
J
Jerry Avins
I've agreed so far, but not here. The zero crossings of the comparator's input and output had better coincide in time (with offset allowed for hysteresis). Those squiggles away from the crossings will be suppressed, but they don't matter anyway.
Some wouldn't even call it DSP, but I processed many signals that way for many years.
Jerry
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
J
Jon Harris
s.e.d. = sci.electronics.design. I think this was a joke, playing off the word "temperament". Get it?
V
Ville Voipio
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)
B
Bob Monsen
That is interesting. The book I referenced mentioned another possibility for why the stretch occurs. The human ear has far less ability to discriminate pitch at low and high frequencies than it does in the middle range. The other possibility was that the extra bit was required to overcome this inability, forcing the ear to hear an octave. However, the text also states that studies by Backus indicate that the mechanism of string inharmonicity accounts for most of the stretching..
I guess you have listened to these pianos. Do the high strings sound flat?
Regards,
Bob Monsen
J
Jerry Avins
Ah! I'm subscribed to comp.dsp. Ain't cross posting fun?
Jerry
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
R
Richard Owlett
Ahh but Jerry(and others)lurk(s) on comp.dsp ;) The joys of cross posted threads ;}
J
Jerry Avins
I do now. It's a pretty good one for off the cuff, as it were.
Jerry
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
J
Jerry Avins
Not so much flat as dull. Even single notes. Vladimir Horowitz disparaged the notion of changing the sound of a piano by the way one strokes the keys. He said, "There is such a thing as pianistic touch, but it cannot be demonstrated by playing a single note." Nevertheless, if we pretend for now that "touch" matters, a piano corrected for inharmonicity sounds to me as if the pianist were wearing thick felt gloves. The notes have no ... sparkle? We don't have the words. Have you ever improved a stew by adding a little vinegar? Inharmonicity is a piano's vinegar. Hammond organs are harmonic.
Jerry
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
R
rhnlogic
as
...
hence
The number of points used for resolution can be independant of the duration of the music input signal and the sample rate. See comments in other comp.dsp threads about FFT interpolation and zero padding.
What makes you think I haven't? Depending on the circumstances (type of instrument, amount and type of background noise, microphone characteristics, cpu power available, preferred user interface, etc.) and metrics (cents accuracy, response time, etc.), methods using FFTs as part of an algorithm can be either better or worse than the method you describe later on in this thread.
-- Ron Nicholson rhn AT nicholson D o T c O m
J
Jerry Avins
...
Classical guitars have a tilted bridge (bridge compensation), so in effect, all its frets are non horizontal.
[fine discourse snipped]
So what if there were? Anyway, with all the cross posting, there bound to be some groups whose charters touch on every part, but probably none that touch on all.
Jerry
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
J
Jerry Avins
...
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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
R
rhnlogic
An FFT is only a transform from one set of basis vectors to another. One need not make any assumptions about what happens outside the FFT sample window, particularly the assumption that the waveform will repeat when it doesn't. And there are several windowing methods to help deal with any transient artifacts which might be related to the ends of any data sample window.
-- Ron Nicholson rhn AT nicholson D o T c O m
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.