Dynamic Formant Sweeper — User Guide

Real‑time formant manipulation: applies LFO‑modulated formant filtering for vocal morphing, robotic effects, and dynamic spectral reshaping.

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

What this does

This script implements dynamic formant sweeping — a real‑time approach to vocal and timbral transformation using LFO‑modulated formant filters. The process extracts the source signal via inverse LPC, creates a time‑varying formant filter whose first formant (F1) is controlled by an LFO, and resynthesizes the sound with the moving filter. The result is a continuously morphing spectral envelope that can simulate vowel transitions, robotic voices, underwater effects, alien speech, and more.

Key Features:

What are formants? Formants are resonant frequency bands in the vocal tract that give vowels their characteristic color. In speech, F1 (first formant) typically ranges from 200 Hz to 1000 Hz and correlates with jaw opening; F2 (second formant) ranges from 800 Hz to 2500 Hz and correlates with tongue position. By dynamically shifting F1 with an LFO, we can create the illusion of a continuously changing vocal shape—even on non‑vocal sounds. This technique is used in voice synthesis, sound design, and audio special effects.

Technical Implementation: (1) Source‑Filter Separation: Extract the source signal (glottal pulse or noise) using inverse LPC filtering. (2) LFO‑Driven Formant Filter: Create a formant object and modify its F1 frequency according to the selected LFO waveform and rate. (3) Resynthesis: Filter the source with the time‑varying formant filter. (4) Dry/Wet Mix: Blend the processed signal with the original. (5) Visualization: Plot the LFO trajectory and a spectrogram showing the moving formant. The script handles stereo files by converting to mono for processing, then reconstituting stereo output.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…dynamic_formant_sweeper.praat.
  3. Choose a Preset or select “Custom” to adjust all parameters manually.
  4. Adjust LFO parameters (rate, min/max frequency, waveform).
  5. Set filter bandwidth and frame duration.
  6. Control dry/wet mix (0 = dry/original, 1 = fully processed).
  7. Enable Draw_visualization to see the LFO curve and spectrogram.
  8. Click OK — the swept sound appears as “originalname_swept_presetname”.
Quick tip: Start with the Gentle Vowel Morph preset for a subtle, vocal‑like sweeping effect. Use Robot Voice for a choppy, synthetic character. Adjust the dry/wet mix to blend the effect with the original sound. Enable visualization to see exactly how the formant moves over time. The script works on any sound—speech, singing, instruments, noise—but is most audible on sounds with clear spectral peaks.
Important: The script requires a selected Sound object (mono or stereo). Very short sounds (<0.1 s) may produce artifacts. High LFO rates (>10 Hz) can cause aliasing or unnatural “zipper” noise—consider reducing the frame duration for smoother modulation. The square‑wave LFO (chopper) creates abrupt frequency jumps that may sound harsh. Dry/wet mix = 0 gives the original sound; mix = 1 gives the fully processed sound. The output is normalized to ‑0.95 dBFS to prevent clipping.

Formant & LFO Theory

Formant Filtering Basics

Source‑Filter Model

The human voice (and many instruments) can be modeled as:

Source (excitation) × Filter (resonance) = Output sound Where: Source = glottal pulse (voiced) or turbulence (unvoiced) Filter = vocal‑tract resonances (formants) In this script: 1. Extract source via inverse LPC (Linear Predictive Coding) 2. Create a time‑varying formant filter (F1 moves with LFO) 3. Resynthesize: output = source × dynamic filter

First Formant (F1) Movement

F1 frequency correlates with jaw opening:

By sweeping F1 with an LFO, we simulate a continuously changing jaw opening—even on non‑speech sounds.

LFO Modulation

LFO Waveforms

📈 LFO Shapes & Sound Character

Sine: Smooth, natural vowel transitions. Sounds organic, vocal‑like.

Triangle: Linear sweeps up and down. Slightly more synthetic than sine.

Square (Chopper): Abrupt jumps between two frequencies. Creates robotic, stuttering effects.

Sawtooth: Gradual rise then sudden drop. “Zipper” or “laser” effects.

Reverse Sawtooth: Sudden rise then gradual fall. Less common, creates unique tension.

Modulation Range

The LFO moves F1 between min_freq_Hz and max_freq_Hz.

For a sine LFO: F1(t) = min_freq + (max_freq − min_freq) × 0.5 × [1 + sin(2π × rate × t)] For a square LFO: F1(t) = if sin(2π × rate × t) > 0 then max_freq else min_freq For a sawtooth LFO: F1(t) = min_freq + (max_freq − min_freq) × [(rate × t) mod 1]

Processing Pipeline

