Calculate the background of the annexed spectrum with EstimatedBackground?

Hello,
I would like to calculate the background of the annexed spectrum (csv format).
I have imported the data and I have managed to put these data in a Table or in graphic form.
But the EstimatedBackground[Data] doesn’t seem to work.
Your help would be very appreciated!
Thank you!
Sandra

Hello Sandra,

data = Import[
   "<your path>\\Plot_W3234-3240.csv"];

EstimatedBackground does not support data in the form {{xi,yi}…}, but can handle TimeSeries

ts = TimeSeries[data];

Off[InterpolatingFunction::dmval]

ListPlot[{ts, EstimatedBackground[ts], ts - EstimatedBackground[ts]}, 
 PlotRange -> All, ImageSize -> Large, Joined -> True]

ListPlot[{ts, EstimatedBackground[ts], ts - EstimatedBackground[ts]}, 
 PlotRange -> {{0, 20}, Automatic} , ImageSize -> Large, 
 Joined -> True, 
 PlotLegends -> {"data", "background", "corrected data"}]

Thank you so much Michael! It worked well :slight_smile: I would like to find peaks in this spectra, using the FindPeak command…
peak=FindPeak[data], doesn’t seem to work. Could you give me a hint about this? Does anyone know where can I find the algorithm for the EstimatedBackground or any other mathematica commands?

ts2 = TimeSeriesResample[ts];
peaks = FindPeaks[ts2, 0.5, 0.1, 120];
peaks[“Path”] // TableForm
ListPlot[ts2,
Epilog → {Orange, PointSize[0.03], Point[peaks[“Path”]]},
PlotRange → All]

You have to play with the parameters of FindPeaks

Thank you so much once more, Michael!