Multi-Layer Audio Visualizer — User Guide

Comprehensive audio analysis visualization: displays multiple acoustic features simultaneously in a unified, layered display for detailed audio analysis.

Author: Based on Praat AudioTools by Shai Cohen Version: 2025 Style: EAnalysis-inspired multi-layer visualization
Contents:

What this does

This script implements a multi-layer audio visualizer — a comprehensive analysis tool that displays multiple acoustic features simultaneously in a unified visualization. The process: (1) Feature extraction: Create analysis objects for intensity, pitch, formants, spectral features, and pulses, (2) Layer organization: Arrange different features in dedicated vertical zones, (3) Normalized display: Map each feature to its display zone with appropriate scaling, (4) Visual rendering: Draw each layer with distinct colors and styles, (5) Labeling: Add comprehensive labels and legends. Result: a unified visualization showing multiple acoustic dimensions that reveals relationships between different audio features.

Key Features:

What is multi-layer audio visualization? Traditional analysis: separate displays for each feature (spectrogram, pitch track, intensity). Multi-layer visualization: unified display showing multiple features simultaneously. Advantages: (1) Relationship revelation: Shows how different features interact, (2) Efficiency: Single view contains multiple analyses, (3) Pattern recognition: Easier to spot correlations between features, (4) Teaching tool: Excellent for demonstrating acoustic principles, (5) Research utility: Comprehensive view for detailed analysis. Use cases: Speech analysis (formant-pitch relationships), music analysis (melodic-harmonic interactions), sound design (spectral-temporal patterns), linguistic research (articulatory-acoustic mapping), audio forensics (multi-feature analysis).

Technical Implementation: (1) Parameter collection: User selects which layers to display. (2) Analysis object creation: Only creates needed objects (Intensity, Pitch, Formant, Spectrogram, PointProcess). (3) Zone definition: Each feature gets dedicated vertical space. (4) Frame processing: Processes audio in time steps. (5) Feature mapping: Normalizes each feature to its display zone. (6) Visual rendering: Draws each layer with appropriate style. (7) Cleanup: Removes temporary analysis objects. Key insight: Unified coordinate space + feature-specific normalization + selective display = comprehensive audio visualization.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…multi_layer_visualizer.praat.
  3. Select which layers to draw (all enabled by default).
  4. Choose which formants to display (F1, F2, F3).
  5. Adjust analysis parameters if needed (time step, pitch range).
  6. Set visual parameters (intensity range).
  7. Click OK — creates analysis objects, draws visualization in Picture window.
Quick tip: Start with all layers enabled for comprehensive overview. For speech analysis, focus on formants + pitch + intensity. For music analysis, emphasize pitch + spectral features. Use time step 0.01s for detailed analysis, 0.02s for faster processing. Adjust pitch range to match your audio (75-600 Hz for speech, 50-1000 Hz for music). Processing time depends on audio length and enabled features.
Important: PICTURE WINDOW OUTPUT — visualization appears in Praat's Picture window, not as a new object. Long audio files with many enabled layers may take significant processing time. Formant analysis works best on clean speech signals. Pitch tracking may fail on noisy or complex signals. Spectral features require spectrogram computation (can be slow). All analysis objects are automatically removed after visualization to keep object list clean. Always check Info window for processing status and any warnings.

Multi-Layer Visualization Theory

Coordinate Space Organization

Vertical Zone Allocation

Normalized display space (0-1):

Vertical zones (normalized 0-1): Intensity: 0.00 - 0.12 Formant F1: 0.15 - 0.25 Formant F2: 0.28 - 0.38 Formant F3: 0.41 - 0.51 Spectral Poly: 0.54 - 0.64 Spectral Cent: 0.67 - 0.77 Pitch: 0.80 - 0.92 Pulses: 0.96 (fixed) Horizontal axis: time (start to end) Mapping principle: Each feature normalized within its zone Features don't overlap visually Clear visual separation for easy reading

Normalization and Mapping

Feature-specific scaling:

Generic mapping function: procedure mapToRange: value, fromMin, fromMax, toMin, toMax value = max(fromMin, min(fromMax, value)) # Clamp result = toMin + (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) Feature-specific ranges: Intensity: intensityMinDb (40) to intensityMaxDb (80) dB Formant F1: 200 to 1000 Hz Formant F2: 800 to 2800 Hz Formant F3: 1500 to 3500 Hz Pitch: pitchFloor to pitchCeiling Hz Spectral Cent: 0 to 5000 Hz Spectral Poly: 0 to 1 (normalized power) This ensures each feature uses its full display zone appropriately