STEP 1 – SOURCE EXTRACTION: Input sound → LPC analysis (Burg method) → inverse filtering → source signal STEP 2 – DYNAMIC FORMANT FILTER: Create formant object with fixed F2–F5 Modify F1 frequency according to LFO waveform and rate Set F1 bandwidth to user‑specified value STEP 3 – RESYNTHESIS: Filter source signal with time‑varying formant filter STEP 4 – DRY/WET MIX: output = dry_signal × (1 − mix) + processed_signal × mix STEP 5 – POST‑PROCESSING: Apply gentle 8 kHz low‑pass filter (smooth artifacts) Fade in/out (10 ms / 20 ms) Normalize peak to 0.95 Convert back to stereo if input was stereo STEP 6 – VISUALIZATION (optional): Draw LFO trajectory (F1 vs. time) Draw spectrogram of output with overlaid F1 curve

Frame‑Based Processing

Formant analysis is performed on short, overlapping frames.

Frame duration (default 25 ms): Longer frames = smoother formant tracking, less temporal resolution Shorter frames = better time resolution, but more frame‑to‑frame fluctuation Frame overlap = 50% (Praat default) Time step = 0.005 s (5 ms) The LFO modifies the formant frequency within each frame, so the filter changes smoothly over time.

Preset Descriptions

Built‑in Presets

PresetRate (Hz)F1 Range (Hz)LFO ShapeCharacter
Gentle Vowel Morph0.3700–1200SineSmooth, natural vowel‑like sweeps
Robot Voice2.0400–2000SquareChopping, synthetic, robotic
Talking Synth0.5600–1800TriangleArticulated, synth‑voice, clear sweeps
Underwater0.2300–800SineSlow, murky, resonant
Alien Speech1.5800–3000SawtoothRising “zipper” effects, unnatural
Fast Wobble4.0500–2500SineRapid, vibrato‑like modulation
Slow Sweep0.1400–3500Reverse SawtoothVery gradual, evolving texture

🎭 Preset Deep Dive: Gentle Vowel Morph

Intended use: Natural‑sounding vowel transitions on speech or sung material.

Parameters: Rate = 0.3 Hz (slow), F1 range = 700–1200 Hz (typical vowel range), LFO = sine (smooth), bandwidth = 80 Hz (narrow, resonant), mix = 60% (subtle).

Result: The sound appears to slowly alternate between /a/‑like and /e/‑like colors, as if the jaw is gently opening and closing.

🤖 Preset Deep Dive: Robot Voice

Intended use: Classic “robot” or “chopper” effect.

Parameters: Rate = 2 Hz (medium‑fast), F1 range = 400–2000 Hz (wide), LFO = square (abrupt jumps), bandwidth = 150 Hz (wider, less resonant), mix = 85% (strong effect).

Result: The formant abruptly switches between two extreme frequencies, creating a stuttering, synthetic character.

🌊 Preset Deep Dive: Underwater

Intended use: Murky, resonant, “underwater” or “telephone” effect.

Parameters: Rate = 0.2 Hz (very slow), F1 range = 300–800 Hz (low), LFO = sine (smooth), bandwidth = 200 Hz (wide, diffuse), mix = 90% (almost fully processed).

Result: A slow, low‑frequency sweep that mimics the fluctuating resonances of water or a narrow‑band transmission.

Parameters & Controls

LFO Parameters

ParameterTypeDefaultDescription
Rate_Hzreal1.0LFO frequency in Hz (0.05–10 Hz typical)
Min_freq_Hzpositive500Minimum F1 frequency (Hz)
Max_freq_Hzpositive3500Maximum F1 frequency (Hz)
Lfo_shapeoptionSineWaveform: Sine, Triangle, Square, Sawtooth, Reverse Sawtooth

Filter Shape

ParameterTypeDefaultDescription
Bandwidth_Hzpositive100Bandwidth of the first formant (Hz). Wider = less resonant, more diffuse.

Processing Parameters

ParameterTypeDefaultDescription
Frame_duration_mspositive25Analysis frame duration in milliseconds (10–50 ms typical)
Dry_wet_mixreal1.0Mix between original (0) and processed (1) signal

Output Parameters

ParameterTypeDefaultDescription
Draw_visualizationboolean1Draw LFO curve and spectrogram after processing
Play_resultboolean1Play the result automatically

Applications

Vocal Transformation

Use case: Turn normal speech into singing‑like vowel sweeps, or create “talking synth” effects.

Technique: Use Gentle Vowel Morph or Talking Synth preset with dry/wet mix around 0.6–0.8.

Example: Apply to a spoken phrase; the formant sweeps give the impression of melodic vowel changes.

Robot & Sci‑Fi Effects

Use case: Classic robot voices, alien communication, computer‑generated speech.

Technique: Use Robot Voice (square LFO) or Alien Speech (sawtooth LFO) with high mix (0.8–1.0).

Workflow:

Textural Sound Design

Use case: Create evolving pads, underwater atmospheres, or moving resonances for film/game audio.

Technique: Use Underwater or Slow Sweep preset on sustained sounds (pads, drones, noise).

Advantages:

Instrument Processing

Use case: Add vocal‑like formant movement to instruments (guitar, synthesizer, wind instruments).

Technique: Use Fast Wobble (sine, 4 Hz) for a vibrato‑like effect, or Gentle Vowel Morph for slower, vowel‑colored sweeps.

Example: Apply to a synth pad; the moving formant adds a “talking” quality without pitch change.

