Background Subtraction

I have been using Igor for a couple of months and have been frustrated when attempting to subtract the background from some of my plots. Generally I will have a background that needs to be subtracted from my plots so that the baseline of the trace lies along zero. The problem that I have been having is that I can fit this background to a function but not anywhere that peaks are observed within my graph. This means that when I go to subtract this from my graph the area of the graph with the peak is not moved because the fitted function only lies on areas where there are no peaks. To make a long story short is there a way to do a quick and dirty baseline subtraction so that I can make my baseline actually lie at zero?
Since you are fitting a function to the baseline, you can subtract that function from your data. The fit will produce a coefficient wave (most likely called W_coef) that you will use as the input to the function. Say you fit a line, you might do something like this:

subtractedData = originalData - (W_coef[0] + W_coef[1]*x)

That assumes that originalData is a waveform (that is, not an XY pair of waves). If it is an XY pair, the command would be something like this:

subtractedData = originalData - (W_coef[0] + W_coef[1]*XDataWave)


Another thing to do is to try one of the versions of Tech Note 20, which you will find in the Igor Pro folder, in Technical Notes:Igor Tech Notes:.


Yet another is to use one of the packages that other customers have prepared, which you will find here: http://www.igorexchange.com/project/Packages/category/55



John Weeks
WaveMetrics, Inc.
support@wavemetrics.com