Pitch Change Toolbox
Malcolm Slaney, Microsoft Research
October 2014

This toolkit measures the change in pitch of an audio signal. It is based on the paper:
	Malcolm Slaney, Elizabeth Shriberg and Jui-Ting Huang. 
	Pitch-gesture modeling using subband autocorrelation
	change detection. Proceedings of Interspeech 2013, ISCA
	http://research.microsoft.com/apps/pubs/default.aspx?id=199653
	http://www.isca-speech.org/archive/interspeech_2013/i13_1911.html

Pitch is inherently difficult to measure. While in many cases the pitch is unambiguous, there are often difficulties due to octave jumps, and changing in voicing. I estimate that the Keele database, a common ground truth used for pitch experiments, has about 5% of the frames with confusing or perhaps incorrect labels.

This toolkit is written for Matlab.  It can train a model using your own data (and parameters) and it can use an existing model (included) to calculate the pitch of an audio signal.

DEPENDENCIES
This toolbox depends on two other toolboxes to do its work: Netlab and the Auditory Toolbox.

The Netlab Neural Network Software is a toolbox written by Ian Nabney which implements many different kinds of machine-learning algorithms.  The Pitch Change Toolbox uses it to train a multi-layer perceptron (MLP) that does the basic pitch estimation (ala Dan Ellis' work.)  This toolbox is available at:
	http://www.aston.ac.uk/eas/research/groups/ncrg/resources/netlab/

The Auditory Toolbox is available at
	https://engineering.purdue.edu/~malcolm/interval/1998-010/
and implements many common kinds of auditory processing.  It's used here for the gammatone filterbank and the correlogram calculation.

PRELIMINARIES
The Auditory Toolbox contains one function we need to enhance.  (Microsost doesn't have permission to distribute this toolbox.)  Before you can use the PitchChangeToolbox you will need to perform the following steps:
1) Copy the MakeERBFilters function from the Auditory Toolbox to the location where you have installed the Pitch Change Toolbox.  The new name should be
	MakeERBFiltersWide.m
2) Change the first line to add a fourth parameter:
function fcoefs=MakeERBFiltersWide(fs,numChannels,lowFreq,widthFactor)
3) About line 60, there is a line that says:
	B=1.019*2*pi*ERB;
change it to read:
	B=1.019*2*pi*ERB*widthFactor;
by adding the extra term "*widthFactor" to the end of the line.

Be sure that both Netlab and the Auditory Toolbox are on the Matlab path.  There is sample code in the TestCode.m file.

MODEL
This pitch tracker is based on a probabilistic model that connects spectral information from the waveform to likely pitch classes. In this release we provide a pretrained model that accomplishes this task so you can compute pitch and pitch change out of the box.  Alternatively, the code is provided so you can train and test your own model with your own data.

TESTING
There is sample code in the file TestCode.m that exercises all the functions.  There are two halves to this script, one that shows how to calculate the pitch with an exisiting pitch model, and the other that uses the Graz pitch database to compute and test a new model.

The Graz pitch database is described in this newsletter article and is available for download
	Franz Pernkopf, Michael Wohlmayr, and Gernot Kubin. 
	Pitch Tracking Corpus with Multipitch Tracking 
	Evaluation, IEEE Signal Processing Society, 
	SLTC Newsletter, 
	http://www.signalprocessingsociety.org/technical-committees/list/sl-tc/spl-nl/2012-02/PitchTracking/

The directory or folder "html" contains a web page that shows the same output from this routine.  The TestCode.m routine exercises all the critical functions in the PitchChange toolbox.

Good luck, and enjoy.

--- Malcolm Slaney
Microsoft Research, Speech and Dialog Group
mslaney@microsoft.com or malcolm@ieee.org
October 9, 2014




	



