Hi
I agree with tzushky, original signal contains Low frequency content which caused the drift.
this is the usual case when processing Biomedical signals & low freq. content is due to "MOTION ARTIFACT".
first of all use a LP filter to omit DC of your signal.
the result will have zero average.figure above shows a zero-DC signal :
since your data is periodic with only 1 local minimum in each period (I refer to your figure)
and with approximately constant period ~ 14 breaths/min.
therefore (after LP filtering) you can easily drift your signal in each period
with amount of minimum of that interval.
this should solve your problem ,but
if you are still not staisfied ,I have a general algorithm .so if you wanted to go further you better tell me.
hope it helped
Armin