Experimental Composition

Use case: Generate complex, unpredictable timbral changes for electroacoustic music.

Technique: Chain multiple instances with different LFO rates and shapes, or automate parameter changes via scripting.

Example: Process a percussion loop with Alien Speech (sawtooth, 1.5 Hz), then again with Slow Sweep (reverse sawtooth, 0.1 Hz) for layered motion.

Practical Workflow Examples

🎤 Vocal Thickening (Music Production)

Goal: Add subtle, moving formant energy to double‑tracked vocals.

Settings:

  • Preset: Gentle Vowel Morph
  • Dry/wet mix: 0.3–0.4
  • Rate: 0.4 Hz
  • F1 range: 600–1400 Hz

Result: The vocal gains a slowly shifting resonance that thickens the texture without obvious robotic artifacts.

🎬 Sci‑Fi Interface (Film Sound Design)

Goal: Create a “scanning” or “communicator” beep.

Settings:

  • Preset: Robot Voice
  • Dry/wet mix: 1.0
  • Rate: 1.5 Hz
  • F1 range: 800–2200 Hz
  • Apply to a short sine‑wave beep (1000 Hz)

Result: A synthetic, choppy beep that sounds like a machine‑generated signal.

🌌 Ambient Pad Processing (Electronic Music)

Goal: Turn a static synth pad into a slowly evolving, vowel‑like texture.

Settings:

  • Preset: Slow Sweep
  • Dry/wet mix: 0.8
  • Rate: 0.08 Hz (very slow)
  • F1 range: 400–1200 Hz
  • Bandwidth: 150 Hz

Result: A pad that gradually shifts its spectral center, creating a sense of slow breath or movement.

Advanced Techniques

Layering multiple sweeps:
  • Duplicate the script: Run the script twice on the same sound with different presets (e.g., Robot Voice + Underwater).
  • Mix the outputs: Use Praat’s “Combine to stereo” or “Mix” to blend the two processed versions.
  • Result: Complex, multi‑rate formant motion that no single LFO could produce.
Parameter automation via scripting:
  • Embed the script in a loop that gradually changes rate, range, or mix over time.
  • Example: start with Gentle Vowel Morph, end with Alien Speech for a “transformation” effect.
  • Use Praat’s “for” loops and “form” commands to create interactive parameter sweeps.

Troubleshooting Common Issues

Problem: Artifacts / “chirping” sounds
Cause: Frame duration too short, or LFO rate too high for the frame rate.
Solution: Increase frame_duration_ms (e.g., 40 ms) or reduce rate_Hz.
Problem: Effect too subtle
Cause: Dry/wet mix too low, or F1 range too narrow.
Solution: Increase mix to 0.8–1.0, widen min_freq_Hz and max_freq_Hz.
Problem: Output sounds “phasey” or distorted
Cause: LPC analysis failing on non‑vocal sounds (no clear formants).
Solution: Try a different preset (e.g., Underwater uses wider bandwidth) or reduce mix.
Problem: Stereo output is mono
Cause: Script converts stereo to mono for processing, then back to stereo. If the original stereo image is lost, it’s because the processing is identical on both channels.
Solution: Process left and right channels separately with slightly different parameters, then recombine.

Technical Deep Dive

LPC Analysis

Burg Method

Linear Predictive Coding (LPC) models the sound as:

y[n] = a₁ y[n‑1] + a₂ y[n‑2] + … + aₚ y[n‑p] + e[n] Where: y[n] = sample at time n aᵢ = predictor coefficients (determine formant frequencies) p = prediction order (here: sampleRate/1000 + 2) e[n] = residual (source signal) The Burg method estimates aᵢ by minimizing forward and backward prediction error.

Inverse Filtering

Once we have the filter coefficients, we can extract the source by inverse filtering:

Source = Input / Filter In Praat: LPC object → Filter (inverse) → Source signal The source contains the pitch (if voiced) or noise (if unvoiced), but not the formant resonances.

Formant Object Manipulation

Formula Interface

Praat allows direct formula‑based modification of formant frequencies and bandwidths.

For a sine LFO: Formula (frequencies): "if row = 1 then " + string$(min_freq) + " + " + string$(range) + " * 0.5 * (1 + sin(2*pi*" + string$(rate) + "*x)) else self endif" For a square LFO: Formula (frequencies): "if row = 1 then if sin(2*pi*" + string$(rate) + "*x) > 0 then " + string$(max_freq) + " else " + string$(min_freq) + " endif else self endif" The formula is evaluated for every frame (x = time of frame center).

Bandwidth Control

Bandwidth affects resonance sharpness:

Visualization Algorithm

📊 Two‑Panel Visualization

Upper panel: LFO trajectory (F1 frequency vs. time). Shows exactly how the formant moves according to the selected waveform.

Lower panel: Spectrogram of the output sound with the F1 curve overlaid in yellow. This confirms that the formant shift is audible in the output spectrum.

Purpose: Debugging, parameter fine‑tuning, and educational illustration of the effect.