Struct ndrustfft::FftHandler

source ·
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§

source§

impl<T: FftNum> FftHandler<T>

source

pub fn new(n: usize) -> Self

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.
§Examples
use ndrustfft::FftHandler;
let handler: FftHandler<f64> = FftHandler::new(10);
source

pub fn normalization(self, norm: Normalization<Complex<T>>) -> Self

This method allows modifying the normalization applied to the backward transform. See Normalization for more details.

Trait Implementations§

source§

impl<T: Clone> Clone for FftHandler<T>

source§

fn clone(&self) -> FftHandler<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<T> Freeze for FftHandler<T>

§

impl<T> !RefUnwindSafe for FftHandler<T>

§

impl<T> Send for FftHandler<T>

§

impl<T> Sync for FftHandler<T>

§

impl<T> Unpin for FftHandler<T>

§

impl<T> !UnwindSafe for FftHandler<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

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

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.