Documentation

class mrsimulator.signal_processing.Scale(*, property_units: Dict = {}, factor: float = 1)

Scale the amplitudes of all dependent variables from a CSDM object.

Parameters

factor (float) – The scaling factor. The default value is 1.

Example

>>> import mrsimulator.signal_processing as sp
>>> operation1 = sp.Scale(factor=20)
class mrsimulator.signal_processing.IFFT(*, property_units: Dict = {}, dim_index: Union[int, list, tuple] = 0)

Apply an inverse Fourier transform on all dependent variables of the CSDM object.

Parameters

dim_index (int) – Dimension index along which the function is applied.

Example

>>> operation2 = sp.IFFT(dim_index=0)
class mrsimulator.signal_processing.FFT(*, property_units: Dict = {}, dim_index: Union[int, list, tuple] = 0)

Apply a forward Fourier transform on all dependent variables of the CSDM object.

Parameters

dim_index (int) – Dimension index along which the function is applied.

Example

>>> operation3 = sp.FFT(dim_index=0)
class mrsimulator.signal_processing.apodization.Gaussian(*, property_units: Dict = {'FWHM': ''}, dim_index: Union[int, list, tuple] = 0, dv_index: Union[int, list, tuple] = None, FWHM: Union[float, str] = 0)

Apodize a dependent variable of the CSDM object with a Gaussian function.

The apodization function follows

()\[f(x) = e^{-2 \pi^2 \sigma^2 x^2},\]

where \(x\) are the coordinates of the dimension, and \(\sigma\) is the standard deviation. The relationship between the standard deviation, \(\sigma\), and the full width at half maximum of the reciprocal domain Gaussian function follows

()\[\sigma = \frac{\text{FWHM}}{2\sqrt{2\ln 2}}.\]
Parameters
  • FWHM (str) – The full width at half maximum, FWHM, of the reciprocal domain Gaussian function, given as a string with a value and a unit. The default value is 0.

  • dim_index (int) – The index of the CSDM dimension along which the operation is applied. The default is the dimension at index 0.

  • dv_index (int) – The index of the CSDM dependent variable where the operation is applied. If the value is None, the operation will be applied to every dependent variable.

Example

>>> import mrsimulator.signal_processing.apodization as apo
>>> operation4 = apo.Gaussian(FWHM='143.4 Hz', dim_index=0, dv_index=0)
class mrsimulator.signal_processing.apodization.Exponential(*, property_units: Dict = {'FWHM': ''}, dim_index: Union[int, list, tuple] = 0, dv_index: Union[int, list, tuple] = None, FWHM: Union[float, str] = 0)

Apodize a dependent variable of the CSDM object by an exponential function.

The apodization function follows

()\[f(x) = e^{-\Gamma |x| \pi},\]

where \(x\) are the coordinates of the dimension, and \(\Gamma\) is the width parameter. The relationship between the width parameter, \(\Gamma\), and the full width at half maximum for the reciprocal domain Lorentzian function follows

()\[\text{FWHM} = \Gamma.\]
Parameters
  • FWHM (str) – The full width at half maximum, FWHM, of the reciprocal domain Lorentzian function given as a string with a value and a unit. The default value is 0.

  • dim_index (int) – The index of the CSDM dimension along which the operation is applied. The default is the dimension at index 0.

  • dv_index (int) – The index of the CSDM dependent variable where the operation is applied. If the value is None, the operation will be applied to every dependent variable.

Example

>>> operation5 = apo.Exponential(FWHM='143.4 m', dim_index=0, dv_index=0)
class mrsimulator.signal_processing.affine.Shear(*, property_units: Dict = {'factor': <Quantity 1.>}, dim_index: int = 0, dv_index: Union[int, list, tuple] = None, factor: Union[float, str] = 0, parallel: int = 1)

Apply a shear parallel to dimension at index parallel and normal to dimension at index dim_index.

The shear function is an apodization with the following form

()\[f(x) = e^{-i 2\pi x_0 x_1 a_0},\]

where \(x_0\) are the coordinates of the dimension at index parallel, \(x_1\) are the coordinates of the dimension at index dim_index, and \(a_0\) is the shear constant.

Parameters
  • factor (str) – The shear factor is given as a string with a value and a unit. The default value is 0.

  • dim_index (int) – The shear is applied normal to the CSDM dimension at this index. The default is the dimension at index 0.

  • parallel (int) – The shear is applied parallel to the CSDM dimension at this index. The default is the dimension at index 1.

  • dv_index (int) – The index of the CSDM dependent variable where the operation is applied. If the value is None, the operation will be applied to every dependent variable.

Example

>>> import mrsimulator.signal_processing.affine as af
>>> operation = af.Shear(factor='143.4 Hz', dim_index=0, parallel=1)
class mrsimulator.signal_processing.affine.Scale(*, property_units: Dict = {'factor': <Quantity 1.>}, dim_index: int = 0, dv_index: Union[int, list, tuple] = None, factor: Union[float, str] = 1)

Scale the dimension along the specified dimension index.

Parameters
  • factor (str) – The scaling factor. The default is 1.

  • dim_index (int) – The index of the CSDM dimension to scale. The default is the dimension at index 0.

Example

>>> import mrsimulator.signal_processing.affine as af
>>> operation = af.Scale(factor=2.14, dim_index=0)