Expand description
The correction design of SECS 2, translated function by function.
Upstream sources: correction_engine.py, the compute half of
calibration.py, mimo.py, mimo_iir.py, scorecard.py.
The interface is one call: measurements, settings, tuning and a compute context in, an immutable result out. Internally the work is cut into deep modules (docs/ARCHITECTURE.md, “Engine”):
- measurement: the one time-axis convention (earliest arrival at the main position is zero, lift, shift), windows, a proper low-rate projection for MIMO.
- target: target curve and level reference, evaluated once per grid.
- filters: RBJ/LR/BW/all-pass responses and the single PEQ fitter with named limit bundles (RC, sub bus, bundle, XO, MIMO path).
- ba: bass alignment (auto, fixed, bundles, DBA and multi-sub layouts, infra sub, two-way level match, bus level, bus PEQ, bus delay/polarity).
- xo: crossover groups, XO target PEQ, the recommendation.
- rc: per-channel room correction (magnitude design, common excess phase, FIR realisation ladder, PEQ refit, touch-up), Schroeder range.
- decay: late-energy windows, mode T60, late peaks, “do no harm” guards.
- chain: the DSP topology as one value; the response simulator here and
the CamillaDSP writer in
secs-camillaread the same value. - mimo: support planning, regularised ideal supports (the λ search of
the ideal FIR goes through the
RidgeBackendseam: CPURidgeSweephere, CUDA f64 insecs-gpu, ADR 0008), IIR or FIR realisation (IIR always runs on the CPU). - scorecard: typed metrics before and after.
Engine knobs that SECS 2 hid in environment variables are fields of an explicit tuning value. Defects fixed on the way are listed in docs/DEVIATIONS.md.
Re-exports§
pub use export_view::ExportView;pub use export_view::export_view;pub use input::EngineConfig;pub use input::Measurement;pub use input::MeasurementSet;pub use input::Samples;pub use input::Tuning;pub use mimo::IirDerivatives;pub use mimo::IirSolveOptions;pub use mimo::IirSolver;pub use mimo::IirSupport;pub use mimo::MimoDesign;pub use mimo::MimoIir;pub use mimo::MimoKey;pub use mimo::MimoRequest;pub use mimo::MimoRoleLateEnergy;pub use mimo::MimoRoleScore;pub use mimo::MimoRun;pub use mimo::design_mimo;pub use mimo::design_mimo_iir;pub use mimo::design_mimo_iir_with_options;
Modules§
- display
- Display-only transforms from
step5_measure.magnitude_dband the pre-run SPL preview. - export_
view - Narrow derived state used by response exports.
- grid
- The design grid every full-resolution spectrum lives on.
- input
- What the engine is given: measurements and the resolved design settings.
- mimo
- Low-rate MIMO ideal FIR support design and do-no-harm guards.
- preview
- BA display curves replayed from an immutable design, without fitting.
- xo
- Crossover recommendation from immutable designs and measured responses.
Structs§
- BaRow
- One sub’s BA row: upstream’s
(gain dB, delay ms, polarity, all-passes). - Calibration
- Calibration
Request - Design
- Design
Replay - What a design was made from. Sample buffers and prepared spectra are shared, never copied. Long-window spectra are computed on request, never cached.
- Design
Request - Design
Spectra - Engine
Inputs - FitRequest
- One
fit_peqcall’s arguments. The grid and correction must have equal, nonzero length; frequencies, bounds and residuals must be finite and valid. - Layout
Info - Main
Design - Manual
Plan - Metrics
- The 17 scalars, named as upstream’s keys. Percentages are on a 0–100 scale.
- Project
View - Role
Late Energy - Role
Scores - Spectra
- Ordered cells; cloning copies only the Arc handles, never a spectrum.
- Stage
Responses - SubDesign
- SubFilter
Enums§
- Engine
Error - Why a design cannot be computed. Messages are for logs; the service maps variants to user-facing error codes.
- Export
Axis - Time origin for a REW export item. Corrected responses retain SECS 2’s latency subtraction (D24 is deliberately not changed here).
- FitStage
- Mimo
Note - Semantic diagnostics in producer order; never translated presentation text.
- Note
- PeqDerivatives
- How PEQ fits differentiate their bands.
Constants§
Functions§
- calibrate
- Resolve, normalize and design with the context’s cancellable production fitters.
- calibrate_
with - The calibration entry point with caller-supplied fitters (oracle replay).
- design
- engine_
inputs - fit_
peq_ with fit_peq_untilwith a chosen derivative;TwoPointis the same arithmetic.- input_
response - late_
energy - Late energy on the same per-position responses used by the scorecard at the
main position and by the mdat’s before/after items elsewhere: the 2 s export
view, which MIMO also starts from. The fitting spectra (
spectra.used) are not used; their late tail differs from those items by up to about 1 dB. Rows are position major, with main roles in chain order. - long_
spectra long_spectra_untilwithout cancellation.- normalize_
measurements - Convert non-48 kHz IRs only when explicitly selected.
- production_
fitters - production_
fitters_ with - stage_
responses - Replays upstream’s internal axis without changing the design’s spectra.
Supplied spectra already contain fixed and generated bundle sub filters,
as do upstream’s
long_spectraresults.
Type Aliases§
- C
- Complex spectrum value.
- Fitter
- Production uses
fit_peq; stage goldens inject recorded decisions here. Callers may reuse the result of an identical request across candidates. - Fitter
Factory