[][src]Trait rustfft::Fft

pub trait Fft<T: FftNum>: Length + Direction + Sync + Send {
    pub fn process_with_scratch(
        &self,
        buffer: &mut [Complex<T>],
        scratch: &mut [Complex<T>]
    );
pub fn process_outofplace_with_scratch(
        &self,
        input: &mut [Complex<T>],
        output: &mut [Complex<T>],
        scratch: &mut [Complex<T>]
    );
pub fn get_inplace_scratch_len(&self) -> usize;
pub fn get_outofplace_scratch_len(&self) -> usize; pub fn process(&self, buffer: &mut [Complex<T>]) { ... } }

Trait for algorithms that compute FFTs.

This trait has a few methods for computing FFTs. Its most conveinent method is process(slice). It takes in a slice of Complex<T> and computes a FFT on that slice, in-place. It may copy the data over to internal scratch buffers if that speeds up the computation, but the output will always end up in the same slice as the input.

Required methods

pub fn process_with_scratch(
    &self,
    buffer: &mut [Complex<T>],
    scratch: &mut [Complex<T>]
)
[src]

Divides buffer into chunks of size self.len(), and computes a FFT on each chunk.

Uses the scratch buffer as scratch space, so the contents of scratch should be considered garbage after calling.

Panics

This method panics if:

  • buffer.len() % self.len() > 0
  • buffer.len() < self.len()
  • scratch.len() < self.get_inplace_scratch_len()

pub fn process_outofplace_with_scratch(
    &self,
    input: &mut [Complex<T>],
    output: &mut [Complex<T>],
    scratch: &mut [Complex<T>]
)
[src]

Divides input and output into chunks of size self.len(), and computes a FFT on each chunk.

This method uses both the input buffer and scratch buffer as scratch space, so the contents of both should be considered garbage after calling.

This is a more niche way of computing a FFT. It's useful to avoid a copy_from_slice() if you need the output in a different buffer than the input for some reason. This happens frequently in RustFFT internals, but is probably less common among RustFFT users.

For many FFT sizes, self.get_outofplace_scratch_len() returns 0

Panics

This method panics if:

  • output.len() != input.len()
  • input.len() % self.len() > 0
  • input.len() < self.len()
  • scratch.len() < self.get_outofplace_scratch_len()

pub fn get_inplace_scratch_len(&self) -> usize[src]

Returns the size of the scratch buffer required by process_with_scratch

pub fn get_outofplace_scratch_len(&self) -> usize[src]

Returns the size of the scratch buffer required by process_outofplace_with_scratch

For many FFT sizes, out-of-place FFTs require zero scratch, and this method will return zero - although that may change from one RustFFT version to the next.

Loading content...

Provided methods

pub fn process(&self, buffer: &mut [Complex<T>])[src]

Computes a FFT in-place.

Convenience method that allocates a Vec with the required scratch space and calls self.process_with_scratch. If you want to re-use that allocation across multiple FFT computations, consider calling process_with_scratch instead.

Panics

This method panics if:

  • buffer.len() % self.len() > 0
  • buffer.len() < self.len()
Loading content...

Implementors

impl<T: FftNum> Fft<T> for Butterfly1<T>[src]

impl<T: FftNum> Fft<T> for Butterfly2<T>[src]

impl<T: FftNum> Fft<T> for Butterfly3<T>[src]

impl<T: FftNum> Fft<T> for Butterfly4<T>[src]

impl<T: FftNum> Fft<T> for Butterfly5<T>[src]

impl<T: FftNum> Fft<T> for Butterfly6<T>[src]

impl<T: FftNum> Fft<T> for Butterfly7<T>[src]

impl<T: FftNum> Fft<T> for Butterfly8<T>[src]

impl<T: FftNum> Fft<T> for Butterfly11<T>[src]

impl<T: FftNum> Fft<T> for Butterfly13<T>[src]

impl<T: FftNum> Fft<T> for Butterfly16<T>[src]

impl<T: FftNum> Fft<T> for Butterfly17<T>[src]

impl<T: FftNum> Fft<T> for Butterfly19<T>[src]

impl<T: FftNum> Fft<T> for Butterfly23<T>[src]

impl<T: FftNum> Fft<T> for Butterfly29<T>[src]

impl<T: FftNum> Fft<T> for Butterfly31<T>[src]

impl<T: FftNum> Fft<T> for Butterfly32<T>[src]

impl<T: FftNum> Fft<T> for BluesteinsAlgorithm<T>[src]

impl<T: FftNum> Fft<T> for Dft<T>[src]

impl<T: FftNum> Fft<T> for GoodThomasAlgorithm<T>[src]

impl<T: FftNum> Fft<T> for GoodThomasAlgorithmSmall<T>[src]

impl<T: FftNum> Fft<T> for MixedRadix<T>[src]

impl<T: FftNum> Fft<T> for MixedRadixSmall<T>[src]

impl<T: FftNum> Fft<T> for RadersAlgorithm<T>[src]

impl<T: FftNum> Fft<T> for Radix4<T>[src]

Loading content...