cypocketfft.fft¶
Python API¶
-
cypocketfft.fft.fft(double complex[:] in_arr, fct=None)¶ Perform the rfft for complex input
- Parameters
- Returns
The fft result as an
arrayofcomplex128- Return type
-
cypocketfft.fft.ifft(double complex[:] in_arr, fct=None)¶ Perform the inverse fft
- Parameters
- Returns
The ifft result as an
arrayofcomplex128- Return type
-
cypocketfft.fft.irfft(double complex[:] in_arr, fct=None)¶ Perform the inverse rfft
- Parameters
- Returns
The irfft result as an
arrayoffloat64- Return type
-
cypocketfft.fft.irfft_length(double complex[:] in_arr)¶ Calculate the irfft result length for the input array
This evaluates to \((N - 1) * 2\)
C API¶
Helpers¶
Real FFTs¶
-
Py_ssize_t
_rfft(double[:] in_arr, complex_t[:] out_arr, double fct, bint use_cache=True)¶ Perform the rfft
-
Py_ssize_t
_rfft_with_plan(rfft_plan* plan, double[:] in_arr, complex_t[:] out_arr, double fct)¶ Perform the rfft with an existing
cypocketfft.wrapper.rfft_plan- Parameters
plan (rfft_plan*) – Pointer to a
cypocketfft.wrapper.rfft_planin_arr (
double[:]) – Input array or typed-memoryview (real-valued)out_arr (
complex_t[:]) – Pre-allocated buffer of complex to store the resultfct (double) – Scaling factor to apply to the un-normalized transform (typically
1.0)use_cache (bool) – If
True, use the built-in plancache
-
Py_ssize_t
_irfft(complex_t[:] in_arr, double[:] out_arr, double fct, bint use_cache=True)¶ Perform the inverse rfft
- Parameters
Complex FFTs¶
-
Py_ssize_t
_cfft(complex_t[:] in_arr, complex_t[:] out_arr, double fct, bint use_cache=True)¶ Perform the complex fft
- Parameters
-
Py_ssize_t
_icfft(complex_t[:] in_arr, complex_t[:] out_arr, double fct, bint use_cache=True)¶ Perform the inverse complex fft
- Parameters
in_arr (
complex_t[:]) – Input array or typed-memoryview (complex-valued)out_arr (
complex_t[:]) – Pre-allocated buffer ofdouble complexto store the resultfct (double) – Scaling factor to apply to the un-normalized transform (typically \(1.0 / N\))
use_cache (bool) – If
True, use the built-in plancache
-
Py_ssize_t
_cfft_execute(complex_t[:] in_arr, complex_t[:] out_arr, double fct, bint is_forward=True, bint use_cache=True)¶ Helper function called by
_cfft()and c:func:_icfft to perform the forward or backward transform- Parameters
in_arr (
complex_t[:]) – Input array or typed-memoryview (complex-valued)out_arr (
complex_t[:]) – Pre-allocated buffer ofdouble complexto store the resultfct (double) – Scaling factor to apply to the un-normalized transform
is_forward (bool) – If
True, perform the forward fft. IfFalse, the inverseuse_cache (bool) – If
True, use the built-in plancache
-
Py_ssize_t
_cfft_with_plan(cfft_plan* plan, complex_t[:] in_arr, complex_t[:] out_arr, double fct, bint is_forward=True)¶ Perform the forward or inverse complex fft with an existing
cypocketfft.wrapper.cfft_plan- Parameters
plan – Pointer to a
cypocketfft.wrapper.cfft_planin_arr (
complex_t[:]) – Input array or typed-memoryview (complex-valued)out_arr (
complex_t[:]) – Pre-allocated buffer ofdouble complexto store the resultfct (double) – Scaling factor to apply to the un-normalized transform
is_forward (bool) – If
True, perform the forward fft. IfFalse, the inverse