Feedback-Aware Convolution — User Guide

Dynamic convolution processing: generates impulse responses based on acoustic features (intensity/pitch) and convolves them with the original sound for self-modulating effects.

Author: Based on Praat AudioTools by Shai Cohen Version: 2025 Process: Feature detection → Impulse generation → Convolution
Contents:

What this does

This script implements feedback-aware convolution — a dynamic audio processing technique that generates impulse responses based on the acoustic characteristics of the input sound itself. The process: (1) Feature extraction: Analyze the sound for intensity or pitch content, (2) Threshold detection: Identify moments where features exceed user-defined thresholds, (3) Impulse generation: Create an impulse train where each impulse corresponds to a detected event, (4) Amplitude mapping: Scale impulse amplitudes based on feature values, (5) Convolution: Convolve the original sound with the generated impulse train. Result: self-modulating effects where the processing is dynamically controlled by the audio's own characteristics.

Key Features:

What is feedback-aware convolution? Traditional convolution: fixed impulse response applied to entire signal. Feedback-aware convolution: impulse response dynamically generated from the signal's own features. Advantages: (1) Adaptive processing: Effect intensity varies with input characteristics, (2) Musical response: Processing follows musical events, (3) Creative possibilities: Self-modulating, evolving effects, (4) Natural dynamics: Preserves and enhances original performance nuances, (5) Novel textures: Creates complex, feedback-like behaviors. Use cases: Music production (dynamic effects), sound design (evolving textures), experimental music (self-modulating systems), audio restoration (feature-aware processing), interactive systems (responsive audio effects).

Technical Implementation: (1) Parameter extraction: Create Intensity or Pitch objects from input sound. (2) Event detection: Sample parameter values and detect threshold crossings. (3) Impulse generation: Create Gaussian-windowed impulses at event times. (4) Amplitude mapping: Scale impulse amplitudes based on parameter values. (5) Convolution: Apply standard convolution with generated impulse train. (6) Cleanup: Remove intermediate objects. Key insight: Audio features → event detection → dynamic impulse response → convolution = self-modulating processing.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…feedback_aware_convolution.praat.
  3. Choose parameter type: Intensity (energy-based) or Pitch (melody-based).
  4. Set detection threshold appropriate for your audio and mode.
  5. Adjust minimum impulse spacing to control density (0.05s typical).
  6. Click OK — processes audio, creates "originalname_feedback_conv" output.
Quick tip: Start with Intensity mode + threshold 65 dB for general audio. Use Pitch mode + threshold 200 Hz for melodic material. Set minimum spacing 0.05-0.1s for musical results. Check Info window for detection statistics and adjust threshold accordingly. For sparse effects, use higher thresholds and longer minimum spacing. For dense textures, use lower thresholds and shorter minimum spacing.
Important: THRESHOLD SEMANTICS DIFFER BY MODE — intensity threshold in dB, pitch threshold in Hz. No impulses detected usually means threshold is too high. Very dense impulse trains can create overwhelming results. Pitch mode requires sounds with clear pitch content. Check Info window for actual parameter ranges in your sound. Intermediate objects are automatically cleaned up. Processing time depends on audio length and detection precision.

Feedback Convolution Theory

Traditional vs Feedback-Aware Convolution

Standard Convolution

Mathematical foundation:

Standard convolution: y(t) = ∫ x(τ) · h(t - τ) dτ Where: x(t) = input signal h(t) = impulse response (fixed) y(t) = output signal Characteristics: - Linear, time-invariant system - Impulse response h(t) is constant - Same processing applied to entire signal - Examples: reverb, filtering, echo Limitation: - No adaptation to input signal content - Static processing regardless of musical events

Feedback-Aware Convolution

Dynamic impulse response generation:

Feedback-aware convolution: y(t) = ∫ x(τ) · h(t, τ) dτ Where h(t, τ) is now time-dependent and generated from x(t): h(t, τ) = generate_impulses_from_features(x(t)) Process: 1. Extract features f(t) from x(t) (intensity/pitch) 2. Detect events: times tᵢ where f(tᵢ) > threshold 3. Generate impulses at tᵢ with amplitudes ∝ f(tᵢ) 4. Convolve x(t) with generated impulse train Result: Adaptive processing that responds to input characteristics

Event Detection and Impulse Generation

Threshold Crossing Detection

Parameter sampling and event identification:

Detection process: FOR each sample time t at rate parameter_sample_rate: value = get_parameter_value(t) IF value > detection_threshold AND (t - last_impulse_time) ≥ min_impulse_spacing: ADD impulse at time t SET impulse_amplitude ∝ (value - threshold) UPDATE last_impulse_time = t Key concepts: - parameter_sample_rate: Temporal precision of detection - detection_threshold: Sensitivity control - min_impulse_spacing: Density control (refractory period) - Amplitude mapping: Strength reflects parameter value Visual example (Intensity mode): Sound: ▁▂▃▄▅▆▇█▇▆▅▄▃▂▁ Threshold: ──────────────── Detected: ↑ ↑ ↑ Impulses: • • • Amplitudes: ▴ ▴ ▴

