iewt

Function iewt 

pub fn iewt(result: &EWTResult) -> Result<Vec<f64>>
Expand description

Reconstruct x from an EWTResult by summing its components.

Because ewt uses the squared-Meyer (energy-partition) formulation, Σ components[k] ≡ x already; synthesis is a pointwise sum. The wrapper stays in the public API for symmetry with other transforms’ i* synthesis functions, performs full validation of the EWTResult invariants (so a downstream consumer reading coefficients, boundaries, gamma, or filter_responses can rely on them after a successful iewt call), and leaves room for a future biorthogonal variant to swap in non-trivial synthesis without breaking callers.

The validation surface is non-trivial because EWTResult has public fields and serde derives, so a malformed value can arrive from deserialization or hand construction. Silent data loss across a public API boundary is worse than an explicit error.

§Errors

Returns WaveletError::InvalidParameter when any of these EWTResult invariants is violated:

  • components is empty, has a zero-length entry, or has unequal inner lengths.
  • coefficients.len() != components.len(), or any coefficients[k].len() != components[0].len().
  • boundaries.len() != components.len() − 1, or any boundary is non-finite / non-positive / ≥ 2π · (n / 2) / n (the highest representable DFT bin frequency for n = components[0].len()), or boundaries are not strictly increasing.
  • gamma is non-finite or non-positive.
  • filter_responses.len() != components.len(), or any filter_responses[k].len() != n / 2 + 1.