pub struct FftHandler<T> { /* private fields */ }
Expand description

n-dimensional complex-to-complex Fourier Transform.

Transforms a complex ndarray of size n to a complex array of size n and vice versa. The transformation is performed along a single axis, all other array dimensions are unaffected. Performs best on sizes which are mutiple of 2 or 3.

The accompanying functions for the forward transform are ndfft (serial) and ndfft_par (parallel).

The accompanying functions for the inverse transform are ndifft (serial) and ndifft_par (parallel).

Example

2-Dimensional complex-to-complex fft along first axis

use ndarray::{Array2, Dim, Ix};
use ndrustfft::{ndfft, Complex, FftHandler};

let (nx, ny) = (6, 4);
let mut data = Array2::<Complex<f64>>::zeros((nx, ny));
let mut vhat = Array2::<Complex<f64>>::zeros((nx, ny));
for (i, v) in data.iter_mut().enumerate() {
    v.re = i as f64;
    v.im = i as f64;
}
let mut fft_handler: FftHandler<f64> = FftHandler::new(nx);
ndfft(&data, &mut vhat, &mut fft_handler, 0);

Implementations

Creates a new FftHandler.

Arguments
  • n - Length of array along axis of which fft will be performed. The size of the complex array after the fft is performed will be of size n / 2 + 1.
Examples
use ndrustfft::FftHandler;
let handler: FftHandler<f64> = FftHandler::new(10);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.