Frequency-Dependent Phase Manipulation — User Guide
Spectral phase processing: applies frequency-dependent phase shifts to create stereo width, texture, and spectral effects through phase manipulation in the frequency domain.
What this does
This script implements frequency-dependent phase manipulation — a spectral processing technique that applies different phase shift functions to left and right channels to create stereo width and spectral effects. Process converts sound to frequency domain, manipulates phase component while preserving magnitude, then converts back to time domain with modified phase relationships. Four phase manipulation modes available: (1) Comb filter: Periodic notches via sinusoidal phase modulation. (2) Chaotic texture: Multiple periodic functions for complex phase relationships. (3) Spectral blur: Randomized phase modulation for smearing effects. (4) Formant-like resonances: Gaussian-shaped phase shifts at specific frequency regions.
Key Features:
- Four Phase Modes — Different mathematical functions for phase manipulation
- Stereo Width Control — Independent phase processing for L/R channels
- Frequency-Dependent — Phase shifts vary across frequency spectrum
- Magnitude Preservation — Spectral magnitude unchanged, only phase altered
- Real-time Preview — Hear results immediately after processing
- Non-Destructive — Original sound preserved, new stereo output created
Technical Implementation: (1) Input preparation: Convert to mono if stereo input, ensure single-channel processing foundation. (2) Frequency domain conversion: Convert sound to spectrum (complex FFT representation with real/imaginary components). (3) Matrix representation: Convert spectrum to matrix for mathematical manipulation. (4) Phase manipulation: Apply frequency-dependent phase shift formulas to matrix data. Different formulas for different effects: Comb = periodic sine modulation, Chaos = multiple sine waves, Blur = randomized modulation, Formant = Gaussian peaks. (5) Stereo differentiation: Apply slightly different phase amounts to L/R channels. (6) Reconstruction: Convert modified matrices back to spectra, then to time-domain sounds. (7) Stereo combination: Merge L/R channels into final stereo output. Key insight: Phase = arctan(imaginary/real) in complex spectrum. Manipulating phase while preserving magnitude creates timbral/spatial changes without amplitude alteration.
Quick start
- In Praat, select exactly one Sound object (mono or stereo).
- Run script… →
frequency_dependent_phase_manipulation.praat. - Choose Phase_mode: Comb filter, Chaotic texture, Spectral blur, or Formant-like resonances.
- Adjust Phase_amount (default 50.0) — higher = more dramatic effect.
- Set Stereo_width (default 0.2) — difference between L/R phase processing.
- Click OK — phase manipulation applied, stereo result named "originalname_StereoPhase_mode_amount".
- Output automatically played for immediate evaluation.
Phase Manipulation Theory
Fourier Analysis Basics
Complex Spectrum Representation
Sound in frequency domain:
Why Manipulate Phase?
Phase perception effects:
- Timbre changes: Phase relationships affect waveform shape
- Stereo image: Phase differences between ears create spatial cues
- Transient response: Phase coherence preserves sharp attacks
- Comb filtering: Phase cancellations create spectral notches
- Resonances: Phase reinforcement emphasizes frequencies
Traditional vs phase processing:
- EQ: Manipulates M(f) - changes frequency balance
- Compression: Manipulates amplitude envelope - changes dynamics
- Phase processing: Manipulates φ(f) - changes timing relationships
Phase Shift Mathematics
Basic Phase Rotation
Applying phase shift:
Frequency-Dependent Phase
Making phase shift vary with frequency:
📐 Visual Intuition
Comb filter phase function:
θ(f) = A·sin(2πf/200)
Creates periodic phase shifts → periodic cancellations in spectrum
Notches occur where phase differences cause cancellation
Use: Classic phaser/flanger effects
Formant phase function:
θ(f) = A·[Gaussian(800Hz) + Gaussian(1500Hz) + Gaussian(2500Hz)]
Emphasizes specific frequency regions → vowel-like resonances
Peaks at formant frequencies create spectral emphasis
Use: Vocal-like spectral shaping
Stereo Phase Differences
Creating Stereo Width
Independent L/R phase processing:
Why This Creates Stereo
Psychoacoustic principles:
Natural stereo: Sounds arrive at slightly different times at each ear
→ Phase differences between ears
→ Brain interprets as spatial position
This script: Artificially creates phase differences
Left and right channels get different phase shifts
→ Brain interprets artificial IPD as stereo width
→ Even though source was mono
Result: Mono input → wide stereo output
Width controlled by Stereo_width parameter
Processing Pipeline
Complete Algorithm
Step-by-step processing:
Matrix Manipulation Details
Why use matrix representation?
Mathematical Foundation
Phase Manipulation Modes
Mode 1: Comb Filter
🔁 Periodic Notches
Formula: θ(f) = A · sin(2πf / 200)
Character: Classic phaser/flanger effect, periodic spectral notches
Best for: Adding motion, creating classic modulation effects
Technical details:
| Aspect | Description | Sonic Result |
|---|---|---|
| Periodicity | 200Hz period in frequency domain | Evenly spaced notches every 200Hz |
| Phase Cancellation | Where sin() ≈ 0, minimal effect | Preserved frequencies |
| Phase Rotation | Where |sin()| large, strong phase shift | Cancellation notches |
| Stereo Version | Different period scaling L/R | Moving, swirling notches |
Mode 2: Chaotic Texture
🌀 Multiple Periods
Formula: θ(f) = A · [sin(2πf/147) + 0.7·sin(2πf/283) + 0.4·sin(2πf/521)]
Character: Complex, evolving phase relationships, textured sound
Best for: Adding complexity, creating evolving textures
Technical details:
| Aspect | Description | Sonic Result |
|---|---|---|
| Multiple Frequencies | 147Hz, 283Hz, 521Hz periods | Rich, complex notch pattern |
| Amplitude Scaling | 1.0, 0.7, 0.4 coefficients | Layered intensity |
| Irrational Ratios | 147:283:521 ≈ 1:1.93:3.54 | Non-repeating pattern |
| Beat Frequencies | Interference between periods | Evolving, moving texture |
Mode 3: Spectral Blur
🌫️ Randomized Modulation
Formula: θ(f) = A · sin(f/37) · sin(f/113)
Character: Smearing, blurring, washy texture
Best for: Creating ambient textures, reducing transient sharpness
Technical details:
| Aspect | Description | Sonic Result |
|---|---|---|
| Product of Sines | sin(f/37)·sin(f/113) | Complex modulation |
| Low Frequency Modulation | 37Hz and 113Hz rates | Slow, evolving changes |
| Multiplication | Creates sum/difference frequencies | Rich spectral content |
| Transient Smearing | Phase incoherence across frequencies | Reduced attack sharpness |
Mode 4: Formant-Like Resonances
🎵 Gaussian Peaks
Formula: θ(f) = A · [Gaussian(800Hz) + Gaussian(1500Hz) + Gaussian(2500Hz)]
Character: Vowel-like spectral emphasis, resonant peaks
Best for: Vocal-like shaping, frequency region emphasis
Technical details:
| Aspect | Description | Sonic Result |
|---|---|---|
| Gaussian Functions | exp(-((f-center)/width)²) | Smooth, bell-shaped curves |
| Formant Centers | 800Hz, 1500Hz, 2500Hz | Vowel-like frequency regions |
| Bandwidths | 300Hz, 400Hz, 500Hz | Realistic formant widths |
| Phase Reinforcement | Strong shifts at formant centers | Spectral emphasis |
Parameters & Effects
Core Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Phase_mode | option | Comb filter | Type of phase manipulation |
| Phase_amount | positive | 50.0 | Strength of phase effect |
| Stereo_width | positive | 0.2 | L/R phase difference multiplier |
Parameter Ranges & Effects
| Parameter | Range | Low Value Effect | High Value Effect |
|---|---|---|---|
| Phase_amount | 10-200 | Subtle phase coloring | Dramatic transformation |
| Stereo_width | 0.1-1.0 | Natural stereo image | Extreme width, possible instability |
Mode-Specific Characteristics
| Mode | Ideal Phase_amount | Ideal Stereo_width | Typical Use |
|---|---|---|---|
| Comb filter | 30-80 | 0.1-0.3 | Modulation effects, motion |
| Chaotic texture | 40-100 | 0.2-0.4 | Complex textures, evolution |
| Spectral blur | 20-60 | 0.1-0.2 | Ambient textures, smearing |
| Formant resonances | 50-120 | 0.3-0.6 | Vocal shaping, spectral emphasis |
Applications
Stereo Enhancement
Use case: Converting mono sources to stereo, widening narrow recordings
Technique: Use moderate Phase_amount (40-60) with Stereo_width 0.2-0.4
Example: Comb filter mode on mono vocal → natural stereo width
Sound Design & Textures
Use case: Creating evolving textures, ambient pads
Technique: Chaotic texture or Spectral blur modes with high Phase_amount
Example: Spectral blur on synth pad → washy, smeared texture
Special Effects
Use case: Phaser/flanger effects, vocal processing
Technique: Comb filter mode with varying Phase_amount
Workflow:
- Process multiple times with different parameters
- Layer processed versions
- Automate Phase_amount for moving effects
Experimental Composition
Use case: Spectral composition, phase-based structures
Advantages:
- Non-standard audio processing
- Frequency-dependent effects
- Mathematically precise control
- Reproducible results
Example: Formant mode to create artificial vowel spectra
Mono Compatibility Testing
Use case: Testing stereo mixes for mono compatibility
Technique: Extreme phase manipulation reveals mono issues
Application: Identify phase cancellation problems in mixes
Practical Workflow Examples
🎵 Stereo Vocal Enhancement
Goal: Convert mono vocal to natural stereo
Settings:
- Mode: Comb filter
- Phase_amount: 45
- Stereo_width: 0.25
Result: Natural stereo width without artificial doubling
🎹 Synth Pad Texturing
Goal: Add movement and complexity to static synth pad
Settings:
- Mode: Chaotic texture
- Phase_amount: 75
- Stereo_width: 0.35
Result: Evolving, complex texture with wide stereo image
🥁 Drum Smearing
Goal: Create ambient, smeared drum texture
Settings:
- Mode: Spectral blur
- Phase_amount: 35
- Stereo_width: 0.15
Result: Drums with reduced transient sharpness, washy character
Advanced Techniques
- Multiple passes: Process same sound with different modes
- Parameter automation: Vary Phase_amount over time for moving effects
- Frequency splitting: Process different frequency ranges separately
- Mix blending: Blend processed and dry signals
Combine phase manipulation with other processing for complex results
- Artificial spaces: Use phase differences to create spatial impressions
- Spectral morphing: Process different sounds with same parameters
- Phase vocoding: Extreme settings for granular-like effects
- Educational tool: Demonstrate phase perception and effects
Troubleshooting Common Issues
Cause: Low Phase_amount, certain source material
Solution: Increase Phase_amount, try different modes
Cause: Extreme phase differences between L/R
Solution: Reduce Stereo_width, check in mono
Cause: Too high Phase_amount, certain frequencies
Solution: Reduce Phase_amount, try different mode
Cause: Spectral blur mode, high Phase_amount
Solution: Use Comb or Formant modes, lower Phase_amount
Technical Deep Dive
FFT Processing Details
Spectrum to Matrix Conversion
Praat's FFT representation:
Inverse FFT Reconstruction
Returning to time domain:
Psychoacoustic Considerations
Phase Perception Limits
Human phase sensitivity:
Mono Compatibility
Phase cancellation in mono: