PitchTier: Modify interval (tone levels)...

Modifies a selected interval from the chosen PitchTier by replacing the contents of the interval by newly defined pitch points.

For tone languages the pitch contours of the tones are often expressed as a sequence of tone levels instead of a sequence of real frequency values in hertz because tone levels abstract away from the possibly different pitch ranges of individual speakers.

The tone levels T are calculated from a given pitch frequency in hertz as:

 T = numberOfToneLevels · log (frequency / Fmin) / log (Fmax / Fmin),

where Fmin and Fmax are the minimum and the maximum frequency of a speaker's pitch range and numberOfToneLevels is the number of levels into which the pitch range is divided. This formula maps any frequency between Fmin and Fmax to a number between 0 and numberOfToneLevels.

To get the frequency in hertz from a specified tone level T we have to use the inverse formula:

 frequency = Fmin · 10(T · log (Fmax / Fmin)) / numberOfToneLevels).

### Settings

Time range (s)
the start and end time of the interval where the changes will be applied.
Pitch range (Hz)
The minimum and maximum frequency to which the tone levels refer.
Number of tone levels
The number of levels into which the pitch range is divided.
Relative times
determine, together with the following option, the times of the new pitch points with respect to the start time of the interval.
determines how the times ti of the new pitch points are calculated. The time of each new pitch point is determined by adding to the start time of the interval a time calculated from the relative time value. If tmin and tmax are the start and end time of the interval and ri is the ith relative time, the times ti are calculated according to the options as:
fractions
ti = tmin + ri (tmaxtmin). The relative time values are fractions of the interval duration. Normally fractions are numbers in the range 0.0 to 1.0, although smaller and larger numbers are allowed.
percentages
ti = tmin+ 0.01 ri (tmaxtmin). The relative time values are percentages of the interval duration. Normally percentages are numbers in the range 0.0 to 100.0, although smaller and larger numbers are allowed.
independent
ti = tmin + ri. The relative time values specify an offset in seconds here.
Tone levels
specify the frequencies at the corresponding time points as tone levels.

### Algorithm

1. The real times are calculated from the relative times.

2. The frequencies are calculated from the tone levels.

3. The real times and the frequencies are sorted together by time.

4. All pitch points in the PitchTier between the first and the last time of the sorted time array are removed.

5. The newly calculated pitch points are added to the PitchTier.