back to list

Re: My pitch reproduction capabilities

🔗Robert Walker <robertwalker@ntlworld.com>

7/17/2001 8:20:30 AM

Hi Haresh

I remember you asked about a tuner accurate to 0.1 cents.

I've been programming FTS to find the frequency of wave sound by counting note crossings.

It can do this very accurately, by doing a linear interpolation between samples at the zero
crossing. E.g. if one sample is +200 and the next one is -100 then the zero crossing is two thirds
of the way between the first and the second. So it can be much more accurate than the sample rate
would suggest.

Many timbres have a main peak every so often in the wave sound, followed by secondary peaks, and so
one can choose to ignore secondary peaks less than, say, 85 percent of the primary when counting the
wave crossings.

It only works for certain timbres at present, but works fine for most birdsong, and for some voices,
also recorder. Basically, if you look at the waveform in an oscilloscope, and it has primary peaks
regularly spaced at the frequency of the note, with the secondary peaks smaller, then it can be
done. (I've added a little oscilloscope to FTS to help check this).

This method can be accurate to up to +-0.1 cents for a 0.1 second clip. That's much more accurate
than one would normally expect from Fast Fourier Transforms, even with peak interpolation - one
would expect more like a second or two of sound at least.

I think it also has potential to be developed for a few more timbres by doing pattern recognition to
look for repeating patterns of waves.

Requires a fair amount of tweaking at present but I'd do some preset ones that work.

Anyway, here are two example clips from Veena Sahasrabuddhe's site - her voice works well.

http://tunesmithy.netfirms.com/tunes/Veena_Sahasrabuddhe_phrase1.mid
http://tunesmithy.netfirms.com/tunes/Veena_Sahasrabuddhe_phrase2.mid

(You may find they are overall sharp or flat, e.g. my soundcard is two and a half cents sharp when
playing midi, though it's relative pitch accuracy for midi is about +- 0.2 cents).

It's from:
http://stations.mp3s.com/stations/123/santhaa_notes.html Alap1 where she sings phrases slowly and
clearly for beginner singers to learn, so ideal for my program.

Two of the phrases - I'm sure you'll recognise them from the clip. Adds extra notes at times - e.g.
from the attack - means there was enough of that pitch in the attack for the program to recognise it
as an apparently new note.

In a glissando, then it adds new notes every so often.

Also as program is working by counting crossings rather than FFT, then there's no guarantee that
what it finds will actually be single pitches in the recording, rather than some combined effect of
various pitches causing a regularity of the crossings, but if the timbre is appropriate then it's
fine. Adding pattern recognition (by looking for repeating patterns of peaks that are almost
identical in size) will probably help eliminate false extra notes.

You can find my birdsong examples here:
http://tunesmithy.netfirms.com/tunes/birdsong.htm

I've also posted the two Veena Sahasrabuddhe midi clips there - I hope that is okay just for
demonstration purposes.

This isn't ready to try out yet, unfortunately, as I'm in middle of rather extensive revision of
FTS, just a taste of what's to come.

Robert

🔗X. J. Scott <xjscott@earthlink.net>

7/17/2001 9:06:19 AM

Robert,

> I think it also has potential to be developed for a few more
> timbres by doing pattern recognition to
> look for repeating patterns of waves.

I think you'll have trouble with that eventually so let
me give you a leapfrog hint.

For the more complex timbres, do try the FFT method but
you need to do two things for acceptable results:

1. Separate the harmonic and inharmonic portions of the
sound according to the method pioneered by Sttel and
Lippe.

2. Consider not just the strongest partial (which is
often not the fundamental), but starting at the
strongest ones, extract a model for the partials (as in
most real world sounds they are inharmonic) and track
the pitch using that model, making sure to have a
weighted score of the current strength of your model in
order to make sure it continues to be the best fit.

This method appears to work quite well in practice.

- Jeff

🔗Robert Walker <robertwalker@ntlworld.com>

7/17/2001 9:26:50 AM

Hi Jeff,

Thanks for the hint. Yes, I'm planning to use FFT for the more complex timbres.

I'm not going to try to do separating of multiple parts, just a single line so it should be
reasonably possible. I use peak interpolation to improve the accuracy of pitch, and I wonder if you
know anything about that?

At present, I have the options of quadratic, bayrcentric, Quinns first and second estimator, and
Jain's method.

Those are all three point methods. They work quite well, however I've been wondering if there is a
way of locating the peak to greater accuracy by using four or more points. Depending on the timbre,
with search for only the most prominent peaks, one may well only find a few, and the time spent
doing the peak interpolation isn't significant. I wonder if you have any ideas about four or more
point interpolation (or indeed about other three point ones, though these ones seem to work pretty
well).

I also tried zero padding, which adds a fair amount to the time, to memory needs, and also doesn't
seem to do that good a job of peak interpolation.

For locating the pitch of the note, at present I just do it so that it looks for the lowest pitched
partial in the timbre. It works quite well if one sets a background noise level appropriately. But
by no means perfect and does have tendency to occasionally octave jump. Maybe searching for a
harmonic series in the partials will help. Thanks for the suggestion.

Also at present I'm limiting it to short sound samples that can fit in memory, as idea is just to
use it in order to input a seed into FTS. Also possibly to use as a tuner (with the wave crossings
method and FFT as alternatives). Plus one will be able to play or sing a phrase, then get FTS to
quantise it to any scale / mode one likes and play it back again in that tuning, which could be
quite fun for learning various tunings.

Robert

🔗X. J. Scott <xjscott@earthlink.net>

7/17/2001 9:59:54 AM

Robert,

> I wonder if you have any ideas about four or more
> point interpolation

I haven't ever tried it from this angle and I must
admit I was very surprised you were able to get the
results you did doing what you are doing now, which I
would havwe said would not work that good.

Sorry I can't be of help here but it looks to me like
you're the current expert in this field.

- Jeff

🔗Haresh BAKSHI <hareshbakshi@hotmail.com>

7/17/2001 10:39:03 AM

--- In tuning@y..., "Robert Walker" <robertwalker@n...> wrote:
> Hi Haresh
>
> I remember you asked about a tuner accurate to 0.1 cents.
>
> I've been programming FTS to find the frequency of wave sound by
counting note crossings.
........................ >>>>>

Hi Robert, Jeff, thanks for your postings. This is going to be very
useful.

I believe that, as long as we deal with slow alap-s in voice, it is
going to be relatively simple. I will read the details in your
posting carefully and come back if I have any queries.

Regards,
Haresh.