pub fn ifft<T>(input: &[T], n: Option<usize>) -> FFTResult<Vec<Complex64>>
Expand description
Compute the inverse 1-dimensional Fast Fourier Transform
§Arguments
input
- Input data arrayn
- Length of the output (optional)
§Returns
A vector of complex values representing the inverse FFT result
§Examples
use scirs2_fft::{fft, ifft};
use num_complex::Complex64;
// Generate a simple signal
let signal = vec![1.0, 2.0, 3.0, 4.0];
// Compute the FFT
let spectrum = fft(&signal, None).unwrap();
// Compute the inverse FFT
let reconstructed = ifft(&spectrum, None).unwrap();
// The reconstructed signal should match the original
for (i, val) in signal.iter().enumerate() {
assert!((*val - reconstructed[i].re).abs() < 1e-10);
assert!(reconstructed[i].im.abs() < 1e-10);
}