raman.FT_baseline_correction

raman.FT_baseline_correction(y, cutoff=None, filter='rect')

Automatic baseline correction based on a Fourier high pass filter after removal of regression line. The stopping criterion for the automatic cutoff search is that the incremental change in the sum over squares should be at least one percent. This algorithm is best suited for spectra with dominant baselines and very small Raman features.

Changed in version 04-01-2016: Changed type of padding to reduce artifacts from Fourier transformation.

Parameters:
  • y (array) – Input spectrum. If y is a list or a 2d array of spectra, correct all spectra.
  • cutoff (int) –

    Cutoff frequency for high pass filter:

    • If cutoff == None, display the Fourier transform of the (first) input spectrum and stop the script.
    • If cutoff > 0, use cutoff directly for high pass filter.
    • If cutoff == -1, do an automatic determination of the optimal cutoff.
  • filter (str) –

    Type of filter function to use. Currently supported values are:

    • ‘rect’ (default): a rectangular step function.
    • ‘cos2’: a cosine squared.
    • ‘linear’: linear interpolation.
Returns:

Baseline corrected spectrum with same shape as y.