Neural Phonetic Speed Mapper — User Guide

Adaptive duration mapping driven by per-file FFNet distillation of heuristic vowel, consonant, other, and silence labels, with temperature-shaped class weights, smoothed stretch factors, DurationTier resynthesis, and exact mono output from a mono analysis path.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4 (2026) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

Neural Phonetic Speed Mapper analyzes one Sound on the timing grid of its MFCC frames, assigns each frame a heuristic class — vowel, consonant, other, or silence — and, when at least two classes are present, trains a small FFNet on that same file to reproduce those rule labels from nine acoustic inputs.

The FFNet output-layer activations are converted into temperature-shaped class weights. Those weights are combined with four user-defined stretch factors, smoothed over time, sampled into a Praat DurationTier, and used for overlap-add resynthesis.

Stretch-factor direction: values greater than 1 make the corresponding material longer; values below 1 make it shorter. A factor of 1 means unchanged duration. These are duration multipliers, not playback-speed multipliers.

Key Features:

Scope: this is not a corpus-trained phonetic recognizer. There is no external training set, held-out evaluation, or phonetic ground truth. The FFNet learns the current file's own rule-based categories.

Quick start

  1. Select exactly one Sound object.
  2. Run Neural_Phonetic_Speed_Mapper.praat.
  3. Choose a preset or Manual.
  4. For Manual, set Vowel_stretch, Consonant_stretch, Other_stretch, Silence_stretch, Smoothing_ms, and Temperature.
  5. Remember: >1 = longer, <1 = shorter, 1 = unchanged.
  6. Enable Draw_visualization to inspect class weights and the final duration-mapping curve.
  7. Click OK. The result is named <source>_speedmap_<preset>.
Input requirements: source duration must be at least 0.1 s, MFCC analysis must produce at least one frame, and the sample rate must be high enough for the formant-analysis stage.
Channel behavior: multichannel input is converted to mono before analysis and resynthesis. The final output is mono.

Per-file FFNet Distillation

What is per-file FFNet distillation?

The script first labels every analysis frame with deterministic acoustic rules. Those same frames and labels are then used to train a feed-forward neural network inside Praat. The network is therefore not learning phonetic categories from an external corpus; it learns a smoother mapping from the current file's acoustic features to the current file's rule labels.

Network: 9 inputs 16 hidden units N output classes actually present Training: up to 800 iterations 100-iteration chunks learning rate = 0.001 minimum-squared-error cost

If fewer than two classes are present, the FFNet is skipped and the one-hot rule labels are used directly as the class weights.

Convergence: training can stop when the training cost changes by less than 0.1% for five consecutive chunks. This is a training-cost convergence rule, not validation-based early stopping.

Formant Evidence

What is formant evidence?

The script does not automatically trust every F1/F2/F3 value returned by Burg analysis. It first checks whether the frame is voiced and harmonic enough and whether the formant frequencies and bandwidths form a structurally plausible pattern. Only then is the frame marked as having valid formant evidence.

A frame is considered structurally valid only when all three formants and their bandwidths are defined and satisfy a series of plausibility checks, including F1/F2/F3 ordering, separation, bandwidth limits, Nyquist limits, positive pitch, and positive HNR.

The script then measures how much of the file has reliable formant evidence:

valid fraction = valid formant frames / all analysis frames if valid fraction >= 0.15: formant features ACTIVE otherwise: formant features DISABLED

When active, invalid frames use the current file's mean valid F1/F2 as neutral fills plus an explicit validity flag. When disabled, F1/F2 and the validity input are neutralized. This prevents unreliable Burg poles in noisy material from acting as phonetic evidence.

Heuristic Phonetic Classes

What are the heuristic phonetic classes?

The four categories are operational synthesis-control classes defined by the script's acoustic rules. They should not be interpreted as a validated linguistic transcription.

ClassRule
SilenceIntensity below the file-relative silence threshold.
VowelFormant features active, frame-specific valid formants, HNR > 5 dB, F0 > 0, and F1 > 300 Hz.
ConsonantAt or above the silence threshold and HNR < 3 dB. Voicing is not required.
OtherAll remaining frames.

Relative Silence Threshold

silence threshold = maximum file intensity - 35 dB

The classification therefore adapts to the level of the current recording rather than using a fixed 45 dB cutoff.

9 Input Features

FeatureNormalization / representation
MFCC 1Per-file min-max to 0–1
MFCC 2Per-file min-max to 0–1
MFCC 3Per-file min-max to 0–1
F1Per-file min-max to 0–1 when formant features are active
F2Per-file min-max to 0–1 when formant features are active
IntensityPer-file min-max to 0–1
HNRPer-file min-max to 0–1
PitchF0 / maximum voiced F0 in the current file, clipped to 0–1
Formant-validity flag1 only for structurally valid formant frames when formant features are active

