pybispectra.utils.compute_fft#
- pybispectra.utils.compute_fft(data: ndarray, sampling_freq: int | float, n_points: int | None = None, window: str = 'hanning', n_jobs: int = 1, verbose: bool = True) tuple[ndarray, ndarray] [source]#
Compute the fast Fourier transform (FFT) on real-valued data.
As the data is assumed to be real-valued, only those values corresponding to the positive frequencies are returned.
- Parameters:
- data
ndarray
, shape of [epochs, channels, times] Real-valued data to compute the FFT on.
- sampling_freq
int
|float
Sampling frequency (in Hz) of
data
.- n_points
int
|None
(defaultNone
) Number of points to use in the FFT. If
None
, is equal to the number of timepoints indata
. For time delay estimation, it is recommended thatn_points=2 * n_times + 1
, wheren_times
is the number of timepoints in each epoch ofdata
.- window
"hanning"
|"hamming"
(default"hanning"
) Type of window to apply to
data
before computing the FFT. Seenumpy.hanning()
andnumpy.hamming()
.- n_jobs
int
(default1
) Number of jobs to run in parallel. If
-1
, all available CPUs are used.- verbose
bool
(defaultTrue
) Whether or not to report the status of the processing.
- data
- Returns: