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.fid

processing.fid

Functions

NameDescription
apodize_expApply an exponential weighting filter function for line broadening.
apodize_lgApply a Lorentzian-to-Gaussian transformation filter.
to_fidConvert a frequency-domain spectrum back to a time-domain FID.
to_spectrumConvert a time-domain Free Induction Decay (FID) to a frequency-domain spectrum.
zero_fillPad the specified dimension with zero amplitude points.

apodize_exp

processing.fid.apodize_exp(da, dim=DIMS.time, lb=1.0)

Apply an exponential weighting filter function for line broadening.

During apodization, the time-domain FID signal f(t)f(t) is multiplied with a filter function ffilter(t)=et/TLf_{filter}(t) = e^{-t/T_L}. This improves the Signal-to-Noise Ratio (SNR) because data points at the end of the FID, which primarily contain noise, are attenuated. The time constant TLT_L is calculated from the desired line broadening in Hz.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input time-domain data.required
dimstrThe dimension corresponding to time, by default DIMS.time.DIMS.time
lbfloatThe desired line broadening factor in Hz, by default 1.0.1.0

Returns

NameTypeDescription
xr.DataArrayA new apodized DataArray, preserving coordinates and attributes.

apodize_lg

processing.fid.apodize_lg(da, dim=DIMS.time, lb=1.0, gb=1.0)

Apply a Lorentzian-to-Gaussian transformation filter.

This filter converts a Lorentzian line shape to a Gaussian line shape, which decays to the baseline in a narrower frequency range. The time-domain FID is multiplied by e+t/TLet2/TG2e^{+t/T_L}e^{-t^2/T_G^2}. The time constants TLT_L and TGT_G are derived from the lb and gb frequency-domain parameters.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input time-domain data.required
dimstrThe dimension corresponding to time, by default DIMS.time.DIMS.time
lbfloatThe Lorentzian line broadening to cancel in Hz, by default 1.0.1.0
gbfloatThe Gaussian line broadening to apply in Hz, by default 1.0.1.0

Returns

NameTypeDescription
xr.DataArrayA new apodized DataArray, preserving coordinates and attributes.

to_fid

processing.fid.to_fid(da, dim=DIMS.frequency, out_dim=DIMS.time)

Convert a frequency-domain spectrum back to a time-domain FID.

This is the mathematical inverse of to_spectrum. It inverse-shifts the data to position 0 Hz at the array boundary, computes the IFFT, and reconstructs strictly positive time coordinates.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input frequency-domain data.required
dimstrThe frequency dimension to transform, by default DIMS.frequency.DIMS.frequency
out_dimstrThe name of the resulting time dimension, by default DIMS.time.DIMS.time

Returns

NameTypeDescription
xr.DataArrayThe reconstructed time-domain FID.

to_spectrum

processing.fid.to_spectrum(da, dim=DIMS.time, out_dim=DIMS.frequency)

Convert a time-domain Free Induction Decay (FID) to a frequency-domain spectrum.

The stored, digital FID signal can be processed by a discrete Fourier transformation (DFT) to produce a digital MR spectrum. This function applies the FFT along the specified time dimension and shifts the zero-frequency component to the center of the spectrum.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input time-domain FID data.required
dimstrThe time dimension to transform, by default DIMS.time.DIMS.time
out_dimstrThe name of the resulting frequency dimension, by default DIMS.frequency.DIMS.frequency

Returns

NameTypeDescription
xr.DataArrayThe frequency-domain spectrum with centered zero-frequency coordinates.

zero_fill

processing.fid.zero_fill(da, dim=DIMS.time, target_points=1024, position='end')

Pad the specified dimension with zero amplitude points.

Artificially extends the data with zeros to interpolate and increase the apparent digital resolution of the resulting spectrum.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe input data.required
dimstrThe dimension along which to pad zeros, by default DIMS.time.DIMS.time
target_pointsintThe total number of points desired after padding, by default 1024.1024
position(end, symmetric)Where to apply the zeros. Use “end” for time-domain FIDs, and “symmetric” for spatial frequency domains like k-space. By default “end”."end"

Returns

NameTypeDescription
xr.DataArrayA new DataArray padded with zeros to the target length, preserving metadata.