irfft_simd

Function irfft_simd 

Source
pub fn irfft_simd<T>(
    input: &[T],
    n: Option<usize>,
    norm: Option<&str>,
) -> FFTResult<Vec<f64>>
where T: NumCast + Copy + Debug + 'static,
Expand description

Compute the inverse of the 1-dimensional discrete Fourier Transform for real input with SIMD acceleration.

This function is optimized using SIMD instructions for improved performance on modern CPUs.

§Arguments

  • input - Input complex-valued array representing the Fourier transform of real data
  • n - Length of the output array (optional)
  • norm - Normalization mode (optional)

§Returns

  • The inverse Fourier transform, yielding a real-valued array

§Examples

use scirs2_fft::simd_rfft::{rfft_simd, irfft_simd};

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

// Forward transform
let spectrum = rfft_simd(&signal, None, None).unwrap();

// Inverse transform
let recovered = irfft_simd(&spectrum, Some(signal.len()), None).unwrap();

// Check recovery accuracy
for (x, y) in signal.iter().zip(recovered.iter()) {
    assert!((x - y).abs() < 1e-10);
}