Wednesday, June 27, 2007

Flattening the baseline

Hiya folks,

The next step in data processing which isn't really necessary, but is helpful and fun to do, is to flatten out the baseline on the spectrum. I managed to use my fitting program as a base to fit, bit by bit, a nice line to the spectrum and then subtract it to flatten the whole thing out better. It works far better than I could have imagined, with one major flaw. Allow me to illustrate...




The top is a small section of the unprocessed spectrum, focusing in on two peaks. The second is the same section after being run through my flattening program. As you can see, I successfully removed all of the wonky wobbly gunk and have instead just a mostly flat line with a little bit of noise (more obvious, as I'm zoomed in quite a bit more) and the two lines. BUT, the two peaks have been horribly malformed.

At the moment, I have a little bit in the program that causes the least squares fitting for each tiny section to ignore those points which are more than 0.01 different from the average value of each section, and this has in fact improved the graph. But it's still pretty fugly. I want the peaks to look like peaks so that the autopeakfitting of Grams can do all of the picking work for me, instead of me manually fitting each one. As it is, though, this just won't do.

But, since trying to get this program working is a lot more fun than fitting peaks, I shall perservere. If anyone has some suggestions, feel free to comment. Otherwise... well, feel free to comment regardless.

1 comment:

Severin said...

See... this is what intimidates me about getting linux. Sure, you find it dead simple... but you also write your own programs.