how to remove drift on a signal without the detrend function

3 vues (au cours des 30 derniers jours)
Rebecca Ellis
Rebecca Ellis le 1 Oct 2018
Commenté : Rebecca Ellis le 2 Oct 2018
I have signal which runs for 30 hours measuring 64 times a second. As attached. Toward the end of the signal the sensor drifts. I have tried:
sdata = oxygen_unisense.data;
oxygen_unisense.detrend = detrend(sdata(3.715958429982246e+06:end));
but this leads to the signal averaging around zero.
I would like to put the straighten the signal highlighted (adjusting for drift)and put it back into the signal to original signal so that it lines up again with other measurements taken at exactly the same time. So the data is the same length again.
https://www.dropbox.com/s/s8iafhoiw03t54q/oxygen_unisense.mat?dl=0
  1 commentaire
Rebecca Ellis
Rebecca Ellis le 2 Oct 2018
lf = polyfit(oxygen_unisense.time(3715958.429982246:end),oxygen_unisense.data(3715958.429982246:end),1);
plot(oxygen_unisense.time(3715958.429982246:end),oxygen_unisense.time(3715958.429982246:end)*lf(1) + lf(2),'--k');
plot(oxygen_unisense.time(3715958.429982246:end),oxygen_unisense.time(3715958.429982246:end)*-lf(1) + oxygen_unisense.data(3715958.429982246:end))
trying this aswell

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by