processing.fid
Functions¶
| Name | Description |
|---|---|
| apodize_exp | Apply an exponential weighting filter function for line broadening. |
| apodize_lg | Apply a Lorentzian-to-Gaussian transformation filter. |
| to_fid | Convert a frequency-domain spectrum back to a time-domain FID. |
| to_spectrum | Convert a time-domain Free Induction Decay (FID) to a frequency-domain spectrum. |
| zero_fill | Pad 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 is multiplied with a filter function . 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 is calculated from the desired line broadening in Hz.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
| da | xr.DataArray | The input time-domain data. | required |
| dim | str | The dimension corresponding to time, by default DIMS.time. | DIMS.time |
| lb | float | The desired line broadening factor in Hz, by default 1.0. | 1.0 |
Returns¶
| Name | Type | Description |
|---|---|---|
| xr.DataArray | A 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 . The time constants and
are derived from the lb and gb frequency-domain parameters.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
| da | xr.DataArray | The input time-domain data. | required |
| dim | str | The dimension corresponding to time, by default DIMS.time. | DIMS.time |
| lb | float | The Lorentzian line broadening to cancel in Hz, by default 1.0. | 1.0 |
| gb | float | The Gaussian line broadening to apply in Hz, by default 1.0. | 1.0 |
Returns¶
| Name | Type | Description |
|---|---|---|
| xr.DataArray | A 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¶
| Name | Type | Description | Default |
|---|---|---|---|
| da | xr.DataArray | The input frequency-domain data. | required |
| dim | str | The frequency dimension to transform, by default DIMS.frequency. | DIMS.frequency |
| out_dim | str | The name of the resulting time dimension, by default DIMS.time. | DIMS.time |
Returns¶
| Name | Type | Description |
|---|---|---|
| xr.DataArray | The 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¶
| Name | Type | Description | Default |
|---|---|---|---|
| da | xr.DataArray | The input time-domain FID data. | required |
| dim | str | The time dimension to transform, by default DIMS.time. | DIMS.time |
| out_dim | str | The name of the resulting frequency dimension, by default DIMS.frequency. | DIMS.frequency |
Returns¶
| Name | Type | Description |
|---|---|---|
| xr.DataArray | The 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¶
| Name | Type | Description | Default |
|---|---|---|---|
| da | xr.DataArray | The input data. | required |
| dim | str | The dimension along which to pad zeros, by default DIMS.time. | DIMS.time |
| target_points | int | The 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¶
| Name | Type | Description |
|---|---|---|
| xr.DataArray | A new DataArray padded with zeros to the target length, preserving metadata. |