Interpolating/smoothing 8-bit data (As a caveat, I think this belongs on this stack site, but I'm not 100% sure.)
We have a time series that is physically sampled with only 8bit resolution, so we wind up with a "staircase" pattern, which in itself isn't an issue. The problem however, is that with any noise this flip-flops between the 2 states (as seen in the figure), and we really need a smoother signal.
I was wondering if there was any "standard" approach of doing this, or if anyone had any ideas. Currently we're using a Gaussian convolution filter, but that tends to insert a phase shift in the signal.
Thanks,
Aaron

 A: The shape of this signal makes it a candidate for Haar Wavelet Smoothing, where you decompose the signal int a series of Haar waveforms. It looks like you can effectively de-noise this signal by removing the high-frequency Haar components and keeping the low ones.
A: I think the simplest method would be moving average, by taking the mean of a group comprising $x$ points before and after each point:
https://en.wikipedia.org/wiki/Moving_average
You could also try more complex techniques like gaussian smoothing, which applies a gaussian distribution rather than a uniform one as above:
https://en.wikipedia.org/wiki/Gaussian_blur
Note: This is not the same as a gaussian convolution filter, which does give a phase shift:
https://en.wikipedia.org/wiki/Gaussian_filter
From the link: "Since the Fourier transform of a Gaussian is another Gaussian, applying a Gaussian blur has the effect of reducing the image's high-frequency components; a Gaussian blur is thus a low pass filter".
Incidentally, you shouldn't get any phase shift as long as your smoothing distribution (whether uniform or gaussian) is symmetric around each point.
A: I suggest non-linear filters, the median or the weighted median to start with.  It can remove impulse noises, and respect transitions more than linear filters. A fast C/C++ code is available.
If unsure about the size of the filter, it can be iterated, made adaptive, or even multiscale in a non-linear wavelet fashion.
[EDIT] I just discovered PWCTools - The piecewise constant toolbox:

Implementations of algorithms for noise removal from 1D piecewise
  constant signals, such as total variation and robust total variation
  denoising, bilateral filtering, K-means, mean shift and soft versions
  of the same, jump penalization, and iterated medians. It uses a range
  of solvers including interior-point optimization, adaptive step-size
  Euler integration and greedy knot placement. If you use this code,
  please cite:  M.A. Little, N.S. Jones (2011), Generalized methods and
  solvers for noise removal from piecewise constant signals: Parts I and
  II, Proceedings of the Royal Society A

which implements a quantity of methods. Total variation denoising could be worth looking at, and thee recent A Direct Algorithm for 1D Total Variation Denoising implements a C code, illustrated here:
