Harmonic Resonance Boost — User Guide
Matrix-based spectral enhancement: selectively boosts harmonic frequencies while attenuating non-harmonic content, with optional stereo widening through asymmetric processing.
What this does
This script implements harmonic resonance boosting — a spectral processing technique that enhances harmonic frequencies based on a specified fundamental while attenuating non-harmonic content. Process: (1) Converts audio to frequency domain via FFT, (2) Identifies harmonic frequencies (multiples of fundamental), (3) Applies gain boost to harmonic regions, (4) Attenuates non-harmonic frequencies, (5) Separates treatment for low/mid vs high frequencies, (6) Optionally processes left/right channels with slight frequency variations for stereo width, (7) Reconstructs enhanced audio with emphasized harmonics.
Key Features:
- 5 Built-in Presets — From subtle to extreme harmonic enhancement
- Matrix-Based Processing — Optimized for speed using Praat matrix operations
- Harmonic Detection — Identifies frequencies at integer multiples of fundamental
- Dual-Band Processing — Separate treatments for low/mid vs high frequencies
- Stereo Width Option — Asymmetric L/R processing creates natural stereo image
- Customizable Parameters — Full control over harmonic selection and enhancement
Technical Implementation: (1) Input preparation: Convert to mono if stereo input (for consistent processing). (2) Frequency domain conversion: Convert to Spectrum with windowing ("yes" for FFT). (3) Matrix representation: Convert spectrum to Matrix for fast mathematical operations. (4) Harmonic detection: Use modulo operation: (col mod fundamental_frequency) identifies harmonic bins. (5) Spectral manipulation: Apply different multipliers: harmonic_boost for harmonic regions, low_mid_attenuation for frequencies below cutoff, high_freq_attenuation for frequencies above cutoff. (6) Stereo processing: Process left and right channels separately with slightly different harmonic_bandwidth for stereo width. (7) Reconstruction: Convert modified matrices back to spectra, then to time-domain sounds. (8) Stereo combination: Merge L/R channels if stereo output requested.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
harmonic_resonance_boost.praat. - Choose preset (Strong Harmonic Boost recommended for first try).
- Or select Custom and adjust parameters manually.
- Enable create_stereo for stereo output (recommended).
- Set scale_peak to prevent clipping (default 0.88).
- Click OK — harmonic enhancement applied.
- Output named "originalname_HB_presetname_STEREO" appears in Objects window.
- Output automatically played if play_after_processing enabled.
Harmonic Processing Theory
Harmonic Series Fundamentals
What Are Harmonics?
Physical definition:
FFT Bin Identification
Detecting harmonics in digital domain:
📐 Visualizing Harmonic Detection
Fundamental = 100Hz, Bandwidth = 10Hz:
Boost regions: 90-110Hz, 190-210Hz, 290-310Hz, ...
Attenuate regions: 110-190Hz, 210-290Hz, ...
Result: Comb-filter-like enhancement at harmonic multiples
FFT bin alignment example:
Fs=44100, N=65536 → bin width ≈ 0.673Hz
100Hz corresponds to bin ≈ 148.6
Mod 148.6 operation detects harmonics at bins ≈ 148.6, 297.2, 445.8, ...
Spectral Processing Strategy
Three-Region Processing
Different treatment for different frequency ranges:
Condition: (col mod fundamental_frequency) < harmonic_bandwidth
Treatment: Multiply by harmonic_boost (e.g., 1.5-5.0)
Effect: Enhance harmonic frequencies
REGION 2: Low/Mid Non-Harmonic
Condition: x < mid_freq_cutoff AND not in harmonic region
Treatment: Multiply by low_mid_attenuation (e.g., 0.2-0.75)
Effect: Attenuate non-harmonic content in lower frequencies
REGION 3: High Frequency Non-Harmonic
Condition: x ≥ mid_freq_cutoff AND not in harmonic region
Treatment: Multiply by high_freq_attenuation (e.g., 0.05-0.6)
Effect: Attenuate non-harmonic content in higher frequencies
Rationale: Different frequency ranges need different treatment
Low frequencies: often harmonic fundamentals, gentle attenuation
High frequencies: often noise/hiss, stronger attenuation
Mid frequencies: transition region
Matrix Optimization
Why matrix processing is fast:
Mathematical Implementation
Complete Processing Formula
Matrix formula breakdown:
Modulo Operation for Harmonic Detection
How modulo identifies harmonics:
Frequency Response Profile
Frequency: 0Hz ──────────────────────────────→ Nyquist
Example: f₀=440Hz, bandwidth=50, cutoff=6000Hz
│ ▲ │ ▲ │ ▲ │ ▲ │ ▲ │ ▲ │
│ │ │ │ │ │ │ │ │ │ │ │ │
│ 440 │ 880 │ 1320 │ 1760 │ 2200 │ 2640 │ ...
│boost │boost │boost │boost │boost │boost │
│ ▲ │ ▲ │ ▲ │ ▲ │ ▲ │ ▲ │
│ 1.5x │ 1.5x │ 1.5x │ 1.5x │ 1.5x │ 1.5x │
│───────│───────│───────│───────│───────│───────│
│atten │atten │atten │atten │atten │atten │
│0.6x │0.6x │0.6x │0.6x │0.6x │0.4x │
│<6000Hz│<6000Hz│<6000Hz│<6000Hz│<6000Hz│>6000Hz│
Result: Comb-filter-like response with periodic boosts
Low/mid frequencies: moderate attenuation between harmonics
High frequencies: stronger attenuation between harmonics
Preset Configurations
Preset Overview
Custom
User-defined parameters
Use: Full manual control
Strong Harmonic Boost
Boost: 3.0x
Attenuation: 0.4x / 0.3x
Subtle Harmonic Boost
Boost: 1.2x
Attenuation: 0.75x / 0.6x
Wide Harmonic Bandwidth
Bandwidth: 150 bins
Boost: 2.0x
Deep Attenuation
Attenuation: 0.2x / 0.1x
Boost: 2.5x
Extreme Resonance
Boost: 5.0x
Attenuation: 0.15x / 0.05x
Preset Details
🎵 Strong Harmonic Boost (Preset 2)
Character: Clear harmonic enhancement with moderate attenuation
Parameters:
- fundamental_frequency: 440 Hz
- harmonic_bandwidth: 50 bins
- harmonic_boost: 3.0×
- low_mid_attenuation: 0.4×
- high_freq_attenuation: 0.3×
Best for: General purpose, music enhancement, vocal clarity
Effect: Harmonics clearly emphasized, background reduced
🎵 Subtle Harmonic Boost (Preset 3)
Character: Gentle enhancement, minimal processing artifacts
Parameters:
- fundamental_frequency: 440 Hz
- harmonic_bandwidth: 50 bins
- harmonic_boost: 1.2×
- low_mid_attenuation: 0.75×
- high_freq_attenuation: 0.6×
Best for: Subtle enhancement, preserving natural sound
Effect: Slight harmonic emphasis, minimal coloration
🎵 Wide Harmonic Bandwidth (Preset 4)
Character: Broad harmonic regions, less precise but fuller sound
Parameters:
- fundamental_frequency: 440 Hz
- harmonic_bandwidth: 150 bins (3× default)
- harmonic_boost: 2.0×
- low_mid_attenuation: 0.5×
- high_freq_attenuation: 0.35×
Best for: Complex signals, rich harmonic content
Effect: Wide frequency regions boosted, smoother response
🎵 Deep Attenuation (Preset 5)
Character: Strong suppression of non-harmonic content
Parameters:
- fundamental_frequency: 440 Hz
- harmonic_bandwidth: 50 bins
- harmonic_boost: 2.5×
- low_mid_attenuation: 0.2×
- high_freq_attenuation: 0.1×
Best for: Noise reduction, isolating pitched elements
Effect: Harmonics stand out clearly from suppressed background
🎵 Extreme Resonance (Preset 6)
Character: Very strong harmonic emphasis, dramatic effect
Parameters:
- fundamental_frequency: 440 Hz
- harmonic_bandwidth: 30 bins (narrow)
- harmonic_boost: 5.0×
- low_mid_attenuation: 0.15×
- high_freq_attenuation: 0.05×
Best for: Sound design, extreme effects, experimental music
Effect: Very strong harmonic peaks, most other content suppressed
Parameters & Effects
Core Parameters
| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
| fundamental_frequency | positive | 440 | 20-5000 Hz | Base frequency for harmonic detection |
| harmonic_bandwidth | positive | 50 | 10-500 bins | Width of harmonic regions in FFT bins |
| harmonic_boost | positive | 1.5 | 1.0-10.0 | Multiplier for harmonic frequencies |
| mid_freq_cutoff | positive | 6000 | 100-20000 Hz | Transition between low/mid and high freq treatment |
| low_mid_attenuation | positive | 0.6 | 0.05-1.0 | Multiplier for non-harmonic frequencies below cutoff |
| high_freq_attenuation | positive | 0.4 | 0.05-1.0 | Multiplier for non-harmonic frequencies above cutoff |
Output Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| create_stereo | boolean | 1 (yes) | Create stereo output with L/R differences |
| stereo_bandwidth_offset | positive | 10 | Right channel bandwidth offset for stereo width |
| scale_peak | positive | 0.88 | Output normalization level (prevent clipping) |
| play_after_processing | boolean | 1 (yes) | Auto-play result after processing |
Parameter Interaction Guide
🔧 fundamental_frequency
Purpose: Sets the base frequency for harmonic detection
Typical values:
- Male speech: 85-180 Hz
- Female speech: 165-255 Hz
- Musical A4: 440 Hz
- Bass guitar: 41-196 Hz
- Violin: 196-2637 Hz
Tip: Use Praat's pitch analysis to find actual fundamental
🔧 harmonic_bandwidth
Purpose: Controls how wide harmonic regions are
Effects:
- Small (10-30): Precise harmonic targeting, comb-filter sound
- Medium (30-80): Natural enhancement, includes some adjacent frequencies
- Large (80-200): Broad enhancement, smoother sound
- Very large (200+): Almost broadband processing
Note: In bins, not Hz — depends on FFT size
🔧 harmonic_boost vs attenuation
Balance is key:
- High boost + low attenuation: Overall louder, harmonics emphasized
- High boost + high attenuation: Strong contrast, harmonics isolated
- Low boost + low attenuation: Subtle effect, slight enhancement
- Low boost + high attenuation: Background reduction, harmonics preserved
Rule of thumb: attenuation = 1/boost for balanced processing
Stereo Processing
Stereo Width Technique
🎧 Asymmetric Harmonic Processing
Method: Process left and right channels with slightly different harmonic_bandwidth
Left channel: Uses harmonic_bandwidth
Right channel: Uses harmonic_bandwidth + stereo_bandwidth_offset
Effect: Different harmonic regions emphasized in each ear
Result: Psychoacoustic stereo widening without time delays
Stereo Processing Workflow
1. Mono Input Preparation
Original sound → Convert to mono (if stereo)
Single channel for consistent processing
2. Left Channel Processing
Mono → Spectrum → Matrix
Apply formula with harmonic_bandwidth
Matrix → Spectrum → Sound
3. Right Channel Processing
Mono → Spectrum → Matrix (fresh conversion)
Apply formula with (harmonic_bandwidth + offset)
Matrix → Spectrum → Sound
4. Stereo Combination
Left Sound + Right Sound → Combine to stereo
Rename, normalize, output
Key insight: Same mono source processed twice
Different parameters create stereo differences
No artificial delays or panning
Stereo Width Control
| stereo_bandwidth_offset | Stereo Effect | Mono Compatibility | Recommended Use |
|---|---|---|---|
| 0 | Mono (identical L/R) | Perfect | Mono output needed |
| 5-15 | Natural width | Good | General stereo enhancement |
| 15-30 | Wide stereo | Moderate | Creative effects, headphones |
| 30-50 | Very wide | Poor | Experimental, check mono |
| 50+ | Extreme separation | Problematic | Special effects only |
Mono Compatibility Considerations
Issue: When L and R have different frequency responses, summing to mono causes comb filtering
Cause: Different harmonic regions emphasized in each channel
Result in mono: Some frequencies may cancel or be overemphasized
Solution: Use moderate stereo_bandwidth_offset (5-15), check mono sum
Testing: Always verify important material in mono
Applications
Vocal Enhancement
Use case: Bring out vocal clarity, reduce background noise
Technique: Set fundamental to vocal pitch (100-300Hz), use moderate boost
Example: Speech with background noise → harmonics emphasized, noise reduced
Musical Instrument Processing
Use case: Enhance specific instruments in mix
Technique: Match fundamental to instrument pitch
Workflow:
- Guitar: 82-988 Hz fundamentals
- Piano: 27.5-4186 Hz
- Brass: 62-932 Hz
- Strings: 196-3136 Hz
Noise Reduction
Use case: Reduce broadband noise while preserving pitched content
Technique: Deep attenuation presets (0.1-0.3×), moderate boost
Application: Historical recordings, field recordings, noisy speech
Sound Design
Use case: Create artificial resonances, metallic sounds
Technique: Extreme settings, experiment with fundamentals
Example: White noise + harmonic boost → tuned noise, metallic textures
Audio Analysis
Use case: Visualize harmonic content
Technique: Process then view spectrum
Application: See which harmonics are present in complex sounds
Practical Workflow Examples
🎤 Vocal Clarity Enhancement
Goal: Make vocals stand out in busy mix
Settings:
- Preset: Strong Harmonic Boost
- fundamental_frequency: 200 Hz (adjust to vocal pitch)
- create_stereo: Yes
- stereo_bandwidth_offset: 8
Result: Vocal harmonics enhanced, instruments slightly reduced
Tip: Blend processed with dry signal (50/50 mix)
🎸 Guitar Tone Enhancement
Goal: Add richness to acoustic guitar
Settings:
- Preset: Wide Harmonic Bandwidth
- fundamental_frequency: 164 Hz (E3) or song key
- harmonic_boost: 1.8
- low_mid_attenuation: 0.7
Result: Warmer, richer guitar tone with enhanced harmonics
Tip: Process different takes with different fundamentals for layered sound
🔇 Noise Reduction for Speech
Goal: Reduce room noise while preserving speech
Settings:
- Preset: Deep Attenuation
- fundamental_frequency: 150 Hz (male) or 220 Hz (female)
- create_stereo: No (mono for speech)
Result: Cleaner speech with reduced background noise
Tip: Combine with gentle compression after processing
Advanced Techniques
- Serial processing: Apply multiple times with different fundamentals
- Parallel processing: Process copies with different settings, then mix
- Automation: Change fundamental over time to follow melody
- Key-based: Set fundamental to song key frequency
Combine techniques for complex harmonic enhancement
- Non-musical fundamentals: Try 55 Hz (power hum), 1000 Hz (whine)
- Extreme settings: Boost 10.0×, attenuate 0.01× for dramatic effects
- Inverted processing: Attenuate harmonics, boost non-harmonics
- Frequency sweeps: Automate fundamental from 20 to 2000 Hz
Troubleshooting Common Issues
Cause: fundamental doesn't match audio, boost too low, attenuation too high
Solution: Analyze audio pitch first, use stronger settings
Cause: harmonic_boost too high, scale_peak too high
Solution: Reduce boost, lower scale_peak to 0.7-0.8
Cause: harmonic_bandwidth too narrow, extreme settings
Solution: Increase bandwidth, use more moderate presets
Cause: Large stereo_bandwidth_offset, different L/R processing
Solution: Reduce offset, check mono compatibility
Cause: attenuation too low (0.1-0.3)
Solution: Increase attenuation values (0.5-0.8)
Technical Notes
FFT Considerations
Frequency Resolution Impact
How FFT size affects harmonic detection:
Windowing Effects
Hann window impact on processing:
Pros:
- Reduces spectral leakage
- Smoother frequency response
- Better harmonic isolation
Cons:
- Smears transients
- Reduces time resolution
- Affects start/end of signal
For harmonic processing:
Windowing is beneficial
Reduces artifacts from sharp spectral edits
Makes harmonic regions blend better
Recommended: keep "yes" (default)
Performance Optimization
Matrix vs Loop Processing
Speed comparison:
Mathematical Precision
Modulo Operation Details
Implementation in Praat Formula: