Skip to main content

autoeq_optim/
loss.rs

1//! AutoEQ - A library for audio equalization and filter optimization
2//! Loss functions and types for AutoEQ optimizer
3//!
4//! Copyright (C) 2025-2026 Pierre Aubert pierre(at)spinorama(dot)org
5//!
6//! This program is free software: you can redistribute it and/or modify
7//! it under the terms of the GNU General Public License as published by
8//! the Free Software Foundation, either version 3 of the License, or
9//! (at your option) any later version.
10//!
11//! This program is distributed in the hope that it will be useful,
12//! but WITHOUT ANY WARRANTY; without even the implied warranty of
13//! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14//! GNU General Public License for more details.
15//!
16//! You should have received a copy of the GNU General Public License
17//! along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
19pub mod asymmetric;
20pub mod bass_boost;
21pub mod drivers;
22pub mod enhanced_weights;
23pub mod epa;
24pub mod flat;
25pub mod headphone;
26pub mod multisub;
27pub mod phase_aware;
28pub mod slope;
29pub mod speaker;
30pub mod types;
31
32pub use asymmetric::{
33    AsymmetricLossConfig, PreparedAsymmetricLoss, flat_loss_asymmetric, weighted_mse_asymmetric,
34};
35pub use drivers::{
36    CrossoverType, DriverMeasurement, DriversLossData, compute_drivers_combined_response,
37    compute_drivers_combined_response_complex, compute_per_driver_responses, drivers_flat_loss,
38};
39pub use flat::{PreparedFlatLoss, flat_loss};
40pub use headphone::{headphone_loss, headphone_loss_with_target};
41pub use multisub::multisub_flat_loss;
42pub use slope::{
43    calculate_standard_deviation_in_range, curve_slope_per_octave_in_range,
44    regression_slope_per_octave_in_range,
45};
46pub use speaker::{mixed_loss, speaker_score_loss};
47pub use types::{HeadphoneLossData, LossType, SpeakerLossData};