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 / F_{min}) / log (F_{max} / F_{min}), 
where F_{min} and F_{max} 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 F_{min} and F_{max} 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 = F_{min} · 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 t_{i} 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 t_{min} and t_{max} are the start and end time of the interval and r_{i} is the i^{th} relative time, the times t_{i} are calculated according to the options as:

fractions

t_{i} = t_{min} + r_{i} (t_{max} – t_{min}). 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

t_{i} = t_{min}+ 0.01 r_{i} (t_{max} – t_{min}). 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

t_{i} = t_{min} + r_{i}. 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.
© djmw, August 1, 2017