LUFS Tool — User Guide
Loudness analysis and normalization tool with True Peak measurement, platform-specific targets, and intelligent gain limiting.
What this does
This script performs loudness analysis and normalization using the LUFS (Loudness Units relative to Full Scale) standard. It measures the perceived loudness of audio, compares it to target levels for different platforms (streaming, broadcast, etc.), and optionally applies gain adjustments to match those targets while preventing clipping.
Key Features:
- True Peak measurement: 4× oversampling for accurate peak detection
- Platform presets: Streaming (-14 LUFS), YouTube (-13), Broadcast (-23), Cinematic (-27)
- Three processing modes: Analyze only, Exact gain (may clip), Safe gain (no clipping)
- Intelligent warnings: Identifies when compression is needed before normalization
- Headroom analysis: Calculates maximum safe gain before clipping
- Professional recommendations: Suggests workflow adjustments based on analysis
- Clear reporting: Detailed console output with actionable insights
- Frequency weighting: Emphasizes frequencies humans are most sensitive to (similar to Fletcher-Munson curves)
- Gating: Ignores very quiet sections that don't contribute to perceived loudness
- Integrated measurement: Averages loudness over entire program duration
- True Peak awareness: Accounts for intersample peaks that can cause clipping after encoding
Result: Consistent perceived volume across different tracks, genres, and playback systems.
Technical Implementation: (1) True Peak measurement: 4× oversampling (resample to 4× original rate) to detect intersample peaks. (2) LUFS estimation: Simplified calculation using RMS with -3 dB offset (approximation of ITU-R BS.1770). (3) Headroom calculation: Maximum safe gain = -1 dBTP - current True Peak. (4) Target comparison: Calculates gain needed for each platform target. (5) Intelligent warnings: Classifies issues into "Warning", "Caution", or "Achievable" categories. (6) Processing options: Three distinct modes with different clipping behaviors. (7) Safety measures: Limits processed audio to -1 dBTP for codec safety.
Quick start
- In Praat, select exactly one Sound object (mono or stereo).
- Run script… →
lufs_tool.praat. - Choose Target Platform:
- Custom (set your own target)
- Streaming (Spotify/Apple: -14 LUFS)
- YouTube (-13 LUFS)
- Broadcast TV (-23 LUFS)
- Cinematic (-27 LUFS)
- If choosing Custom, set
custom_target_lufs(e.g., -16.0). - Choose Processing Mode:
- Analyze Only (measurement only, no processing)
- Apply Exact Gain Needed (may cause clipping)
- Apply Safe Gain Only (no clipping, may not reach target)
- Click OK — analysis runs, results displayed in Info window.
- Review the analysis and recommendations in the Info window.
- If processing was applied, output named "originalname_mastered" or "originalname_normalized".
Understanding LUFS
What are LUFS?
📊 Loudness Units relative to Full Scale
Definition: LUFS are a standardized measurement of perceived loudness, defined in ITU-R BS.1770-4.
Why not just use RMS or peak?
- RMS: Measures energy but not perception (flat frequency weighting)
- Peak: Measures maximum amplitude only
- LUFS: Frequency-weighted, gated, integrated = matches human hearing
True Peak vs. Sample Peak
Sample values: [0.5, 0.8, 0.5] (no sample exceeds 0.8)
Reconstructed waveform between samples 2-3 might reach 0.9
This is an intersample peak (not captured in samples)
Codecs can clip these reconstructed peaks
Solution: True Peak measurement
Oversample 4× (interpolate between samples)
Detect maximum of reconstructed waveform
Report as dBTP (dB True Peak)
Script implementation:
LUFS Estimation Method
For accurate LUFS: Use dedicated meter plugins (Youlean Loudness Meter, iZotope Insight, Waves WLM, etc.)
Headroom and Gain Calculations
Platform Targets
Common LUFS Standards
| Platform | Target LUFS | True Peak Limit | Notes |
|---|---|---|---|
| Spotify | -14 | -1 dBTP | Loudness normalization on by default |
| Apple Music | -16 | -1 dBTP | Slightly quieter than Spotify |
| YouTube | -13 to -14 | -1 dBTP | Varies, -13 is safe target |
| Tidal | -14 | -1 dBTP | Hi-Fi streaming |
| Amazon Music | -13 to -14 | -2 dBTP | Some variability |
| Broadcast TV (EBU R128) | -23 | -1 dBTP | European broadcast standard |
| ATSC A/85 (US TV) | -24 | -2 dBTP | US broadcast |
| Netflix | -27 | -2 dBTP | Cinematic content |
| Podcasts | -16 to -19 | -1 dBTP | Comfortable listening |
Platform Presets in Script
🎯 Built-in Platform Targets
Note: These are targets, not necessarily what platforms will play back at. Most platforms apply loudness normalization, so hitting these targets ensures your audio won't be turned down (or up) excessively.
Platform-Specific Considerations
- Normalization is usually ON by default — users can turn it off
- Loudness penalty: If your track is louder than -14 LUFS, platform will turn it down
- No loudness benefit: Making it louder than -14 LUFS doesn't make it sound louder after normalization
- Dynamic range benefit: Quieter targets allow more dynamic range without penalty
YouTube:
- Varies between -13 and -14 LUFS
- Music videos often mastered louder (-10 to -12 LUFS)
- Spoken content benefits from -16 to -18 LUFS for clarity
- YouTube compression can exacerbate clipping — be conservative with True Peak
Broadcast:
- Strict compliance: EBU R128 (-23 ±0.5 LU) and ±1.0 LUF short-term
- Measurement: Must use compliant meters (not this script's approximation)
- Gating: Quiet passages below -70 LUFS are excluded from measurement
- True Peak: Typically -1 dBTP maximum
Cinematic/Film:
- Very dynamic: -27 LUFS allows huge peaks (explosions, quiet dialogue)
- Theatrical vs. streaming: Theaters have more dynamic range than home systems
- Netflix: Strict specs (-27 ±2 LU, -2 dBTP max, dialog gating at -24 LUFS)
Measurement Analysis
What the Analysis Measures
📈 Three Critical Measurements
| Measurement | Method | Purpose | Accuracy |
|---|---|---|---|
| True Peak | 4× oversampling, max detection | Prevent clipping in codecs | High (±0.1 dB) |
| Estimated LUFS | RMS with -3 dB offset | Perceived loudness approximation | Moderate (±2 dB) |
| RMS | Root mean square of samples | Energy measurement | High |
Gap Analysis Categories
Interpretation Examples
Recommendations System
When gain_needed > max_safe + 10 dB:
When gain_needed > max_safe:
When gain_needed ≤ max_safe:
Processing Modes
Mode 1: Analyze Only
📊 Measurement Without Processing
Purpose: Assess audio characteristics without altering the file
Use when: Checking loudness before processing, comparing multiple files, educational purposes, initial assessment.
Mode 2: Apply Exact Gain Needed
⚡ May Cause Clipping
Purpose: Apply exactly the calculated gain to reach target, regardless of clipping
Warnings generated:
Use when: You want to hit target exactly and will handle clipping separately, or when you know clipping is acceptable for your application.
Mode 3: Apply Safe Gain Only
🛡️ No Clipping Guaranteed
Purpose: Apply maximum gain that won't cause clipping, even if target isn't reached
Safety margin: Limits to -1 dBTP (True Peak) to prevent clipping in codecs. Some codecs require more headroom (-2 to -3 dBTP).
Use when: Broadcast-safe processing, streaming distribution, podcasts, or any situation where clipping is unacceptable.
Mode Comparison
| Aspect | Analyze Only | Exact Gain | Safe Gain |
|---|---|---|---|
| Audio modified? | No | Yes | Yes |
| Can cause clipping? | N/A | Yes | No |
| Reaches target? | N/A | Always | Only if safe |
| Output suffix | N/A | _mastered or _CLIPPED | _normalized |
| True Peak limit | N/A | None | -1 dBTP |
| Best for | Assessment | Exact matching | Safe distribution |
Parameters
Target Platform Selection
| Parameter | Type | Options | Default | Description |
|---|---|---|---|---|
| target_platform | optionMenu | Custom, Streaming, YouTube, Broadcast TV, Cinematic | Custom | Select target loudness platform |
| custom_target_lufs | real | -60.0 to 0.0 | -14.0 | Custom target (only used if platform=Custom) |
Processing Mode Selection
| Parameter | Type | Options | Default | Description |
|---|---|---|---|---|
| processing_mode | optionMenu | Analyze Only, Apply Exact Gain Needed, Apply Safe Gain Only | Analyze Only | Select processing behavior |
Derived Parameters (Calculated)
| Parameter | Calculation | Typical Range | Description |
|---|---|---|---|
| target_LUFS | Based on platform selection | -27 to -13 | Final target loudness |
| estimated_lufs | 20×log10(RMS)-3.0 | -50 to -5 | Estimated current loudness |
| true_peak_db | 20×log10(4×oversampled peak) | -60 to 0 | True Peak measurement |
| gain_needed | target_LUFS - estimated_lufs | -30 to +30 dB | Gain required to reach target |
| max_safe | -1.0 - true_peak_db | -59 to +1 dB | Maximum gain without clipping |
Professional Workflow
Complete Loudness Management Process
Practical Examples
🎵 Music Mastering for Streaming
Scenario: Finished mix needs to hit streaming targets
Workflow:
- Analyze: Shows -18.5 LUFS, -3.2 dBTP
- Calculation: Needs +4.5 dB, has +2.2 dB safe
- Action: Apply gentle compression (2-3 dB gain reduction)
- Re-analyze: Now -16.0 LUFS, -2.0 dBTP
- Calculation: Needs +2.0 dB, has +1.0 dB safe
- Final: Use "Safe Gain" mode, reaches -15.0 LUFS (close enough)
🎤 Podcast Episode
Scenario: Recorded podcast needs consistent loudness
Workflow:
- Analyze: Shows -22.5 LUFS, -6.8 dBTP
- Calculation: Needs +8.5 dB for -14 LUFS (streaming), has +5.8 dB safe
- Better target: Use custom -16 LUFS (more natural for speech)
- Recalculate: Needs +6.5 dB, has +5.8 dB safe
- Action: Light compression (1-2 dB) or accept slight limiting
- Final: Use "Safe Gain" mode, reaches -16.7 LUFS
🎬 Film Dialogue Normalization
Scenario: Dialogue track for film mixing
Workflow:
- Analyze: Shows -30.5 LUFS, -1.2 dBTP
- Target: Cinematic (-27 LUFS) or Broadcast (-23 LUFS)
- Choice: Use Broadcast (-23 LUFS) for TV version
- Calculation: Needs +7.5 dB, has -0.2 dB safe (problem!)
- Action: Significant compression/limiting needed first
- Process dynamics, then normalize with "Safe Gain"
Troubleshooting Common Issues
Causes: Very dynamic recording, classical music, film dialogue
Solutions: Use appropriate target (Cinematic -27), or apply compression first
Causes: Already limited/mastered material, brickwall limiting
Solutions: Little to no gain possible, may need to reduce target or accept current level
Causes: Large gap between gain_needed and max_safe
Solutions: Use compression first, or switch to "Safe Gain" mode
Causes: This script uses approximation; professional meters use full ITU-R BS.1770
Solutions: Use this for relative measurements, use professional meters for final compliance
Causes: Intersample peaks not fully caught, codec-specific clipping
Solutions: Use more conservative True Peak limit (-2 to -3 dBTP), test on target platform
Advanced Techniques
- Track level: Balance individual tracks in mix
- Mix bus: Gentle compression/limiting on master
- Analysis: Measure with this script
- Targeted processing: Apply needed compression based on gap analysis
- Normalization: Apply final gain adjustment
- Verification: Check on multiple meters and playback systems
- Streaming: Target -14 LUFS, but consider -16 LUFS for more dynamic range
- Broadcast: Strict compliance needed, use professional meters for final
- Podcasts: -16 to -19 LUFS often sounds more natural than -14
- Film: Different standards for theatrical (-27), broadcast (-23), streaming (-27)
- Archival: Preserve dynamics, use conservative targets (-20 to -24 LUFS)
Best Practices
- Always analyze first: Never apply gain blindly
- Mind the True Peak: -1 dBTP minimum, -2 dBTP safer for lossy codecs
- Use appropriate targets: Not everything needs to be -14 LUFS
- Preserve dynamics when possible: Quieter targets allow more expression
- Test on target systems: Listen on phones, laptops, car systems
- Use reference tracks: Compare loudness and dynamics to similar professional material
- Document your process: Note settings for consistency across projects
- When in doubt, be conservative: It's easier to make something louder later than to fix clipping