Adaptive Transient Decomposition — User Guide
Atomic transient separation: uses LPC residual analysis and sigmoid gating to intelligently separate transient events from sustained content with mathematical precision.
What this does
This script implements adaptive transient decomposition — a sophisticated signal processing technique that separates audio into two distinct components: transients (sharp, impulsive events like drum hits, consonants, attacks) and residual (sustained, tonal content like vowels, pads, reverberation). The method uses Linear Predictive Coding (LPC) to model the predictable components of the signal, then applies mathematical sigmoid gating to precisely isolate transient events based on their energy characteristics.
Key Features:
- LPC Residual Analysis — Mathematical separation of predictable vs. unpredictable content
- Sigmoid Soft Gating — Smooth, artifact-free transient detection
- Adaptive Thresholding — Automatic level adjustment to signal content
- Temporal Padding — Preserves complete transient envelopes
- Stereo Processing — Independent channel processing with phase coherence
- Vectorized Processing — Efficient mathematical operations without loops
Technical Implementation: (1) LPC analysis: Use Burg method to model predictable signal components. (2) Residual extraction: Inverse filter to obtain unpredictable content. (3) Envelope detection: Compute energy envelope of residual. (4) Noise floor estimation: Calculate background activity level. (5) Sigmoid gating: Apply mathematical soft thresholding. (6) Temporal dilation: Pad transients to preserve complete attacks. (7) Component separation: Multiply gate with residual for transients, subtract from original for residual. The system uses pure mathematical operations (no conditionals) for stability and efficiency, with careful handling of stereo signals and edge conditions.
Quick start
- In Praat, select exactly one Sound object (mono or stereo).
- Run script… →
Adaptive_Transient_Decomposition.praat. - Set lpcOrder_ms (1.0-2.0ms for most material).
- Adjust integration_ms (3.0-10.0ms for envelope smoothness).
- Set threshold_ratio (1.5-3.0 for detection sensitivity).
- Choose burstPadding_ms (0.0-5.0ms for transient preservation).
- Click OK — processing runs with progress updates.
- Output: two new sounds — "originalname_transients" and "originalname_residual".
Transient Decomposition Theory
Linear Predictive Coding Fundamentals
LPC Mathematical Basis
Predictive modeling principle:
Why LPC for Transient Detection?
Advantages over envelope-based methods:
- Content-aware: Adapts to signal statistics
- Frequency-agnostic: Works across entire spectrum
- Phase-preserving: Maintains timing accuracy
- Mathematically rigorous: Based on signal theory
- Robust: Less sensitive to level variations
Sigmoid Soft Gating System
Mathematical Smooth Thresholding
Sigmoid function properties:
Why Sigmoid Instead of If/Then?
Artifact prevention:
- No discontinuities: Smooth transitions prevent clicks
- Mathematical stability: Well-behaved function
- Computational efficiency: Single formula evaluation
- Parameter continuity: Small parameter changes → small output changes
🎛️ Sigmoid Gating Intuition
Soft threshold behavior:
Instead of: if envelope > threshold then 1 else 0
We use: smooth transition around threshold
Result: Natural-sounding gates without artifacts
Steepness control:
k=10: Very gradual transition (musical)
k=50: Sharp but smooth transition (default)
k=100: Nearly hard threshold (precise)
Adaptive Noise Floor System
Dynamic Threshold Calculation
Background level estimation:
Why Dynamic Thresholding?
Robustness benefits:
- Automatic gain compensation: Works on quiet and loud signals
- Noise adaptation: Adjusts to recording noise floor
- Material independence: Similar settings work across content
- Consistent results: Predictable behavior across program material
Temporal Padding System
Complete Transient Preservation
Burst padding rationale:
Why Temporal Padding?
Perceptual importance:
- Complete attacks: Preserves perceptual impact
- Natural decay: Maintains temporal envelope
- Reduced artifacts: Avoids choppy-sounding transients
- Better resynthesis: Components sum more naturally
Processing Pipeline
🔧 Ten-Stage Atomic Processing
Complete signal path from input to separated components:
Stage 1: Signal Preparation & Padding
| Step | Operation | Purpose |
|---|---|---|
| 1.1 | Add 0.5s silence at start/end | Prevent edge artifacts |
| 1.2 | Concatenate padded signal | Safe processing boundaries |
Stage 2: LPC Analysis & Residual Extraction
| Step | Operation | Purpose |
|---|---|---|
| 2.1 | Compute LPC coefficients (Burg) | Model predictable content |
| 2.2 | Apply inverse filter | Extract prediction error |
| 2.3 | Obtain residual signal | Contains transients + noise |
Stage 3: Envelope Detection
| Step | Operation | Purpose |
|---|---|---|
| 3.1 | Square residual samples | Compute instantaneous power |
| 3.2 | Heavy lowpass filtering | Extract energy envelope |
| 3.3 | Square root | Convert back to amplitude |
Stage 4: Noise Floor Estimation
| Step | Operation | Purpose |
|---|---|---|
| 4.1 | Very heavy lowpass of envelope | Estimate background level |
| 4.2 | Obtain noise floor signal | Adaptive threshold reference |
Stage 5: Sigmoid Soft Gating
| Step | Operation | Purpose |
|---|---|---|
| 5.1 | Compute envelope - threshold | Detection difference signal |
| 5.2 | Apply sigmoid function | Smooth binary decision |
| 5.3 | Obtain soft gate signal | Transient probability map |
Stage 6: Temporal Dilation & Padding
| Step | Operation | Purpose |
|---|---|---|
| 6.1 | Lowpass gate signal | Temporal smoothing |
| 6.2 | Re-sharpen with sigmoid | Preserve gate character |
| 6.3 | Obtain final gate | Padded transient detection |
Stage 7: Component Separation
| Step | Operation | Purpose |
|---|---|---|
| 7.1 | Multiply residual × gate | Extract transient component |
| 7.2 | Obtain padded transients | Complete transient events |
Stage 8: Boundary Correction
| Step | Operation | Purpose |
|---|---|---|
| 8.1 | Crop back to original duration | Remove padding silence |
| 8.2 | Obtain final transients | Correct-length component |
Stage 9: Residual Calculation
| Step | Operation | Purpose |
|---|---|---|
| 9.1 | Subtract transients from original | Compute sustained component |
| 9.2 | Obtain final residual | Tonal/sustained content |
Stage 10: Stereo Handling & Output
| Step | Operation | Purpose |
|---|---|---|
| 10.1 | Process channels independently | Maintain stereo image |
| 10.2 | Recombine to stereo | Final output preparation |
| 10.3 | Cleanup intermediate objects | Memory management |
Complete Signal Flow
Parameters Guide
⚙️ Complete Parameter Reference
Detailed explanation of all user-controllable parameters:
Analysis Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| lpcOrder_ms | 1.6 | 1.0-3.0 | LPC analysis order in milliseconds |
| integration_ms | 5.0 | 2.0-20.0 | Envelope detection window |
Detection Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| threshold_ratio | 2.0 | 1.2-5.0 | Noise floor multiplier for detection |
| burstPadding_ms | 2.0 | 0.0-10.0 | Temporal padding around transients |
Parameter Interactions
- lpcOrder_ms vs frequency resolution: Higher = better tonal modeling
- integration_ms vs temporal precision: Smaller = sharper detection
- threshold_ratio vs sensitivity: Lower = more aggressive extraction
- burstPadding_ms vs completeness: Higher = more complete transients
Parameters work together to control separation character
Recommended Settings
🥁 Drum Extraction
Goal: Clean separation of drum hits from music
Settings:
- lpcOrder_ms: 1.8
- integration_ms: 3.0
- threshold_ratio: 1.8
- burstPadding_ms: 3.0
🎤 Speech Consonants
Goal: Precise extraction of speech transients
Settings:
- lpcOrder_ms: 1.2
- integration_ms: 2.5
- threshold_ratio: 2.2
- burstPadding_ms: 1.5
🎹 Subtle Attacks
Goal: Gentle extraction for delicate material
Settings:
- lpcOrder_ms: 1.4
- integration_ms: 8.0
- threshold_ratio: 2.5
- burstPadding_ms: 4.0
Applications
Rhythmic Analysis
Use case: Study timing and rhythm patterns
Technique: Analyze transient component for onset detection
Example: Extract drum patterns from music for tempo analysis
Sound Design
Use case: Create new sounds by recombining components
Technique: Process transients and residual independently
Example: Apply different effects to attacks vs. sustains
Audio Restoration
Use case: Clean up recordings by processing components separately
Technique: Denoise residual while preserving transients
Example: Remove background noise without affecting drum attacks
Music Production
Use case: Enhance mixes with component-based processing
Technique: Independent control of transients and sustains
Example: Add punch to drums without affecting tonal balance
💡 Creative Applications
Advanced techniques:
- Transient shaping: Modify attack characteristics independently
- Hybrid synthesis: Combine transients from one sound with sustains from another
- Rhythmic gating: Use transient component to trigger other processes
- Multiband separation: Apply to frequency bands for finer control
Troubleshooting Common Issues
Cause: Threshold too high, LPC order too large
Solution: Lower threshold_ratio, reduce lpcOrder_ms
Cause: LPC order too small, threshold too low
Solution: Increase lpcOrder_ms, raise threshold_ratio
Cause: Insufficient padding, too sharp gating
Solution: Increase burstPadding_ms, use gentler settings
Cause: Extreme parameter differences between channels
Solution: Use moderate settings, check mono compatibility