| Crates.io | autoeq |
| lib.rs | autoeq |
| version | 0.3.12 |
| created_at | 2025-10-05 13:30:34.943806+00 |
| updated_at | 2026-01-19 12:10:54.176748+00 |
| description | Automatic equalization for speakers, headphones and rooms! |
| homepage | |
| repository | https://github.com/pierreaubert/autoeq |
| max_upload_size | |
| id | 1869058 |
| size | 999,741 |
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
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 |
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 optimizationpk: 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 typeThe autoeq binary optimizes EQ for individual speakers or headphones.
# From spinorama.org API data
cargo run --bin autoeq --release -- \
--speaker="JBL M2" --version eac --measurement CEA2034 \
--algo nlopt:cobyla -n 7
# From local CSV file (format: frequency,spl)
cargo run --bin autoeq --release -- \
--curve measurements.csv --target harman.csv \
--algo autoeq:de -n 5
# List all speakers
curl http://api.spinorama.org/v1/speakers
# Get versions for a speaker
curl "http://api.spinorama.org/v1/speakers/JBL%20M2/versions"
# Get measurements for a speaker/version
curl "http://api.spinorama.org/v1/speakers/JBL%20M2/versions/eac/measurements"
| 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 |
# List all available algorithms
cargo run --bin autoeq --release -- --algo-list
# Recommended: global search + local refinement
cargo run --bin autoeq --release -- \
--algo nlopt:isres --refine --local-algo cobyla \
--speaker="KEF R3" --version asr --measurement CEA2034
When using autoeq:de, additional parameters control the optimizer:
# List available strategies
cargo run --bin autoeq --release -- --strategy-list
# Use adaptive strategy
cargo run --bin autoeq --release -- \
--algo autoeq:de --strategy adaptivebin \
--adaptive-weight-f 0.8 --adaptive-weight-cr 0.7 \
--speaker="KEF R3" --version asr --measurement CEA2034
| 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 |
cargo run --bin autoeq --release -- \
--curve headphone_measurement.csv \
--target harman-over-ear-2018.csv \
--loss headphone-score \
--algo mh:rga -n 5 --maxeval 20000 \
--min-freq 20 --max-freq 10000 --peq-model hp-pk-lp
The roomeq binary optimizes multi-channel speaker systems with JSON configuration.
cargo run --bin roomeq --release -- --config room_config.json --output dsp_chain.json
Stereo system:
{
"speakers": {
"left": { "path": "measurements/left.csv" },
"right": { "path": "measurements/right.csv" }
},
"optimizer": {
"loss_type": "flat",
"algorithm": "cobyla",
"num_filters": 10,
"min_q": 0.5, "max_q": 10.0,
"min_db": -12.0, "max_db": 12.0,
"min_freq": 20.0, "max_freq": 20000.0,
"max_iter": 10000
}
}
2.1 system with bass management:
{
"speakers": {
"left": { "path": "measurements/left.csv" },
"right": { "path": "measurements/right.csv" },
"lfe": { "path": "measurements/subwoofer.csv" }
},
"crossovers": {
"bass_management": {
"type": "LR24",
"frequency_range": [60, 100]
}
},
"optimizer": {
"loss_type": "flat",
"algorithm": "cobyla",
"num_filters": 10,
"min_q": 0.5, "max_q": 10.0,
"min_db": -12.0, "max_db": 12.0,
"min_freq": 20.0, "max_freq": 20000.0,
"max_iter": 10000
}
}
cargo run --bin roomeq --release -- --schema
cargo install just
just # List available commands
just prod # Build all release binaries
just prod-autoeq # Build autoeq only
just prod-roomeq # Build roomeq only
just dev # Build debug binaries
Tests require the AUTOEQ_DIR environment variable:
export AUTOEQ_DIR=$(pwd)
# Run all tests
just test # cargo check + cargo test --workspace --lib
# Run tests with nextest (faster)
just ntest
# Run specific test
AUTOEQ_DIR=$(pwd) cargo test --lib test_name
# Run tests for a specific crate
AUTOEQ_DIR=$(pwd) cargo test -p autoeq --lib
AUTOEQ_DIR=$(pwd) cargo test -p autoeq-cea2034 --lib
Fuzz targets are in autoeq/fuzz/fuzz_targets/:
autoeq_config.rs: Fuzzes configuration/CSV parsingautoeq_csv.rs: Fuzzes CSV input handlingTo run fuzzing (requires nightly Rust and cargo-fuzz):
cargo install cargo-fuzz
cd autoeq
cargo +nightly fuzz run autoeq_csv
The QA suite runs optimization scenarios with regression thresholds:
just qa
This executes predefined scenarios testing:
Each scenario has a --qa <threshold> flag that fails if the final loss exceeds the threshold.
Individual QA targets:
just qa-ascilab-6b # Speaker with score loss
just qa-jbl-m2-flat # Speaker with flat loss
just qa-jbl-m2-score # Speaker with score loss
just qa-beyerdynamic-dt1990pro # Headphone tests
just qa-edifierw830nb # Multiple algorithm comparison
# Download speaker data from spinorama.org
just download
# Run algorithm benchmarks
just bench-autoeq-speaker
# Run convergence benchmarks
just bench-convergence
just fmt # Format code
cargo check --workspace --all-targets
cargo clippy --workspace --all-targets