DecayCore DSP Guards Reference

This document defines all major guard mechanisms in the DSP pipeline and classifies them as either:

Each guard includes:


PRINCIPLED GUARDS

These define how DecayCore is intended to behave acoustically. They shape correction philosophy, realism, and robustness.


1. Mixed Excess Mask (LF-only phase blending)

Location: dsp_phase / mixed-phase logic Stage: Phase construction

Why: Restricts excess-phase correction primarily to low frequencies with a soft transition band.

Prevents:


2. Pre-Energy / Pre-Ringing Guard

Location: dsp/phase_ir_guards.py Stage: Post phase-IR generation

Config (typical):

Why: Limits excessive energy before the main impulse peak to preserve transient realism.

Prevents:


3. Max Boost / Max Cut Limits

Location: dsp/correction_mag.py, dsp/limits.py Stage: Magnitude correction

Config (typical):

Why: Prevents unrealistic amplification demands on the system.

Prevents:


4. Peak Priority Shaping

Location: dsp/correction_mag.py Stage: Error shaping

Config (typical):

Why: Reduces boost into narrow dips/nulls where correction is physically ineffective.

Prevents:


5. Regularization

Location: dsp/correction_mag.py Stage: Target shaping

Config (typical):

Why: Globally pulls correction toward 0 dB to improve robustness.

Prevents:


6. Smoothing (Magnitude Domain)

Location: dsp/correction_mag.py Stage: Target conditioning

Why: Smooths the correction curve to improve spatial robustness and perceptual stability.

Prevents:


7. Confidence-Based Weighting / Target Pull

Location: dsp/correction_mag.py, dsp/decaycore_dsp.py Stage: Target blending

Config (typical):

Why: Reduces correction strength in low-confidence regions.

Prevents:


8. Auto Headroom / Auto Gain

Location: dsp/phase_ir_autogain.py Stage: Final normalization

Config (typical):

Why: Ensures safe global output level.

Prevents:


9. GD Gradient Limiter

Location: dsp/decaycore_dsp.py Stage: Phase-domain limiting

Why: Constrains extreme group delay slope (ms/octave), especially in LF.

Prevents:


TECHNICAL GUARDS

These ensure numerical and structural stability. They must remain always-on and are not part of user-facing philosophy.


1. IR Shift / Alignment Bounds

Location: dsp/phase_ir_align.py Stage: IR alignment

Why: Prevents illegal impulse shifts beyond window boundaries.

Prevents:


2. Alignment Fallback Logic

Location: dsp/phase_ir_align.py Stage: Alignment target computation

Why: Ensures safe defaults if centroid/peak detection fails.

Prevents:


3. Window Auto-Asymmetry Cap

Location: dsp/phase_ir_window.py Stage: Windowing

Why: Limits extreme asymmetric window selections.

Prevents:


4. NaN / Inf Sanitization

Location: Multiple modules Stage: Throughout pipeline

Why: Ensures stable numerical behavior.

Prevents:


5. Frequency Axis Sanitization

Location: dsp_preprocess / dsp_correction Stage: Preprocessing

Why: Guarantees monotonic and unique frequency axis.

Prevents:


Dependency Map (Dominance Overview)

This section describes which mechanisms typically dominate when multiple guards affect the same risk.

Legend:


Boost / Headroom Cluster

Regularization → Peak Priority → Max Boost/Cut → Auto Headroom

Upstream shaping should reduce how often hard caps are needed.


Overfitting / Sawtooth Cluster

Smoothing → (reduces need for) Slope Limits Smoothing ⇄ Regularization Confidence Weighting ⇄ Regularization

Slope limiting should rarely dominate if smoothing is well tuned.


Mixed-Phase Stability Cluster

Mixed Excess Mask → (reduces need for) GD Gradient Limiter

If GD limiter activates frequently, the excess mask is too permissive.


Time-Domain Stability Cluster

Alignment Bounds → Window Cap → Pre-Energy Guard

If pre-energy guard activates often, upstream alignment/window policy should be revised.


Trigger Matrix (Operational Monitoring)

Healthy system expectations:

Often active but gentle:

Occasional safety nets:

Rare last-resort guards:

If a rare guard triggers frequently, treat it as an upstream design issue rather than a tuning feature.


Design Rule

Principled guards define intended acoustic behavior. Technical guards ensure mathematical and structural stability.

Principled guards may be user-adjustable. Technical guards must never be disabled.


1. Overview

Overview

Disclaimer

AI was used to translate this document from Finnish to English.