Protomix.apodization

apodization(fid_df: DataFrame, LB: float = 1, apodization_type: str = 'gaussian') DataFrame[source]

Apply an apodization function to each Free Induction Decay (FID) row in a DataFrame.

Apodization, in the context of NMR (Nuclear Magnetic Resonance) spectroscopy, is a windowing technique applied to FID signals to enhance the signal-to-noise ratio and improve line shape in the frequency domain. This function supports two types of apodization: Gaussian and Exponential.

Parameters:
  • fid_df (pd.DataFrame) – A DataFrame where each row represents an FID signal, and columns represent time points.

  • LB (float, optional) – Line broadening parameter, which determines the width of the apodization function. A higher value results in more broadening. Defaults to 1.

  • apodization_type (str, optional) – Type of apodization function to apply. Options are ‘gaussian’ for Gaussian apodization, and ‘exponential’ for Exponential apodization. Defaults to ‘gaussian’.

Returns:

A DataFrame of the same shape as fid_df, containing the apodized FID values. Each FID row in the input DataFrame is multiplied by the apodization function, transforming the data in the time domain.

Return type:

pd.DataFrame

Raises:

AssertionError – If fid_df is not a pandas DataFrame, LB is negative, or apodization_type is not ‘gaussian’ or ‘exponential’.