Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
AutoEQ: Automatic Equalization for Speakers, Headphones, and Rooms
Introduction
AutoEQ is a Rust CLI toolkit for computing parametric EQ corrections. It uses global optimization algorithms to find optimal IIR filter parameters that minimize deviation from a target response or maximize perceptual preference scores.
Note: A graphical desktop application is available in a separate repository: SotF
Capabilities
Supported Use Cases
- Speaker EQ: Optimize parametric EQ for loudspeakers using CEA2034/Spinorama measurements from spinorama.org
- Headphone EQ: Generate EQ corrections for headphones targeting Harman curves or custom targets
- Multi-Channel Systems: Optimize stereo, 2.1, and multi-driver configurations with crossover management
- Room Correction: Multi-subwoofer alignment and Double Bass Array (DBA) optimization
Optimization Algorithms
Three algorithm libraries are available:
| Library | Algorithms | Constraint Support |
|---|---|---|
| NLopt | ISRES, COBYLA, SLSQP, BOBYQA, DIRECT, StoGO, etc. | Nonlinear constraints |
| Metaheuristics | DE, PSO, RGA, TLBO, Firefly | Penalty-based |
| AutoEQ Custom | Adaptive Differential Evolution | Nonlinear constraints |
Loss Functions
speaker-flat: Minimize deviation from target curve (near-field listening)speaker-score: Maximize Harman/Olive preference score (far-field listening)headphone-flat: Flatten headphone response to targetheadphone-score: Optimize headphone preference scoredrivers-flat: Multi-driver crossover optimizationmulti-sub-flat: Multi-subwoofer array optimization
PEQ Filter Models
pk: All peak/bell filters (default)hp-pk: Highpass + peak filtershp-pk-lp: Highpass + peaks + lowpassls-pk-hs: Low shelf + peaks + high shelffree: All filters can be any type
AutoEQ CLI
The autoeq binary optimizes EQ for individual speakers or headphones.
Basic Usage
# From spinorama.org API data
# From local CSV file (format: frequency,spl)
Finding Speakers and Measurements
# List all speakers
# Get versions for a speaker
# Get measurements for a speaker/version
Key Parameters
| Parameter | Default | Description |
|---|---|---|
-n, --num-filters |
7 | Number of IIR filters |
--algo |
nlopt:cobyla | Optimization algorithm |
--loss |
speaker-flat | Loss function |
--peq-model |
pk | Filter structure model |
--min-freq / --max-freq |
60 / 16000 | Frequency range for filters |
--min-q / --max-q |
1 / 3 | Q factor limits |
--min-db / --max-db |
1 / 3 | Gain limits (dB) |
--maxeval |
2000 | Maximum optimizer evaluations |
--refine |
false | Run local refinement after global optimization |
Algorithm Selection
# List all available algorithms
# Recommended: global search + local refinement
Differential Evolution Options
When using autoeq:de, additional parameters control the optimizer:
# List available strategies
# Use adaptive strategy
| Parameter | Default | Description |
|---|---|---|
--strategy |
currenttobest1bin | DE mutation strategy |
--population |
300 | Population size |
--tolerance |
0.001 | Relative convergence tolerance |
--atolerance |
0.0001 | Absolute convergence tolerance |
--recombination |
0.9 | Crossover probability |
--seed |
random | Random seed for reproducibility |
Headphone Example
RoomEQ CLI
The roomeq binary optimizes multi-channel speaker systems with JSON configuration.
Basic Usage
Features
- Stereo Optimization: Independent EQ for left/right channels
- 2.1 Systems: Bass management with crossover optimization
- Multi-Driver Speakers: Active crossover optimization for multi-way systems
- Multi-Subwoofer Arrays: Gain/delay alignment to minimize seat-to-seat variation
- Double Bass Array (DBA): Front/rear array optimization for room mode cancellation
Configuration File Format
Stereo system:
2.1 system with bass management:
Output Schema
Development
Prerequisites
Build Commands
Testing
Tests require the AUTOEQ_DIR environment variable:
# Run all tests
# Run tests with nextest (faster)
# Run specific test
AUTOEQ_DIR=
# Run tests for a specific crate
AUTOEQ_DIR=
AUTOEQ_DIR=
Fuzzing
Fuzz targets are in autoeq/fuzz/fuzz_targets/:
autoeq_config.rs: Fuzzes configuration/CSV parsingautoeq_csv.rs: Fuzzes CSV input handling
To run fuzzing (requires nightly Rust and cargo-fuzz):
Quality Assurance
The QA suite runs optimization scenarios with regression thresholds:
This executes predefined scenarios testing:
- Speaker optimization (flat and score loss)
- Headphone optimization (multiple algorithms)
- Various PEQ models and algorithm combinations
Each scenario has a --qa <threshold> flag that fails if the final loss exceeds the threshold.
Individual QA targets:
Benchmarking
# Download speaker data from spinorama.org
# Run algorithm benchmarks
# Run convergence benchmarks
Code Quality
Contributing
- Open an issue on GitHub
- Send a PR