fftshift#
- class saiunit.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:
Union[saiunit.Quantity,Array,ndarray,number,bool]
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)