Remove drift from signal

How do I remove the drift from this signal? I want the "flat" lines in beginning and the end to be at the same level.

7 件のコメント

Image Analyst
Image Analyst 2016 年 7 月 18 日
You forgot to attach a screenshot or data, so until you read this link about all I can suggest is to use polyfit and subtract the fitted/smoothed signal.
thestargazer
thestargazer 2016 年 7 月 18 日
Sorry, I forgot to click upload. Image added and attached the data here.
thestargazer
thestargazer 2016 年 7 月 18 日
Tried with code:
opol = 1;
[p,s,mu] = polyfit(t1,phase1,opol);
f_y = polyval(p,t1,[],mu);
dt_phase1 = phase1 - f_y;
plot(t1,dt_phase1,'.');
Is there a way to only take the baseline into account for the slope?
Star Strider
Star Strider 2016 年 7 月 18 日
We need to have your time vector as well, since that is required to write code specific to your data. Add that, and upload the .mat file.
Image Analyst
Image Analyst 2016 年 7 月 18 日
Exactly what/where do you consider the baseline to be? Can you draw it on there?
Star Strider
Star Strider 2016 年 7 月 18 日
There seems to be an integrated square-wave pulse in the centre half of the data. What are your data and how are you acquiring and initially processing them?
thestargazer
thestargazer 2016 年 7 月 19 日
編集済み: thestargazer 2016 年 7 月 19 日
Image shows what I meant with baseline. Baseline 1 and Baseline 2 are suppose to be at same level, but I had a drift in my measurement (signal = intensity). I want to remove the drift without distorting (changing) the amplitude of my bump.
What I am interested of here is the amplitude of this "bump" and the response time.
Many thanks!

サインインしてコメントする。

回答 (1 件)

Star Strider
Star Strider 2016 年 7 月 19 日

0 投票

Use the detrend function.

製品

タグ

質問済み:

2016 年 7 月 18 日

回答済み:

2016 年 7 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by