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.
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.
Key Features:
- Per-file FFNet rule distillation — the current file supplies both the heuristic labels and the training examples.
- 9 acoustic inputs — MFCC 1–3, F1, F2, intensity, HNR, pitch, and explicit formant-validity evidence.
- Structural formant screening — formants are used only when enough reliable evidence exists in the file.
- Four heuristic classes — vowel, consonant, other, and silence.
- Temperature-shaped class weights — continuous synthesis weights derived from FFNet output activations.
- Adaptive stretch curve — weighted combination of the four class-specific duration factors.
- Temporal smoothing — moving-average smoothing before DurationTier construction.
- DurationTier resynthesis — one continuous duration mapping rather than separate segment-by-segment processing.
- Conditional limiter — output is scaled to 0.99 only when its peak exceeds 0.99.
- Mono processing — multichannel input is downmixed and output is mono.
Quick start
- Select exactly one Sound object.
- Run
Neural_Phonetic_Speed_Mapper.praat. - Choose a preset or Manual.
- For Manual, set Vowel_stretch, Consonant_stretch, Other_stretch, Silence_stretch, Smoothing_ms, and Temperature.
- Remember: >1 = longer, <1 = shorter, 1 = unchanged.
- Enable Draw_visualization to inspect class weights and the final duration-mapping curve.
- Click OK. The result is named
<source>_speedmap_<preset>.
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.
If fewer than two classes are present, the FFNet is skipped and the one-hot rule labels are used directly as the class weights.
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:
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.
| Class | Rule |
|---|---|
| Silence | Intensity below the file-relative silence threshold. |
| Vowel | Formant features active, frame-specific valid formants, HNR > 5 dB, F0 > 0, and F1 > 300 Hz. |
| Consonant | At or above the silence threshold and HNR < 3 dB. Voicing is not required. |
| Other | All remaining frames. |
Relative Silence Threshold
The classification therefore adapts to the level of the current recording rather than using a fixed 45 dB cutoff.
9 Input Features
| Feature | Normalization / representation |
|---|---|
| MFCC 1 | Per-file min-max to 0–1 |
| MFCC 2 | Per-file min-max to 0–1 |
| MFCC 3 | Per-file min-max to 0–1 |
| F1 | Per-file min-max to 0–1 when formant features are active |
| F2 | Per-file min-max to 0–1 when formant features are active |
| Intensity | Per-file min-max to 0–1 |
| HNR | Per-file min-max to 0–1 |
| Pitch | F0 / maximum voiced F0 in the current file, clipped to 0–1 |
| Formant-validity flag | 1 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.
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 value | Meaning |
|---|---|
| 0.5 | Approximately half the local duration |
| 1.0 | Unchanged local duration |
| 2.0 | Approximately 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.
This replaces the older idea of separately consolidating and processing phonetic segments. The output is produced from one continuous stretch trajectory.
Presets
| Preset | Vowel | Consonant | Other | Silence | Smoothing | Temp. |
|---|---|---|---|---|---|---|
| Manual | User | User | User | User | User | User |
| Speech Clarity | 1.3 | 1.8 | 1.2 | 0.8 | 25 ms | 0.35 |
| Vowel Stretch | 2.0 | 1.0 | 1.2 | 1.0 | 30 ms | 0.30 |
| Consonant Emphasis | 0.8 | 2.5 | 1.5 | 0.7 | 15 ms | 0.40 |
| Time Compress | 0.6 | 0.7 | 0.65 | 0.3 | 20 ms | 0.50 |
| Dreamy Slow | 2.5 | 1.5 | 2.0 | 1.8 | 40 ms | 0.25 |
| Rhythmic Stutter | 0.4 | 3.0 | 0.5 | 2.0 | 10 ms | 0.50 |
| Fast Forward | 0.5 | 0.5 | 0.5 | 0.2 | 15 ms | 0.40 |
Parameters
| Name | Default | Description |
|---|---|---|
| Preset | Manual | Manual or one of seven built-in mappings. |
| Vowel_stretch | 0.5 | Duration multiplier for vowel-weighted regions. |
| Consonant_stretch | 2.0 | Duration multiplier for consonant-weighted regions. |
| Other_stretch | 0.8 | Duration multiplier for other-class regions. |
| Silence_stretch | 1.0 | Duration multiplier for silence-weighted regions. |
| Smoothing_ms | 20 | Moving-average smoothing applied to the framewise duration factor. |
| Temperature | 0.4 | Shapes the FFNet output weights before duration blending. |
| Draw_visualization | On | Draw the v0.4 diagnostic page. |
| Play_result | On | Play the final Sound after processing. |
Visualization
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
- Object name:
<source>_speedmap_<preset>. - Type: mono Sound.
- Duration: determined by the integrated time-varying stretch mapping rather than by a single global multiplier.
- Peak handling: the output is scaled to 0.99 only when its peak exceeds 0.99; quiet output retains its natural level.
- Info window: reports preset, stretch settings, structural formant evidence, relative silence threshold, aligned frame count, class distribution, FFNet training/fallback status, and final duration ratio.