idst

Function idst 

Source
pub fn idst<T>(
    x: &[T],
    dsttype: Option<DSTType>,
    norm: Option<&str>,
) -> FFTResult<Vec<f64>>
where T: NumCast + Copy + Debug,
Expand description

Compute the 1-dimensional inverse discrete sine transform.

§Arguments

  • x - Input array
  • dst_type - Type of IDST to perform (default: Type2)
  • norm - Normalization mode (None, “ortho”)

§Returns

  • The IDST of the input array

§Examples

use scirs2_fft::{dst, idst, DSTType};

// Generate a simple signal
let signal = vec![1.0, 2.0, 3.0, 4.0];

// Compute DST-II of the signal with orthogonal normalization
let dst_coeffs = dst(&signal, Some(DSTType::Type2), Some("ortho")).unwrap();

// Inverse DST-II should recover the original signal
let recovered = idst(&dst_coeffs, Some(DSTType::Type2), Some("ortho")).unwrap();

// Check that the recovered signal matches the original
for (i, &val) in signal.iter().enumerate() {
    assert!((val - recovered[i]).abs() < 1e-10);
}