Gaussian Impulse Generation

Temporal impulse characteristics:

Gaussian impulse formula: impulse(t) = amplitude × exp(-((t - t₀) / (duration/6))²) Where: t₀ = impulse center time duration = impulse_duration parameter amplitude = mapped from parameter value Properties: - Smooth onset and offset - No sharp discontinuities - Controlled temporal width - Natural-sounding impulses Amplitude mapping: IF parameter_type$ = "intensity": normalized = (value - 40) / 40 # 40-80 dB range ELSE: # pitch mode normalized = (value - threshold) / threshold amplitude = max(0, min(1, normalized)) × amplitude_mapping_strength

Complete Processing Pipeline

INPUT: Sound object STEP 1: PARAMETER EXTRACTION IF parameter_type$ = "intensity": Create Intensity object (75 Hz floor, 1ms resolution) Convert to IntensityTier for sampling ELSE: # pitch mode Create Pitch object with user pitch_floor/pitch_ceiling STEP 2: THRESHOLD DETECTION Initialize: impulse_count = 0, last_impulse_time = -1 IF intensity mode: FOR each point in IntensityTier: IF value > threshold AND spacing_ok: Store impulse time and value impulse_count += 1 ELSE: # pitch mode FOR time from 0 to duration in 1/parameter_sample_rate steps: value = Get pitch at time (if defined) IF value > threshold AND spacing_ok: Store impulse time and value impulse_count += 1 STEP 3: IMPULSE TRAIN GENERATION Create silent sound of same duration as input FOR each detected impulse i: time = impulse_time_i value = impulse_value_i # Calculate amplitude from parameter value amplitude = map_parameter_to_amplitude(value, threshold) # Add Gaussian impulse at time Formula (part): time ± duration/2, "self + amplitude × exp(-((x-time)/(duration/6))²)" STEP 4: CONVOLUTION Convolve original sound with impulse train Method: "integral", "zero" padding Normalize output to prevent clipping STEP 5: CLEANUP AND OUTPUT Remove intermediate objects Rename and select result Play output OUTPUT: Sound with feedback-aware convolution applied

Parameter Detection Modes

Mode 1: Intensity-Based Detection

📊 Energy-Driven Processing

Principle: Detect loudness peaks and generate impulses

Analysis: Praat Intensity object with 75 Hz floor

Threshold Range: 50-80 dB typical for speech/music

Character: Rhythmically follows amplitude envelopes

Best for: Percussive sounds, speech, general audio

Intensity Detection Details

Intensity extraction: intensityID = To Intensity: 75, 0.001, "yes" Parameters: - 75 Hz: Minimum pitch (excludes very low frequencies) - 0.001 s: High time resolution (1 ms) - "yes": Subtract mean pressure Intensity to IntensityTier conversion: Down to IntensityTier for point-based sampling Typical intensity ranges: Quiet speech: 50-60 dB Normal speech: 60-70 dB Loud speech: 70-80 dB Music: highly variable (40-90+ dB) Threshold guidelines: 50-55 dB: Very sensitive (many impulses) 60-65 dB: Moderate sensitivity 70-75 dB: Selective (only loud events) 80+ dB: Very selective (few impulses)

Mode 2: Pitch-Based Detection

🎵 Melody-Driven Processing

Principle: Detect high-pitch events and generate impulses

Analysis: Praat Pitch object with user-defined range

Threshold Range: 150-300 Hz typical for melodic events

Character: Follows melodic contours and high notes

Best for: Melodic instruments, singing, harmonic content

Pitch Detection Details

Pitch extraction: pitchID = To Pitch: 0.001, pitch_floor, pitch_ceiling Parameters: - 0.001 s: High time resolution - pitch_floor: Minimum analysis frequency (Hz) - pitch_ceiling: Maximum analysis frequency (Hz) Pitch sampling: Sample at parameter_sample_rate (default 1000 Hz) Only consider defined pitch values (voiced regions) Typical pitch ranges: Male speech: 80-180 Hz Female speech: 160-300 Hz Child speech: 200-400 Hz Singing: 80-1000+ Hz Threshold operation: Pitch analysis range: pitch_floor to pitch_ceiling Detection threshold: filters WITHIN analysis range Example: floor=80, ceiling=600, threshold=200 → Analyzes 80-600 Hz, impulses only for pitches >200 Hz

Mode Comparison and Selection