Visual Hierarchy Principles

Layer Organization Strategy

Logical grouping of features:

Bottom to top organization: INTENSITY (bottom): - Amplitude/loudness information - Foundation of acoustic analysis - Light blue rectangles FORMANT REGION (low-mid): - F1, F2, F3 vowel formants - Critical for speech analysis - Red, Green, Blue curves SPECTRAL REGION (mid): - Spectral shape information - Polygons: spectral distribution - Centroid: brightness measure - Orange colors PITCH REGION (high): - Fundamental frequency - Melodic/prosodic information - Magenta curve PULSES (top): - Glottal pulse locations - Timing/rhythm information - Red circles This organization follows acoustic analysis conventions

Temporal Resolution Considerations

Frame-based Processing

Time step impact on visualization:

Frame calculation: numFrames = floor(duration / timeStep) + 1 Time step effects: 0.005 s: Very high resolution (200 fps) 0.01 s: High resolution (100 fps) - default 0.02 s: Medium resolution (50 fps) 0.05 s: Low resolution (20 fps) Trade-offs: Smaller timeStep: More detailed, slower processing Larger timeStep: Less detailed, faster processing Feature-specific considerations: Formants: Need ~0.01s for smooth tracks Pitch: Can use 0.01-0.02s typically Intensity: Less critical, can use larger steps Spectral features: Benefit from higher resolution

Complete Processing Pipeline

INPUT: Sound object STEP 1: PARAMETER COLLECTION - User selects which layers to display - Sets analysis and visual parameters STEP 2: ANALYSIS OBJECT CREATION IF drawIntensity: Create Intensity object IF drawPitch OR drawPulses: Create Pitch object IF drawFormants: Create Formant object IF drawSpectralCentroid OR drawSpectralPolygons: Create Spectrogram IF drawPulses: Create PointProcess (pulses) STEP 3: DISPLAY SETUP - Clear Picture window - Set viewport and axes - Define vertical zones for each feature STEP 4: LAYER RENDERING (in order) LAYER 1: Intensity (rectangles) LAYER 2: Formants F1/F2/F3 (curves) LAYER 3: Pitch (curve with voicing gaps) LAYER 4: Spectral Centroid (curve) LAYER 5: Spectral Polygons (shapes) LAYER 6: Pulses (markers) STEP 5: LABELING AND LEGEND - Add title and axis labels - Add feature labels on right - Color-coded legend STEP 6: CLEANUP - Remove temporary analysis objects - Display completion message OUTPUT: Multi-layer visualization in Picture window

Visualization Layers

Layer 1: Intensity

📊 Amplitude Visualization

Visualization: Vertical rectangles representing intensity

Color: Light blue {0.7, 0.7, 0.85}

Analysis: Praat Intensity object with 75 Hz floor

Normalization: User-defined dB range to zone height

Best for: Overall loudness patterns, amplitude modulation

Intensity Implementation

Intensity rendering: FOR each frame i from 1 to numFrames: t = startTime + (i - 1) × timeStep intensity = Get value at time: t, "Linear" IF intensity ≠ undefined: # Map intensity to zone height @mapToRange: intensity, intensityMinDb, intensityMaxDb, intensityYMin, intensityYMax yTop = mapToRange.result # Draw rectangle rectWidth = timeStep × 0.8 Paint rectangle: color, t - rectWidth/2, t + rectWidth/2, intensityYMin, yTop Parameters: intensityMinDb = 40 dB (typical quiet) intensityMaxDb = 80 dB (typical loud) Adjust based on recording levels

Layer 2: Formants

🎵 Vocal Tract Resonance Tracking

Visualization: Continuous curves for F1, F2, F3

Colors: Red (F1), Green (F2), Blue (F3)

Analysis: Burg method formant tracking

Normalization: Frequency ranges mapped to zone heights

Best for: Speech analysis, vowel identification, vocal tract changes

Formant Frequency Ranges

Typical formant ranges (adult speech): F1 (First formant): Range: 200-1000 Hz Related to: Vowel height (open/close) High F1: Open vowels (/a/, /æ/) Low F1: Close vowels (/i/, /u/) Display: Red curve F2 (Second formant): Range: 800-2800 Hz Related to: Vowel frontness/backness High F2: Front vowels (/i/, /e/) Low F2: Back vowels (/u/, /o/) Display: Green curve F3 (Third formant): Range: 1500-3500 Hz Related to: Lip rounding, nasalization Also important for /r/ sounds Display: Blue curve Formants appear as horizontal bands during stable vowels

