Skip to main content

imdct

Function imdct 

Source
pub fn imdct<T: Sample>(
    coefficients: &Array2<T>,
    params: &MdctParams,
    original_length: Option<usize>,
) -> SpectrogramResult<Vec<T>>
Expand description

Compute the IMDCT (inverse MDCT) from MDCT coefficients.

Uses overlap-add with the synthesis window to reconstruct the signal. With a sine window and 50% hop, this achieves perfect reconstruction.

§Arguments

  • coefficients - 2D array of shape (N, n_frames) as returned by mdct.
  • params - MDCT parameters (must match those used for analysis).
  • original_length - If provided, output is truncated to this length.

§Returns

Reconstructed signal via overlap-add.

§Errors

Returns InvalidInput if the coefficient array shape doesn’t match params.