conditioning_numpy ¤
Vectorized sample-domain conditioning, independently implemented in NumPy.
Alternating projections onto reciprocal, sampled-passive and discrete causal responses. These finite-grid constraints do not certify a rational model or its extrapolation. Frequencies occupy axis -3; optional batch axes precede it. The causal projection uses an odd-length Hermitian FFT extension, avoiding an artificial real-valued constraint at the highest measured frequency.
Classes:
| Name | Description |
|---|---|
ConditioningReport | Measured constraints on the returned grid, not a global certificate. |
Functions:
| Name | Description |
|---|---|
condition_sparameters | Alternate sample-domain projections, checking every final constraint. |
project_s_passive | Nearest matrix in Frobenius norm with singular values at most limit. |
project_s_reciprocal | Project onto transpose symmetry without complex conjugation. |
ConditioningReport dataclass ¤
ConditioningReport(
converged: bool,
iterations: int,
maximum_singular_value: float,
reciprocity_error: float,
negative_time_relative_norm: float | None,
dc_error: float | None,
relative_correction: float,
maximum_correction: float,
)
Measured constraints on the returned grid, not a global certificate.
condition_sparameters ¤
condition_sparameters(
S: ndarray,
freqs: ndarray,
*,
passivity: bool = True,
reciprocity: bool = True,
causality: bool = True,
preserve_dc: bool = False,
passivity_limit: float = 1.0,
tolerance: float = 1e-08,
max_iterations: int = 100
) -> tuple[ndarray, ConditioningReport]
Alternate sample-domain projections, checking every final constraint.
Causality requires an explicitly supplied DC-to-fmax uniform grid. No extrapolation or resampling happens implicitly. The finite FFT assumes a periodic impulse window; its causality check is a grid-dependent proxy. DC preservation retains the original real DC matrix and rejects infeasible endpoints. Disabled constraints are reported but do not gate convergence. An iteration limit returns converged=False, never a claimed success.
Source code in circulax/fitting/conditioning_numpy.py
project_s_passive ¤
Nearest matrix in Frobenius norm with singular values at most limit.
Applies to power-normalized S data (e.g. real positive reference impedances). All frequency and batch axes share one stacked SVD call.
Source code in circulax/fitting/conditioning_numpy.py
project_s_reciprocal ¤
Project onto transpose symmetry without complex conjugation.