AspectIntensity ModePitch Mode
Detection BasisSound energy/loudnessFundamental frequency
Threshold UnitsdB SPLHertz (Hz)
Typical Range50-80 dB150-300 Hz
Works Best WithPercussive sounds, speechMelodic instruments, singing
CharacterRhythmic, amplitude-followingMelodic, pitch-following
Additional ParamsNonePitch floor/ceiling
Processing SpeedFasterSlower (higher complexity)
When to choose each mode:
  • Choose Intensity mode if: Your audio has clear amplitude variations, rhythmic content, or you want energy-driven effects
  • Choose Pitch mode if: Your audio has clear pitch content, melodic lines, or you want melody-driven effects
  • Try both modes: Some sounds work well with both approaches but produce different results
  • Check Info window: Both modes report detection statistics to help tune thresholds

Processing Pipeline

Step 1: Parameter Extraction

🔍 Feature Analysis

Purpose: Convert audio to analyzable parameter representation

Methods: Praat's built-in Intensity and Pitch objects

Output: Time-value pairs for threshold detection

Precision: High temporal resolution (1ms default)

Extraction Methods

Intensity extraction pipeline: Sound → Intensity (75Hz, 1ms) → IntensityTier → Point sampling Pitch extraction pipeline: Sound → Pitch (user range, 1ms) → Direct time sampling Key parameters: - Time resolution: 0.001 seconds (1 ms) - Intensity: 75 Hz minimum pitch (excludes rumble) - Pitch: User-defined floor/ceiling for analysis range - Both: High precision for accurate event detection Quality indicators (Info window): Intensity mode: Reports impulse count directly Pitch mode: Reports defined/total samples and pitch range Use these statistics to adjust thresholds

Step 2: Threshold Detection

🎯 Event Identification

Purpose: Find moments where parameter exceeds threshold

Constraints: Minimum spacing prevents overcrowding

Output: List of impulse times and parameter values

Statistics: Impulse count reported for tuning

Detection Algorithm

Detection pseudocode: impulse_count = 0 last_impulse_time = -min_impulse_spacing # Allow first impulse at t=0 FOR each sampling time t: value = get_parameter_value(t) IF value ≠ undefined AND value > detection_threshold: time_since_last = t - last_impulse_time IF time_since_last ≥ min_impulse_spacing: impulse_count += 1 impulse_time[impulse_count] = t impulse_value[impulse_count] = value last_impulse_time = t IF impulse_count ≥ max_impulses (safety limit): BREAK with warning Key features: - Respects minimum spacing (refractory period) - Handles undefined values (pitch mode) - Safety limit prevents memory issues - Stores both time and value for amplitude mapping

Step 3: Impulse Train Generation

⚡ Dynamic Impulse Response

Purpose: Create convolution kernel from detected events

Method: Gaussian-windowed impulses at event times

Amplitude: Mapped from parameter values

Character: Smooth, natural-sounding impulses

Impulse Generation Details

Amplitude mapping: IF intensity mode: # Map from typical 40-80 dB range to 0-1 normalized = (value - 40) / 40 IF pitch mode: # Map relative to threshold normalized = (value - threshold) / threshold # Apply clamping and strength normalized = max(0, min(1, normalized)) amplitude = normalized × amplitude_mapping_strength Gaussian impulse formula: impulse(t) = amplitude × exp(-((t - t₀) / σ)²) WHERE σ = impulse_duration / 6 Rationale for σ = duration/6: Gaussian drops to ~0.0001 at ±3σ from center So 6σ ≈ impulse_duration covers most energy Creates smooth, well-localized impulses

Step 4: Convolution and Output

🎚️ Final Processing

Method: Standard convolution with generated impulse train

Parameters: "integral" method with "zero" padding

Normalization: Automatic peak scaling to prevent clipping

Cleanup: Intermediate objects removed automatically

Convolution Implementation

Convolution command: select original_sound plus impulse_train Convolve: "integral", "zero" Parameters: "integral": Suitable for impulse response convolution "zero": Zero-padding at boundaries Normalization: peak = Get maximum absolute amplitude IF peak > 0.99: Formula: "self × 0.99 / peak" Cleanup sequence: Remove: impulse_train Remove: parameter_object (IntensityTier or Pitch) Select: convolved_result Rename: originalname_feedback_conv Play result Final output: Clean object list with only original and result Automatic playback for immediate evaluation

Parameters & Settings

Core Detection Parameters

ParameterTypeDefaultDescription
Parameter_typeoptionmenuIntensityFeature used for detection (Intensity/Pitch)
Detection_thresholdpositive75Threshold for impulse generation
Pitch_floor_(Hz)positive80Minimum pitch for analysis (pitch mode)
Pitch_ceiling_(Hz)positive600Maximum pitch for analysis (pitch mode)

Temporal Control Parameters

