fftshift#
- class brainunit.fft.fftshift(x, axes=None, **kwargs)#
Shift zero-frequency FFT component to the center of the spectrum.
Unit-aware implementation of
numpy.fft.fftshift(). The unit of the input is preserved in the output.- Parameters:
- Returns:
A shifted copy of
xwith the same unit.- Return type:
Quantity|Array|ndarray|bool|number|bool|int|float|complex
See also
saiunit.fft.ifftshiftInverse of
fftshift.saiunit.fft.fftfreqReturn sample frequencies for the DFT.
Examples
>>> import saiunit as u >>> import saiunit.fft as sufft >>> freq = sufft.fftfreq(4, 1.0 * u.second) >>> shifted = sufft.fftshift(freq) >>> recovered = sufft.ifftshift(shifted)