PyfftwFFTMaker

class baseband_tasks.fourier.PyfftwFFTMaker(n_simd=None, **kwargs)[source] [edit on github]

Bases: baseband_tasks.fourier.base.FFTMakerBase

FFT factory class utilizing the pyfftw package.

Analagous to rfft, FFTs of real-valued time-domain data perform a real-input transform on one dimension of the input, halving that dimension’s length in the output.

__init__ is used to set package-level options, such as n_simd, while __call__ creates individual transforms.

Parameters
n_simdint or None, optional

Single Instruction Multiple Data (SIMD) alignment in bytes. If None, uses pyfftw.simd_alignment, which is found by inspecting the CPU.

**kwargs

Optional keywords to pyfftw.FFTW class, including planning flags, the number of threads to be used, and the planning time limit.

Methods Summary

__call__(shape, dtype[, direction, axis, ...])

Creates an FFT.

get_frequency_data_info(shape, dtype[, axis])

Determine frequency-domain array shape and dtype.

Methods Documentation

__call__(shape, dtype, direction='forward', axis=0, ortho=False, sample_rate=None)[source] [edit on github]

Creates an FFT.

Parameters
shapetuple

Shape of the time-domain data array, i.e. the input to the forward transform and the output of the inverse.

dtypestr or dtype

Data type of the time-domain data array. May pass either the name of the dtype or the dtype object.

direction‘forward’ or ‘backward’, optional

Direction of the FFT.

axisint, optional

Axis to transform. Default: 0.

orthobool, optional

Whether to use orthogonal normalization. Default: False.

sample_ratefloat, Quantity, or None, optional

Sample rate, used to determine the FFT sample frequencies. If None, a unitless rate of 1 is used.

Returns
fftPyfftwFFT instance

Single pre-defined FFT object.

get_frequency_data_info(shape, dtype, axis=0) [edit on github]

Determine frequency-domain array shape and dtype.

Parameters
shapetuple

Shape of the time-domain data array, i.e. the input to the forward transform and the output of the inverse.

dtypestr or dtype

Data type of the time-domain data array. May pass either the name of the dtype or the dtype object.

axisint, optional

Axis of transform. Default: 0.

Returns
frequency_shapetuple

Shape of the frequency-domain data array.

frequency_dtypedtype

Data type of the frequency-domain data array.