# Most reliable way to decode PAM2 signal with unknown signal levels?

I assume this is pretty much a standard problem. I have a PAM2 signal that comes from a complex envelope (i.e., it is not zero-centered) and is heavily imposed by noise. This shows 20 different examples of my signal:

What is the most reliable approach to convert these to $$00000001000100000101\cdots$$?

The standard approach seems to be to subtract the mean value. However, this is only reliable when ones and zeros are balanced (not the case for me).

Right now, I subtract half of the maximum value and add half of the minimum value. If this value is greater than zero, I interpret it as one, otherwise as zero. This gives decent (but I feel still sub-optimal) results and I wonder what is the most reliable way to do this.

• How many symbols can you buffer before you can make a decision, and how unbalanced in terms of #1s and 0s do you expect it to be? Is the noise expected to be gaussian? Stationary? AGC, histogram, k-means clustering, em-gmm, ... Commented Jun 12, 2020 at 6:37
• It's a burst and has a short duration (here 32 bits, maybe 512 bits). I buffer all of them. So far, no prior knowledge on the 0/1 balance. Noise expected Rayleigh I guess (I+Q are Gaussian individually)
– divB
Commented Jun 12, 2020 at 16:18
• Noise for 0 is Rayleigh and Noise for 1 is Ricean assuming you are taking the magnitude of complex I and Q samples with Gaussian noise individually. Commented Jun 12, 2020 at 18:14