ParameterTypeDefaultDescription
Minimum_impulse_spacing_(seconds)positive0.05Refractory period between impulses
Impulse_duration_(seconds)positive0.0003Temporal width of each impulse
Parameter_sample_rate_(Hz)positive1000Temporal resolution for detection

Amplitude Control Parameters

ParameterTypeDefaultDescription
Amplitude_mapping_strengthpositive1.0How strongly values affect impulse amplitude

Parameter Guidelines and Ranges

Detection_threshold (mode-dependent): Intensity mode (dB): 50-55: Very sensitive (many impulses) 60-65: Moderate sensitivity 70-75: Selective detection 80+: Very selective (few impulses) Pitch mode (Hz): 150-200: Sensitive to mid/high pitches 200-250: Moderate sensitivity 250-300: Selective for high pitches 300+: Very selective (very high pitches) Minimum_impulse_spacing (seconds): 0.02: Very dense (50 impulses/second max) 0.05: Moderate density (20 impulses/second) 0.10: Sparse (10 impulses/second) 0.20: Very sparse (5 impulses/second) Impulse_duration (seconds): 0.0001: Very narrow impulses 0.0003: Typical (0.3 ms) 0.0010: Wide impulses 0.0030: Very wide impulses Amplitude_mapping_strength: 0.5: Subtle amplitude variation 1.0: Normal variation 2.0: Strong variation 3.0: Extreme variation Parameter_sample_rate (Hz): 500: Lower precision, faster 1000: Good balance (default) 2000: High precision, slower 5000: Very high precision, much slower

Applications

Music Production

Use case: Creating dynamic, self-modulating effects

Technique: Use intensity mode for rhythmic elements, pitch mode for melodic content

Example: Drum loops with intensity-driven convolution for rhythmic complexity

Sound Design

Use case: Generating evolving textures from simple sounds

Technique: Extreme settings with high amplitude mapping

Example: Turning simple tones into complex, self-modulating pads

Voice Processing

Use case: Creative vocal effects and transformations

Technique: Pitch mode for singing, intensity mode for speech

Example: Vocal tracks with pitch-following convolution effects

Experimental Music

Use case: Creating feedback-like systems and complex behaviors

Technique: Serial processing with different parameter sets

Example: Multi-stage feedback convolution for chaotic textures

Practical Workflow Examples

🥁 Rhythmic Intensity Processing

Goal: Add dynamic convolution to drum loops

Settings:

  • Parameter type: Intensity
  • Detection threshold: 65 dB
  • Minimum spacing: 0.03 s
  • Impulse duration: 0.0002 s
  • Amplitude strength: 1.2

Result: Rhythmically synchronized convolution effects

🎹 Melodic Pitch Processing

Goal: Create melody-following effects for piano

Settings:

  • Parameter type: Pitch
  • Pitch range: 80-1200 Hz
  • Detection threshold: 250 Hz
  • Minimum spacing: 0.08 s
  • Amplitude strength: 0.8

Result: Convolution that emphasizes high melodic notes

🎤 Vocal Texture Creation

Goal: Transform spoken voice into textured soundscape

Settings:

  • Parameter type: Intensity
  • Detection threshold: 55 dB
  • Minimum spacing: 0.15 s
  • Impulse duration: 0.001 s
  • Amplitude strength: 1.5

Result: Sparse, amplitude-modulated convolution texture

Advanced Techniques

Creative parameter combinations:
  • Extreme density: Low threshold + short spacing for dense textures
  • Sparse events: High threshold + long spacing for occasional effects
  • Strong modulation: High amplitude strength for dramatic variations
  • Frequency targeting: Pitch mode with narrow floor/ceiling ranges
  • Serial processing: Apply multiple passes with different settings
Troubleshooting and optimization:
  • No impulses detected: Lower threshold, check parameter ranges in Info window
  • Too many impulses: Increase threshold, increase minimum spacing
  • Overwhelming results: Reduce amplitude strength, increase impulse spacing
  • Slow processing: Increase time step, use lower sample rate
  • Pitch mode not working: Check if sound has clear pitch, adjust floor/ceiling

Troubleshooting Common Issues

Problem: No impulses detected
Cause: Threshold too high or parameter out of range
Solution: Lower threshold, check Info window for actual parameter range
Problem: Too dense/overwhelming result
Cause: Threshold too low or spacing too short
Solution: Increase threshold, increase minimum spacing
Problem: Pitch mode detects nothing
Cause: Sound has no clear pitch or range incorrect
Solution: Use intensity mode, or adjust pitch floor/ceiling
Problem: Processing very slow
Cause: High sample rate on long audio
Solution: Reduce parameter_sample_rate, use larger time steps
Problem: Output too quiet or too loud
Cause: Amplitude mapping extreme or impulse density issues
Solution: Adjust amplitude_mapping_strength, normalize after processing