Advanced vinyl record scratch, click, and pop removal plugin using research-backed digital signal processing techniques.
This project provides a Nyquist plugin for Audacity that removes clicks, pops, and scratches from vinyl record digitizations using adaptive threshold detection and frequency-domain processing.
Key Features:
- Native Audacity integration (no external dependencies)
- Real-time preview capability
- Adaptive detection adjusts to recording characteristics
- Multi-pass processing for thorough click removal
- Preserves musical content while removing artifacts
Also included: A Python implementation with advanced AR interpolation for highest-quality offline processing.
📚 Comprehensive technical documentation available in docs/:
- Research Findings - Complete research on vinyl scratch removal algorithms, published papers, and commercial implementations
- Nyquist Programming Guide - Complete guide to Nyquist language and plugin development
- Implementation Notes - Detailed explanation of design decisions and algorithm implementation
Algorithm: Frequency-domain separation with adaptive attenuation
- Separates audio into low-freq (music) and high-freq (transients + clicks)
- Adaptively attenuates detected clicks in high-frequency band
- Recombines for natural-sounding result
Advantages:
- Integrates directly into Audacity
- No external dependencies or installation
- Real-time preview
- Fast processing
- Easy to use
Limitations:
- Attenuates clicks rather than fully removing (due to Nyquist language constraints)
- Good quality but not as perfect as AR interpolation
Algorithm: Autoregressive Linear Prediction with Cubic Spline interpolation
- Detects clicks using second derivative analysis
- Interpolates using AR prediction (models signal statistically)
- Falls back to cubic spline for short clicks
Advantages:
- Highest quality restoration (true sample interpolation)
- State-of-the-art algorithms from research literature
- Better for archival-quality restoration
Disadvantages:
- Requires Python and dependencies
- Slower processing (no real-time preview)
- Command-line interface only
Frequency-Domain Approach (works within Nyquist's constraints):
-
Frequency Separation: Split audio at 2kHz
- Low-freq (<2kHz): Musical content (melody, harmony)
- High-freq (>2kHz): Transients + clicks
-
Adaptive Detection: Calculate local RMS envelope of high-freq component
- Threshold adapts to varying signal levels
- Reduces false positives from legitimate transients
-
Attenuation: Reduce amplitude where clicks detected
- Preserves 30% of high-freq content for natural sound
- Smooth processing avoids discontinuities
-
Recombination: Mix processed high-freq with unchanged low-freq
-
Multi-pass: Repeat with decreasing threshold
- Pass 1: Remove obvious clicks
- Pass 2: Catch subtler artifacts
See Implementation Notes for complete technical details.
Time-Domain AR Prediction (highest quality):
- Detection: Second derivative + adaptive threshold
- Interpolation: Autoregressive linear prediction
- Validation: Width and amplitude criteria
- Blending: Smooth windowing for seamless repair
See Research Findings for algorithm theory and research papers.
-
Download the plugin:
- Copy
vinyl-scratch-removal.nyto your Audacity plugins folder:- Windows:
C:\Program Files\Audacity\Plug-Ins\ - macOS:
~/Library/Application Support/audacity/Plug-Ins/ - Linux:
~/.audacity-data/Plug-Ins/or/usr/share/audacity/plug-ins/
- Windows:
- Copy
-
Enable in Audacity:
- Open Audacity
- Go to
Tools > Plugin Manager - Find "Vinyl Scratch Removal" and enable it
- Click
OK
-
Use the plugin:
- Select audio in Audacity
- Go to
Effect > Vinyl Scratch Removal - Adjust parameters (see Usage section)
- Click
Previewto test, thenApply
-
Install Python 3.7+ (if not already installed)
-
Install dependencies:
pip install -r requirements.txt
Or install individually:
pip install numpy scipy soundfile
Parameters:
-
Click Sensitivity (1-100): How aggressively to detect clicks
1-10: Very conservative, only obvious clicks20: Default, balanced detection50-100: Aggressive, may detect false positives
-
Maximum Click Width (ms): Maximum duration of clicks to detect
0.1-2.0: Short clicks only (default: 2.0ms)2.0-5.0: Medium clicks and pops5.0-10.0: Large pops and scratches
-
Detection Mode:
Clicks Only: Conservative, single-passClicks + Crackle: Standard, multi-pass (recommended)Aggressive: Maximum detection, may affect audio
Recommended Settings:
- Light cleaning: Sensitivity=10, Width=2.0ms, Mode=Clicks Only
- Standard restoration: Sensitivity=20, Width=2.0ms, Mode=Clicks + Crackle
- Heavy restoration: Sensitivity=30, Width=5.0ms, Mode=Aggressive
Basic usage:
python vinyl_scratch_removal.py input.wav output.wavWith custom parameters:
# Conservative (only obvious clicks)
python vinyl_scratch_removal.py input.wav output.wav --mode conservative --threshold 4.0
# Standard (recommended)
python vinyl_scratch_removal.py input.wav output.wav --mode standard --threshold 3.0
# Aggressive (maximum click removal)
python vinyl_scratch_removal.py input.wav output.wav --mode aggressive --threshold 2.0 --max-width 5.0Command-line options:
--threshold FLOAT Detection threshold in standard deviations
Lower = more sensitive (default: 3.0)
Range: 1.0 (very sensitive) to 5.0 (conservative)
--max-width FLOAT Maximum click width in milliseconds
(default: 2.0)
--mode MODE Detection mode:
- conservative: Only obvious clicks
- standard: Balanced (default)
- aggressive: Maximum detection
--ar-order INT AR model order for interpolation
Higher = more accurate but slower
(default: 20, range: 10-50)
This plugin implements techniques from published research in digital audio restoration:
-
Godsill & Rayner (1998) - "Digital Audio Restoration: A Statistical Model Based Approach"
- Foundation for AR-based audio restoration
- Bayesian framework for click detection
- Statistical modeling of clean audio signals
-
Lagrange et al. (2020) - "Restoration Based on High Order Sparse Linear Prediction"
- Sparse AR prediction reduces computation
- High-order models for better quality
- Implemented in Python version
-
Esquef et al. (2004) - "Detection of clicks using warped linear prediction"
- Perceptually-weighted detection
- Adaptive thresholding methods
- Influences detection algorithm
-
Recent (2024) - "Diffusion Models for Audio Restoration" (arXiv:2402.09821)
- Modern deep learning approaches
- Future research direction
See Research Findings for complete bibliography and algorithm descriptions.
Nyquist (LISP-based audio language) treats audio as continuous signals (mathematical functions), not discrete sample arrays. This philosophical difference has practical implications:
What Nyquist CAN do:
- Signal-level operations (filtering, mixing, multiplication)
- Envelope following and analysis
- Adaptive processing
- Fast, efficient processing
What Nyquist CANNOT do:
- Access individual samples (
audio[i]) - Array/matrix operations (needed for AR interpolation)
- Sample-level loops and interpolation
- FFT/spectral editing
See Nyquist Programming Guide for detailed explanation.
Nyquist Plugin: Uses frequency-domain approach that works within language constraints
- Good quality through attenuation rather than interpolation
- Fast, practical, works for 90% of cases
Python Tool: Implements "ideal" algorithm from research literature
- True sample-level interpolation
- Highest quality for archival restoration
- Slower, requires external dependencies
Recommendation: Start with Nyquist plugin. Use Python tool for difficult cases or archival work.
| Feature | Audacity Built-in | This Plugin (Nyquist) | This Tool (Python) | iZotope RX |
|---|---|---|---|---|
| Quality | Fair | Good | Excellent | Excellent |
| Speed | Fast | Fast | Slow | Medium |
| Real-time preview | Yes | Yes | No | Yes |
| Cost | Free | Free | Free | $$$$ |
| Ease of use | Easy | Easy | Command-line | Easy |
| Algorithm | Simple threshold | Adaptive attenuation | AR interpolation | ML + spectral |
| Preservation | Fair | Good | Excellent | Excellent |
| Integration | Built-in | Plugin | Standalone | Standalone |
When to use each:
- Audacity built-in: Quick, simple jobs
- This Nyquist plugin: Most vinyl restoration tasks (recommended)
- This Python tool: Archival-quality restoration, difficult cases
- iZotope RX: Professional work, visual editing, budget available
- Attenuation not removal: Reduces click amplitude rather than completely removing (language constraint)
- Very loud clicks: May still be faintly audible after processing
- High-frequency percussion: Cymbals/hi-hats may be slightly reduced on aggressive mode
- Impulsive noise only: Designed for clicks/pops, not continuous noise (hiss, rumble, hum)
- Manual tuning: Different recordings need different parameters
- Transient preservation: May affect legitimate musical transients if set too aggressively
- Processing time: AR interpolation is CPU-intensive (not real-time)
- Dependencies: Requires Python 3.7+, NumPy, SciPy, soundfile
- No GUI: Command-line interface only
- Clean the record - Physical cleaning reduces scratches
- Test a section - Process a small section first to tune parameters
- Use preview - In Audacity, always preview before applying
- Make a backup - Save original before processing
- Start conservative - Begin with low sensitivity
- Increase gradually - If clicks remain, increase sensitivity
- Check for artifacts - Listen for "watery" or "bubbling" sounds (over-processing)
- Adjust width - Match maximum click width to your vinyl's condition
- Check edges - Listen to track beginnings/ends for artifacts
- Compare with original - A/B test to ensure quality
- Further processing - Consider additional noise reduction if needed
- Normalize - May want to normalize volume after processing
- Increase sensitivity: Try threshold 30-50 (Nyquist) or 2.0-2.5 (Python)
- Increase max width: Try 5-10ms for larger pops
- Use aggressive mode: Switch to aggressive detection
- Decrease sensitivity: Try threshold 5-10 (Nyquist) or 4.0-5.0 (Python)
- Use conservative mode: Switch to conservative detection
- Reduce max width: Try 1.0-2.0ms
- Check plugin file location
- Restart Audacity
- Check Plugin Manager (Tools > Plugin Manager)
- Enable plugin if disabled
- Check dependencies:
pip install -r requirements.txt - Check file format: Use WAV files (MP3/FLAC may need conversion)
- Check Python version: Requires Python 3.7+
Contributions welcome! Areas for improvement:
- Deep learning-based detection and interpolation
- Real-time processing optimization
- GUI for Python tool
- Additional file format support
- LADSPA/LV2 plugin compilation
MIT License - See LICENSE file for details
- Algorithm Research: Based on published DSP research (see Technical Background)
- Implementation: Claude (Anthropic)
- Testing: Community contributions welcome
-
Godsill, S., & Rayner, P. (1998). Digital Audio Restoration: A Statistical Model Based Approach. Springer.
-
Lagrange, M., et al. (2020). "Restoration of Click Degraded Speech and Music Based on High Order Sparse Linear Prediction." ResearchGate.
-
Esquef, P.A.A., et al. (2004). "Detection of clicks in audio signals using warped linear prediction." IEEE.
-
Columbia University DSP Course. "Audio Click Removal Using Linear Prediction."
-
Various authors (2024). "Diffusion Models for Audio Restoration." arXiv:2402.09821.
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing issues for solutions
- Consult Audacity forums for plugin-specific questions
Note: This is research software. While based on published algorithms, results may vary depending on your audio. Always keep original recordings as backup.