Deconvolution Using Response to an Heavy Side
If we can assume no noise (Or the SNR is very high) you can get the response by applying the inverse filter in frequency domain.

Lets say $ y [n] $ are the signal samples.
Given $ x [n] $ the samples of the ideal signal you can apply on both of them the DFT to get $ Y [k] $ and $ X [k] $.

The response is given by the Inverse DFT of the division $ \frac{Y[k]}{X[k]} $.

If there's some noise you need to regulate the result.
Easy choice would be the Wiener Filter or more specifically Wiener Deconvolution.