Best Approach for baseline correction?

What would be the best approach for baseline correction?

1 Comment

I think it would be better for you to open up a new question, and try to be as descriptive as you can about what you are trying to do.
That will be better than what you did here, which was to radically change your question such that the accepted answer makes no sense now.

Sign in to comment.

 Accepted Answer

If x is your variable, then
x(x<0) = 0;
will change all the negative values to zero.
If that does not do what you want, you'll need to be more specific about what you mean by "shift to be above zero".

1 Comment

Usaid
Usaid on 30 Sep 2019
Edited: Usaid on 30 Sep 2019
No, that's not what I'm looking for. What I need is after is the baseline correction for the peaks between 1100 ~ 1800 not to be below zero. This is how I did the baseline.
baseY= sgolayfilt(v, 3, 35); %smoothing data
dY = v - baseY;
filter_size2 = 5; %filter size
b = (1/filter_size2)*ones(1,filter_size2);
a = 1;
y = filtfilt(b,a,dY);
plot(x, dY,'r','linewidth',2)
set (gca,'xdir', 'reverse');

Sign in to comment.

More Answers (0)

Asked:

on 30 Sep 2019

Commented:

on 2 Oct 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!