pub fn ihfft<T>(
x: &[T],
n: Option<usize>,
norm: Option<&str>,
) -> FFTResult<Vec<Complex64>>
Expand description
Compute the 1-dimensional inverse Hermitian FFT.
This function computes the inverse FFT of real-valued input, producing
a Hermitian-symmetric complex output (where a[i] = conj(a[-i])
).
§Arguments
x
- Input real-valued arrayn
- Length of the transformed axis (optional)norm
- Normalization mode (optional, default is “backward”):- “backward”: No normalization on forward transforms, 1/n on inverse
- “forward”: 1/n on forward transforms, no normalization on inverse
- “ortho”: 1/sqrt(n) on both forward and inverse transforms
§Returns
- The Hermitian-symmetric complex FFT of the real input array
§Examples
use scirs2_fft::hfft::ihfft;
// Create a real-valued array
let x = vec![5.0, -1.0, 2.0];
// Compute the IHFFT (resulting in a complex array with Hermitian symmetry)
let result = ihfft(&x, None, None).unwrap();
// Verify Hermitian symmetry properties
assert_eq!(result.len(), 3);
assert!(result[0].im.abs() < 1e-10); // DC component should be real