How can I subtract the baseline to zero?
Mostrar comentarios más antiguos
I need to compare peak heights of several spectra but they do not baseline at zero, is there a way I can revert the baseline to zero using code on MATLAB?

Thanks, Hannah (absolute matlab novice)
Respuesta aceptada
Más respuestas (4)
Matt J
el 16 de En. de 2015
If you have the Image Processing Toolbox, maybe a median filtering would give a good approximation of the baseline, e.g.,
X-medfilt2(X,[1,3])
Muhammad Irfan
el 30 de Mayo de 2016
0 votos
I never thought I could easily find the solution to this problem :)...thanks Hannah and image analyst..
Muhammad Irfan
el 30 de Mayo de 2016
0 votos
Hi image analyst,...could you kindly advise which filter would work with my signal below..im having difficulties with using the filter u suggested to hannah...
thanks a lot in advance

1 comentario
Image Analyst
el 30 de Mayo de 2016
What's wrong with that? What do you want?
Ella
el 20 de Feb. de 2017
0 votos
Dear Image Analyst,
Thank you for your help with Hannah's question. I tried this method with my data and obtained a flat line. I was wondering if you might be able to help me out with a general baseline removal. In case this is possible, I have attached an example spectrum in .txt format (TanX and TanY are to be plotted on the x and Y axis and are one above each other in the document). We're only concerned about the peaks which are obvious. It was an x-ray photo-electron spectroscopy measurement. Thank you very much!!
4 comentarios
Image Analyst
el 20 de Feb. de 2017
Ella, see m-file attached below this plot it produces:

It estimates where the baseline is (shown in red), then fits a line through them (through the red points only). Then subtracts the line from the signal, and clips it to 0 so there are no negative signals. Then it plots the corrected signal.
Ella
el 23 de Feb. de 2017
Thank you Image Analyst. This is great and I have slightly adapted it to treat an extended signal. Is there anywhere where I can vote this answer up or give you some kind of credit?
Image Analyst
el 23 de Feb. de 2017
Since you didn't start your own question, I couldn't answer it, but you can still give me the same number of reputation points (2) by "Voting" for my answer to Hannah up above (below my avatar). It doesn't matter that it was not directed towards you. Thanks for considering that!
Ella
el 23 de Feb. de 2017
Ah I see! Actually I already voted for your answer when I read it first time because it was the closest I had got to something useful! Okay - then if I have another question one day I'll post it in a seperate question then. Thanks again.
Categorías
Más información sobre Smoothing and Denoising en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