The analysis grid is defined directly by the MFCC frame times at a 5 ms step, keeping all other features aligned to the MFCC object.

Temperature-Shaped Class Weights

What does Temperature do?

The script reads the FFNet's output-layer activations and applies exponential temperature shaping. Lower values make the strongest class activation dominate more sharply; higher values distribute more weight among the available classes.

for each class c: e_c = exp((activation_c - max_activation) / Temperature) weight_c = e_c / sum(e_all_classes)

The weights sum to 1, but they are not calibrated class probabilities.

Adaptive Stretch Factor

What is the adaptive stretch factor?

Each frame receives one duration multiplier computed as a weighted blend of the four class-specific stretch settings. Because the class weights sum to 1, the curve moves continuously between the user-selected vowel, consonant, other, and silence duration factors.

stretch(t) = vowel_weight(t) * Vowel_stretch + consonant_weight(t) * Consonant_stretch + other_weight(t) * Other_stretch + silence_weight(t) * Silence_stretch runtime clamp: 0.1 <= stretch <= 10
Stretch valueMeaning
0.5Approximately half the local duration
1.0Unchanged local duration
2.0Approximately twice the local duration

Smoothing

The framewise stretch curve is smoothed with a moving average whose radius is derived from Smoothing_ms. Larger values create slower duration changes; smaller values retain more local variation.

DurationTier Resynthesis

What is a DurationTier?

A Praat DurationTier is a time-varying curve of local duration multipliers. The script writes the smoothed stretch mapping into a DurationTier and places it inside a Manipulation object. Praat then performs overlap-add resynthesis according to that single continuous duration mapping.

DurationTier points: first point at sound start intermediate points about every 20 ms final point at sound end

This replaces the older idea of separately consolidating and processing phonetic segments. The output is produced from one continuous stretch trajectory.

Presets

PresetVowelConsonantOtherSilenceSmoothingTemp.
ManualUserUserUserUserUserUser
Speech Clarity1.31.81.20.825 ms0.35
Vowel Stretch2.01.01.21.030 ms0.30
Consonant Emphasis0.82.51.50.715 ms0.40
Time Compress0.60.70.650.320 ms0.50
Dreamy Slow2.51.52.01.840 ms0.25
Rhythmic Stutter0.43.00.52.010 ms0.50
Fast Forward0.50.50.50.215 ms0.40
Interpretation: all values in the Vowel/Consonant/Other/Silence columns are duration multipliers. For example, Consonant Emphasis uses 2.5 for consonants, meaning those regions are strongly lengthened.

Parameters

NameDefaultDescription
PresetManualManual or one of seven built-in mappings.
Vowel_stretch0.5Duration multiplier for vowel-weighted regions.
Consonant_stretch2.0Duration multiplier for consonant-weighted regions.
Other_stretch0.8Duration multiplier for other-class regions.
Silence_stretch1.0Duration multiplier for silence-weighted regions.
Smoothing_ms20Moving-average smoothing applied to the framewise duration factor.
Temperature0.4Shapes the FFNet output weights before duration blending.
Draw_visualizationOnDraw the v0.4 diagnostic page.
Play_resultOnPlay the final Sound after processing.
Internal settings: frame step = 5 ms, hidden units = 16, maximum training iterations = 800, learning rate = 0.001, vowel HNR threshold = 5 dB, consonant HNR threshold = 3 dB, silence drop = 35 dB, minimum file-wide valid-formant fraction = 15%.

Visualization

HEADER source | preset | analysis-frame count | Temperature SOURCE SOUND original waveform SPEED-MAPPED OUTPUT final mono output duration / output-to-source duration ratio PHONETIC WEIGHTS red = vowel blue = consonant green = other grey = silence SMOOTHED DURATION MAPPING purple = smoothed stretch factor dashed reference = 1.0 unchanged SUMMARY STRIP class distribution four stretch factors smoothing valid-formant evidence formant features active/disabled original -> output duration measured duration ratio

How to read the phonetic-weight plot

The four curves show the temperature-shaped class weights used to build the duration factor. They are synthesis-control weights, not calibrated probabilities.

How to read the duration-mapping plot

The purple curve is the smoothed local duration multiplier that is written into the DurationTier. The dashed line at 1.0 means unchanged duration. Values above the line lengthen the local material; values below the line shorten it.

Outputs

Reproducibility: the current script has no Random_seed control even though FFNet initialization/training can be stochastic. Repeated runs with the same input and settings may therefore differ slightly.