How can I shift this signal to it's midpoint in order to decode it I'm wondering if there's a simple way to decode this pulse signal as I'm reading it in. I'm thinking the simplest way to decode this is if i can shift the whole signal down so that it's centered around 0. Then if my pulse goes above 0, I know it's a 1 and it'f it's below zero, i know it's a zero. Figures below to see what i'm trying to do. Please note that my sampling frequnecy $Fs = 8Hz$, my pulse width is between 1-2 seconds, and come in pairs of 2. these pairs are spaced about 20 seconds apart. There is also a 3 pulse header which denotes the start of the message, with the first pulse being wider than the other pulses.





if I know the peak value of the pulses, then this is obviously just taking my signal and subtracting half of the peak, $d(t) = r(t) - peak/2$. The problem is this peak amplitude is going to vary, as is the noise level. If i try to just subtract a running average, then the noise part of my signal will be centered around 0 as well, which then my decision won't be a simple above/below zero decision. I've plotted subtracting the mean in figure 3 below. My signal is $d(t) = r(t) - runAvg(past 4 samples)$

It seems like there should be an easy way to filter this, either in the time or frequency domain, I'm just not thinking of it. Thanks for your time!
You don't need to remove the DC part of your signal (i.e. "to center" it). In terms of decoding performance, there is no gain. Your signal looks like a typical ASK. Applying a simple integrator and sampling at $t=T$, where $T$ is the pulse duration, would do the job.

You only need to define a threshold, which usually corresponds to $AT/2$, where $A$ is the expected pulse amplitude.

Edit: forgot to mention the fact that you need to determine when to sample the output of the integrator. A symbol-level synchroniser is required for that.