Layer 3: Pitch

🎶 Fundamental Frequency Contour

Visualization: Continuous curve with gaps at unvoiced regions

Color: Magenta

Analysis: Praat Pitch object with autocorrelation

Normalization: User-defined pitch range to zone height

Best for: Intonation, melody, prosody, voice quality

Pitch Tracking with Voicing Detection

Pitch rendering with voicing awareness: previousVoiced = 0 # Track voicing state FOR each frame i from 1 to numFrames-1: t1 = startTime + (i-1) × timeStep t2 = startTime + i × timeStep pitch1 = Get value at time: t1, "Hertz", "Linear" pitch2 = Get value at time: t2, "Hertz", "Linear" IF pitch1 ≠ undefined AND pitch2 ≠ undefined: # Both frames voiced - map to display @mapToRange: pitch1, pitchFloor, pitchCeiling, pitchYMin, pitchYMax y1 = mapToRange.result @mapToRange: pitch2, pitchFloor, pitchCeiling, pitchYMin, pitchYMax y2 = mapToRange.result # Only draw if previous frame was also voiced # This prevents vertical jumps between voiced sections IF previousVoiced = 1: Draw line: t1, y1, t2, y2 previousVoiced = 1 ELSE: # Unvoiced frame - break the line previousVoiced = 0 This creates clean pitch contours without spurious connections

Layer 4: Spectral Centroid

🌟 Spectral Brightness Indicator

Visualization: Continuous curve showing spectral center of mass

Color: Orange {1, 0.5, 0}

Analysis: Power-weighted frequency average

Normalization: 0-5000 Hz to zone height

Best for: Timbre brightness, spectral balance, instrument identification

Spectral Centroid Calculation

Spectral centroid computation: FOR each time frame: totalPower = 0 weightedSum = 0 numBands = 20 maxFreq = 5000 FOR band from 1 to numBands: freq = band × 250 # 250 Hz steps power = Get power at: time, freq IF power ≠ undefined AND power > 0: totalPower += power weightedSum += power × freq IF totalPower > 0: centroid = weightedSum / totalPower ELSE: centroid = undefined Interpretation: High centroid: Bright sounds (cymbals, fricatives) Low centroid: Dark sounds (bass, vowels) Changing centroid: Spectral evolution

Layer 5: Spectral Polygons

🔺 Spectral Shape Representation

Visualization: Diamond shapes showing spectral distribution

Color: Light orange {0.9, 0.7, 0.3}

Analysis: Three-band spectral energy ratios

Normalization: Normalized power to polygon shape

Best for: Spectral balance, formant structure, timbre shapes

Polygon Shape Encoding

Three-band spectral representation: Frequency bands: Low: 0-1000 Hz (foundation, F1 region) Mid: 1000-3000 Hz (F2-F3 region, intelligibility) High: 3000-5000 Hz (brightness, frication) Polygon vertices: Bottom: Low frequency energy Right: Mid frequency energy Top: High frequency energy Left: Fixed (completes diamond) Shape interpretation: Wide base: Strong low frequencies Wide right: Strong mid frequencies Tall: Strong high frequencies Small: Weak overall energy Example patterns: Vowel: Wide base + moderate right Fricative: Tall + narrow base Silence: Very small polygon

Layer 6: Pulses

⏱️ Glottal Pulse Timing

Visualization: Small circles at pulse locations

Color: Red

Analysis: PointProcess from cross-correlation pitch detection

Normalization: Fixed vertical position

Best for: Voice timing, rhythm, periodicity, voice quality

Pulse Marker Rendering

Pulse drawing as circles: numPulses = Get number of points FOR each pulse p from 1 to numPulses: t = Get time from index: p y = pulseY # Fixed vertical position radius = 0.003 × duration # Draw circle using 12 line segments FOR angleStep from 0 to 11: angle1 = angleStep × 30 degrees angle2 = (angleStep + 1) × 30 degrees x1 = t + radius × cos(angle1) y1 = y + radius × sin(angle1) x2 = t + radius × cos(angle2) y2 = y + radius × sin(angle2) Draw line: x1, y1, x2, y2 Interpretation: Regular spacing: Stable voicing Irregular spacing: Jitter, unstable voice Dense pulses: High pitch Sparse pulses: Low pitch Missing pulses: Breathy voice, unvoiced

