I'm very new to signal processing, and have been struggling this far. I've a rather messy signal measuring respiration using some chest bands and would like to focus solely on the inspiratory half of the data - ie. set the beginning of each inspiration to zero while maintaining the inspiratory amplitude of each breath.
I've attached an example (upslope is inspiration, downslope is expiraion), and have tried various ways of detecting the change in slope indicating the beginning and end of inspiration but keep getting tripped up by small deviations/noise in the signal. Any help would be appreciated.
Edit: https://docs.google.com/open?id=0B84oZTKp4RZ3LS1mdTBCLTJRdEU
Edit: pictures, hopefully better description:
When everything's going smoothly the it should be recording roughly 10-20breaths per minute.

But when the patient coughs/moves it looks something like:

Since I'm mostly interested in the magnitude of each breath, my thinking is that resetting each the start of each breath to zero is an easy (so to speak) way to rid of that upward drift after a cough.
In the worst cases I lose the respiratory signal all together. This I'd like to discard and pick up any redeemable signal as soon as possible.

Please let me know if there's anything else I can provide for an answer!
Thanks muchly.