fft2_parallel

Function fft2_parallel 

Source
pub fn fft2_parallel<T>(
    input: &Array2<T>,
    shape: Option<(usize, usize)>,
    axes: Option<(i32, i32)>,
    norm: Option<&str>,
    workers: Option<usize>,
) -> FFTResult<Array2<Complex64>>
where T: NumCast + Copy + Debug + 'static,
Expand description

Compute a 2D FFT using parallel processing for rows and columns

§Arguments

  • input - Input 2D array
  • shape - Shape of the output (optional)
  • axes - Axes along which to compute the FFT (optional)
  • norm - Normalization mode (optional)
  • workers - Number of worker threads to use (optional)

§Returns

A 2D array of complex values representing the parallel FFT result

§Examples

use scirs2_fft::fft2_parallel;
use scirs2_core::ndarray::{array, Array2};

// Create a simple 2x2 array
let input = array![[1.0, 2.0], [3.0, 4.0]];

// Compute the 2D FFT in parallel
let result = fft2_parallel(&input, None, None, None, None).unwrap();

// The DC component should be the sum of all elements
assert!((result[[0, 0]].re - 10.0).abs() < 1e-10);