Next  |  Prev  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Peak Matching (Step 5)

The peak detection process returns the prominent peaks in a given frame sorted by frequency. The next step is to assign some subset of these peaks to oscillator trajectories, which is done by the peak matching algorithm. If the number of spectral peaks were constant with slowly changing amplitudes and frequencies along the sound, this task would be straightforward. However, it is not always immediately obvious how to connect the spectral peaks of one frame with those of the next.

To describe the peak matching process, let's assume that the frequency tracks were initialized at frame $ 1$ and we are currently at frame $ m$. Suppose that at frame $ m-1$ the frequency values for the $ p$ tracks are $ f_1, f_2, \ldots\,,f_p$, and that we want to match them to the $ r$ peaks, with frequencies $ g_1, g_2, \ldots ,g_r$, of frame $ m$.

Each track looks for its peak in frame $ m$ by finding the one which is closest in frequency to its current value. The $ i$th track claims frequency $ g_j$ for which $ \vert f_i - g_j\vert$ is minimum. The change in frequency must be less than a specified maximum $ \Delta(f_i)$, which can be a frequency-dependent limit (e.g., linear, corresponding to a relative frequency change limit). The possible situations are as follows:

12pt (1) If a match is found inside the maximum change limit, the track is continued (unless there is a conflict to resolve, as described below).

12pt (2) If no match is made, it is assumed that the track with frequency $ f_i$ must ``turn off'' entering frame $ m$, and $ f_i$ is matched to itself with zero magnitude. Since oscillator amplitudes are linearly ramped from one the frame to the next, the terminating track will ramp to zero over the duration of one frame hop. This track will still exist (at zero amplitude), and if it ever finds a frame with a spectral peak within its capture range $ \Delta(f_i)$, it will ``turned back on,'' ramping its amplitude up to the newly detected value. It is sometimes necessary to introduce some hysteresis into the turning on and off process in order to prevent ``burbling'' of the tracks whose peaks sometimes make the cut and sometimes don't. Normally this problem can be avoided by searching for many more spectral peaks than there are oscillators to allocate.

12pt (3) If a track finds a match which has already been claimed by another track, we give the peak to the track which is closest in frequency. and the ``losing'' looks for another match. If the current track loses the conflict, it simply picks the best available non-conflicting peak. If the current track wins the conflict, it calls the assignment procedure recursively on behalf of the dislodged track. When the dislodged track finds the same peak and wants to claim it, it will see there is a conflict which it loses and will move on. This process is repeated for each track, solving conflicts recursively, until all existing tracks are matched or ``turned-off''.

After each track has extended itself forward in time or turned off, the peaks of frame $ m$ which have not been used are considered to be new trajectories and a new track is ``started-up'' for each one of them up to the maximum number of oscillators specified (which again should be less than the number of spectral peaks detected). The new oscillator tracks are started at frame $ n-1$ with zero magnitude and ramp to the correct amplitude at the current frame $ m$.

Once the program has finished, the peak trajectories for a sound look as in Fig. 6.

Figure 6: Peak trajectories for a piano tone.

Next  |  Prev  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Download parshl.pdf

``PARSHL: An Analysis/Synthesis Program for Non-Harmonic Sounds Based on a Sinusoidal Representation'', by Julius O. Smith III and Xavier Serra, Proceedings of the International Computer Music Conference (ICMC-87, Tokyo), Computer Music Association, 1987.
Copyright © 2005-12-28 by Julius O. Smith III and Xavier Serra
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA  [Automatic-links disclaimer]