Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

processing.fourier

processing.fourier

Functions

NameDescription
fftPerform an N-dimensional Fast Fourier Transform (FFT).
fftcPerform a centered N-dimensional FFT.
fftshiftApply fftshift by rolling data and coordinates along the given dimension(s).
ifftPerform an N-dimensional Inverse Fast Fourier Transform (IFFT).
ifftcPerform a centered N-dimensional IFFT.
ifftshiftApply ifftshift by rolling data and coordinates along the given dimension(s).

fft

processing.fourier.fft(da, dim=DIMS.time, out_dim=None)

Perform an N-dimensional Fast Fourier Transform (FFT).

Applies an ortho-normalized, unshifted FFT. Metadata and unaffected dimensions are strictly preserved.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input time-domain DataArray.required
dimstr or list of strThe dimension(s) to transform. Defaults to DIMS.time.DIMS.time
out_dimstr or list of strThe resulting dimension name(s). Must match the length of dim. If None, the original dimension names are retained.None

Returns

NameTypeDescription
xr.DataArrayThe frequency-domain DataArray with updated reciprocal coordinates.

fftc

processing.fourier.fftc(da, dim=DIMS.time, out_dim=None)

Perform a centered N-dimensional FFT.

This executes an ifftshift -> fft -> fftshift pipeline, which is the standard in MRI/MRS processing to ensure the 0 Hz frequency remains at the center of the spectral axis.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input time-domain DataArray.required
dimstr or list of strThe dimension(s) to transform. Defaults to DIMS.time.DIMS.time
out_dimstr or list of strThe resulting dimension name(s). If None, keeps the original names.None

Returns

NameTypeDescription
xr.DataArrayThe centered, frequency-domain DataArray.

fftshift

processing.fourier.fftshift(da, dim)

Apply fftshift by rolling data and coordinates along the given dimension(s).

This shifts the zero-frequency component to the center of the spectrum.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input xarray DataArray.required
dimstr or list of strThe dimension(s) along which to apply the shift.required

Returns

NameTypeDescription
xr.DataArrayA new DataArray with the data and coordinates rolled.

ifft

processing.fourier.ifft(da, dim=DIMS.frequency, out_dim=None)

Perform an N-dimensional Inverse Fast Fourier Transform (IFFT).

Applies an ortho-normalized, unshifted IFFT. Metadata and unaffected dimensions are strictly preserved.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input frequency-domain DataArray.required
dimstr or list of strThe dimension(s) to transform. Defaults to DIMS.frequency.DIMS.frequency
out_dimstr or list of strThe resulting dimension name(s). Must match the length of dim. If None, the original dimension names are retained.None

Returns

NameTypeDescription
xr.DataArrayThe time-domain DataArray with updated reciprocal coordinates.

ifftc

processing.fourier.ifftc(da, dim=DIMS.frequency, out_dim=None)

Perform a centered N-dimensional IFFT.

This executes an ifftshift -> ifft -> fftshift pipeline, which correctly inverts a centered frequency-domain spectrum back to the time domain.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input centered frequency-domain DataArray.required
dimstr or list of strThe dimension(s) to transform. Defaults to DIMS.frequency.DIMS.frequency
out_dimstr or list of strThe resulting dimension name(s). If None, keeps the original names.None

Returns

NameTypeDescription
xr.DataArrayThe centered, time-domain DataArray.

ifftshift

processing.fourier.ifftshift(da, dim)

Apply ifftshift by rolling data and coordinates along the given dimension(s).

This is the exact inverse of fftshift, moving the zero-frequency component from the center back to the original position.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input xarray DataArray.required
dimstr or list of strThe dimension(s) along which to apply the inverse shift.required

Returns

NameTypeDescription
xr.DataArrayA new DataArray with the data and coordinates rolled.