Analysis Methods

Intensity Analysis

📈 Amplitude Measurement

Method: Praat Intensity object with 75 Hz floor

Purpose: Measure sound pressure level variations

Parameters: Excludes very low frequencies

Output: dB values relative to auditory perception

Intensity Analysis Details

Intensity object creation: intensityID = To Intensity: 75, 0, "yes" Parameters: - 75 Hz: Minimum pitch (excludes sub-harmonics) - 0: Time step (auto-determined) - "yes": Subtract mean pressure first Intensity calculation: Intensity ≈ 10 × log₁₀(pressure² / reference²) Where reference is typically 2×10⁻⁵ Pa Practical ranges: Quiet speech: 40-50 dB Normal speech: 50-70 dB Loud speech: 70-80 dB Shouting: 80-90+ dB Adjust intensityMinDb/intensityMaxDb to match your recording

Formant Analysis

🎤 Vocal Tract Resonance Tracking

Method: Burg (LPC) formant analysis

Purpose: Track vocal tract resonances

Parameters: Optimized for speech frequencies

Output: F1, F2, F3 frequencies over time

Formant Analysis Parameters

Formant object creation: formantID = To Formant (burg): timeStep, 5, 5500, 0.025, 50 Parameters: - timeStep: Analysis time step (e.g., 0.01 s) - 5: Maximum number of formants - 5500: Maximum formant frequency (Hz) - 0.025: Window length (seconds) - 50: Pre-emphasis from (Hz) Burg method advantages: - Good frequency resolution - Stable formant tracks - Works well with typical speech signals - Standard in speech analysis Formant tracking challenges: - May miss formants in noisy signals - Can create spurious formants - Manual correction sometimes needed - Works best on clean vowel sounds

Pitch Analysis

🎵 Fundamental Frequency Estimation

Method: Cross-correlation pitch tracking

Purpose: Estimate fundamental frequency

Parameters: User-defined pitch range

Output: F0 contour with voicing detection

Pitch Analysis Parameters

Pitch object creation: pitchID = To Pitch: timeStep, pitchFloor, pitchCeiling Parameters: - timeStep: Analysis time step (e.g., 0.01 s) - pitchFloor: Minimum expected pitch (Hz) - pitchCeiling: Maximum expected pitch (Hz) Typical pitch ranges: Adult male speech: 75-300 Hz Adult female speech: 150-400 Hz Child speech: 200-600 Hz Singing: 50-1000+ Hz Music instruments: 27-4000+ Hz Cross-correlation method: - Finds periodicity in signal - Robust to noise - Provides voicing detection - Standard in speech analysis Adjust pitch range to match your audio for best results

Spectral Analysis

📊 Short-Time Fourier Analysis

Method: Gaussian-windowed spectrogram

Purpose: Time-frequency analysis

Parameters: High time-frequency resolution

Output: Spectral power distribution

Spectrogram Parameters

Spectrogram object creation: spectrogramID = To Spectrogram: 0.005, 5000, 0.002, 20, "Gaussian" Parameters: - 0.005: Window length (seconds) - determines frequency resolution - 5000: Maximum frequency (Hz) - 0.002: Time step (seconds) - determines time resolution - 20: Dynamic range (dB) - "Gaussian": Window shape Time-frequency trade-off: Longer window: Better frequency resolution, worse time resolution Shorter window: Better time resolution, worse frequency resolution Gaussian window advantages: - Good frequency localization - Minimal spectral leakage - Smooth spectral estimates Used for: - Spectral centroid calculation - Spectral polygon generation - General spectral analysis

Parameters & Settings

Layer Selection Parameters

ParameterTypeDefaultDescription
drawIntensityboolean1Display intensity layer
drawFormantsboolean1Display formant layers
drawPitchboolean1Display pitch layer
drawSpectralCentroidboolean1Display spectral centroid
drawSpectralPolygonsboolean1Display spectral polygons
drawPulsesboolean1Display pulse markers
drawF1boolean1Display first formant (F1)
drawF2boolean1Display second formant (F2)
drawF3boolean1Display third formant (F3)

Analysis Parameters

ParameterTypeDefaultDescription
timeSteppositive0.01Analysis time step (seconds)
pitchFloorpositive75Minimum expected pitch (Hz)
pitchCeilingpositive600Maximum expected pitch (Hz)

