Cracking the unisons

Ron Nossaman rnossaman@cox.net
Sat, 07 Jan 2006 14:53:25 -0600


> Even though both programs use a spinner, which looks like 
> a phase-type display, it is entirely possible to synthesize the movement 
> of the spinner from calculations that are based on FFTs.  In principle, 
> it should be possible to extract the same amount of information from a 
> FFT, provided the sample period was optimally-chosen.  

That's what I thought originally. Now I'm not so sure. The trade off 
between sampling rate and pitch resolution takes FFT out of the 
ballpark for fine pitch resolution pretty quickly.

Sampling rate must be higher than the Nyquist frequency, which is 
twice the highest frequency the system produces. Since we're only 
interested in frequencies up to the 4186+Hz of C-8, a sampling rate 
of 11025 Hz might work. That would give us a 2.69 Hz bin resolution 
in a 4096 bin FFT, which is manageable in real time, and 
interpolation and averaging could get us a usable resolution. 
Trouble is, while we may only be interested in the 4186+Hz of C-8, 
it has partials too, so it and anything else anything producing 
partials more than half the sampling rate will produce artifacts, 
even from octaves down scale, and mess up our resolution. So we go 
to a 22050Hz sample rate. That raises the Nyquist frequency high 
enough to eliminate a lot of the artifacting from higher partials 
toward the top of the scale, but it halves our pitch resolution to 
5.38Hz per bin. Interpolation in real time at this resolution most 
likely isn't going to get you close enough to function as a tuning 
device. So you double the sample length to 8192. That gets you back 
to the 2.69Hz bin resolution, but doubles your processing time, and 
still may not be a fine enough resolution for a tuning device. It 
also takes 0.37 seconds just to acquire the sample. So since 
increasing the sample rate lowers bin resolution, that just 
aggravates the problem, so going to 44100Hz or higher sampling 
wouldn't help anything. Larger arrays increase pitch resolution, but 
eat up machine cycles to the point that any but the newest machines 
will take more time processing the FFT array than it takes to 
retrieve the sample - even with your nice optimized Hartley 
transform. This can be alleviated somewhat by interlacing task 
cycles, as you seem to have done from the beginning with Tunelab. 
This is also, I presume, why you went with a quadrature phase 
algorithm for pitch matching instead of just extracting the needed 
information from the FFT that you were already generating for the 
spectrum display.

So while it very well may be possible in dedicated hardware, to 
process a large enough array at a high enough sample rate to 
minimize Nyquist artifacting and produce a high enough pitch 
determination accuracy to work as a tuning device, I don't believe 
it's yet possible in today's general purpose computers and hand 
helds. If it is, in real time, to an accuracy suitable for use in a 
piano tuning device, I'd still love to know how it's done.

Ron N

This PTG archive page provided courtesy of Moy Piano Service, LLC