Visual Parameters

ParameterTypeDefaultDescription
intensityMinDbpositive40Minimum intensity for display (dB)
intensityMaxDbpositive80Maximum intensity for display (dB)

Parameter Guidelines

Time step (0.005-0.05 seconds): 0.005: Very high resolution (200 fps) - slow 0.01: High resolution (100 fps) - balanced 0.02: Medium resolution (50 fps) - faster 0.05: Low resolution (20 fps) - very fast Pitch range (speech applications): Male speech: 75-300 Hz Female speech: 150-400 Hz Child speech: 200-600 Hz Mixed/general: 75-600 Hz Intensity range (typical speech): Quiet recording: 30-70 dB Normal recording: 40-80 dB Loud recording: 50-90 dB Adjust to match your recording levels Layer selection strategies: Speech analysis: Intensity + Formants + Pitch Music analysis: Pitch + Spectral features Voice quality: Pitch + Pulses + Formants Full analysis: All layers enabled Quick overview: Intensity + Pitch only

Applications

Speech Analysis and Phonetics

Use case: Analyzing vowel formants and intonation patterns

Recommended layers: Formants (F1, F2, F3) + Pitch + Intensity

Example: Visualizing vowel space and pitch contours in sentences

Music Analysis

Use case: Studying melodic contours and timbral evolution

Recommended layers: Pitch + Spectral Centroid + Spectral Polygons

Example: Analyzing vibrato and spectral changes in singing

Voice Quality Assessment

Use case: Evaluating vocal fold function and voice disorders

Recommended layers: Pitch + Pulses + Formants + Intensity

Example: Assessing jitter, shimmer, and formant stability

Language Teaching and Learning

Use case: Visual feedback for pronunciation training

Recommended layers: Formants + Pitch (for intonation)

Example: Comparing student pronunciation to native speaker models

Practical Workflow Examples

🗣️ Vowel Formant Analysis

Goal: Analyze vowel formant patterns in speech

Settings:

  • Layers: Formants (F1, F2, F3) + Intensity
  • Time step: 0.01 seconds
  • Pitch range: 75-400 Hz
  • Intensity range: 45-75 dB

Analysis: Identify vowel regions by stable formant patterns

🎵 Singing Voice Analysis

Goal: Analyze pitch accuracy and vibrato in singing

Settings:

  • Layers: Pitch + Spectral Centroid + Pulses
  • Time step: 0.005 seconds (high resolution)
  • Pitch range: 100-1000 Hz
  • Intensity range: 50-85 dB

Analysis: Examine pitch contours and spectral changes

🔬 Voice Disorder Assessment

Goal: Assess vocal fold function and stability

Settings:

  • Layers: Pitch + Pulses + Formants + Intensity
  • Time step: 0.01 seconds
  • Pitch range: 75-300 Hz
  • Intensity range: 40-70 dB

Analysis: Look for irregular pulse spacing and formant instability

Advanced Techniques

Layer combination strategies:
  • Formant-Pitch correlation: Observe how formants change with pitch
  • Intensity-Spectral relationships: See how spectrum changes with loudness
  • Pulse-Formant timing: Examine formant changes within glottal cycles
  • Spectral evolution: Track how centroid and polygons change over time
  • Multi-speaker comparison: Use same settings to compare different speakers
Parameter optimization tips:
  • For fast processing: Use larger time steps, disable unneeded layers
  • For detailed analysis: Use small time steps, enable all relevant layers
  • For specific frequencies: Adjust pitch range to focus on region of interest
  • For quiet recordings: Lower intensity minimum to see more detail
  • For noisy signals: Focus on robust features (intensity, broad spectral trends)

Troubleshooting Common Issues

Problem: Processing very slow
Cause: Small time step with many layers on long audio
Solution: Increase time step, disable unneeded layers, process shorter segments
Problem: Formant tracks look noisy or jumpy
Cause: Noisy signal or incorrect formant settings
Solution: Use cleaner recording, adjust formant maximum frequency
Problem: Pitch track has gaps or errors
Cause: Incorrect pitch range or noisy signal
Solution: Adjust pitch floor/ceiling, use cleaner audio
Problem: Intensity shows mostly flat line
Cause: Intensity range doesn't match recording levels
Solution: Adjust intensityMinDb/intensityMaxDb to match your audio
Problem: Visualization too crowded
Cause: Too many layers enabled for display size
Solution: Disable less important layers, focus on key features