# How to determine where to sample for demodulation of BPSK signals?

I have a simple BPSK demodulator. Very simply, the signal comes in and is split into two branches, one for I and one for Q.

1. The I branch is mixed with a sin wave of the carrier, and the Q branch mixed with the cosine wave of the carrier.
2. Then, each of the outputs is convolved with a matched filter, (in this case a root-raised-cosine, which initially pulse shaped my transmitted bits).
3. Now, if I combine both outputs and take the magnitude of both of them (I^2 + Q^2), I get the envelope.
4. From here, I look for peaks, and choose their indicies.
5. I then use those same indicies that I got from (4), and sample my I and Q at those same indicies. Now I have complex softbit values, and am able to correct for any phase or frequency offsets, and can make hard decisions from there. (I have the luxury of post processing btw).

This technique worked well with high to medium SNR. The problem is that with lower SNR (and maybe multipath), I do not know how to perform bullet (4). The problem is that instead of one peak in the envelopes corresponding to one bit, I now have multiple peaks, and 'peak picking' wont work because there are so many to choose from... how is this problem mitigated? This seems to be a bottleneck because if I cannot tell where my 'bit' is, I cannot move forward. Any thoughts?

Any help is appreciated, math is good, although I would ask the answers be more pesudo-code /concept oriented in advance. Thanks!

Edit: Thanks to feedback from Dilip, I should also add that I can clearly see 'energy' in the envelope when there is a signal and there isnt a signal. (ie, before my signal arrived), so this leads me to believe that I should be able to sync/demod and that it isnt an SNR issue solely...

• @DilipSarwate Yes in this case I do know my Tbps exactly. (So yes, the receiver will know the exact spacing between my bits) - but how to attain that first bit index?... BTW, not sure what its worth, but I can clearly see 'energy' in the envelope when there is a signal and there isnt a signal - and this leads me to believe that my SNR is not so bad that I shouldnt be able to sync/demod... (Thanks for the tag info I will try and add some more). – Spacey Oct 26 '11 at 17:05
• @DilipSarwate Hmm...I agree with you on that technique - what I am not clear about is where/how to fit my one-bits-worth-window such that I can then perform the technique you are talking about. Do you see my issue? Just to make sure I understand you correctly: Let us say there are 10 samples/bit in the envelope. Ok, so are you saying take the whole envelope, break it up into a 10 sample chunks, and average all those together to find where the peak ought to be? – Spacey Oct 26 '11 at 17:23
• Synchronization can be a very complex topic. Could you put a number on the values of SNR that you're testing with? What is "high", "medium", and "low"? – Jason R Oct 26 '11 at 17:33
• @DilipSarwate Ok, we are saying the same thing. Now, I understand that over all this averaging, we are betting that we can attain the optimal sample index because it is being averaged out from noise. But in the presence of multipath, can we count on such averaging to work? Wouldnt the optimal peak 'slip' over time? I suppose thats why you would have to re-perform this technique every so often... – Spacey Oct 26 '11 at 18:07
• @JasonR I cant get you precise SNR figures at right now, but I can try to get them soon. (Even then, since I cannot bit-lock would you like a measure based on the envelope somehow?...) For now, qualitatively, I can say that in my high-SNR case, I can clearly see one peak per bit interval in my envelopes unambiguously, but in my other lower SNR cases (and possibly with multipath) I can see the envelope have many peaks during one bit duration. (That being said, I can clearly discriminate when my signal starts looking at the envelope). – Spacey Oct 26 '11 at 18:13

I have done something similar to this in MATLAB. In my cause, I used an Early/Late Gate clock recovery method to get an estimate of the offset between transmit and receive symbol timing. This method uses 3 samples per symbol - one at the optimal sample time, one that is 1 sample delayed and 1 that is one sample advanced. This works well for on/off keying signals, since there is no negative portion of the signal, but the methods below I think will work better for bipolar signals.

Another method is the Muller and Mueller Algorithm, which uses 1 sample per symbol. This uses the equation $e_n = (\widehat{y_n}y_{n-1}) - (y_n\widehat{y}_{n-1})$, where $e_n$ is the error , $y_{n-1}$ and $y_{n}$ are the previous and current symbol samples, and $\widehat{y_n}$ and $\widehat{y}_{n-1}$ are the decision outputs (-1 or +1 in your case). M&M requires that the carrier is recovered first.

A third algorithm, which is very similar to the one above, is the Gardner algorithm. In this algorithm, the error signal is $e_n = (y_n - y_{n-T})y_{n-T/2}$, where $y_{n-T}$ is the sample one symbol in the past, and $y_{n-T/2}$ is half a symbol in the past. This requires 2 samples per symbol, but is not sensitive to the carrier.

The M&M detector is looking at the peaks, while the Gardner method is looking at the peak and zero crossing to get timing estimates.

In all cases, you'll take the error estimate, feed it into a loop filter whose output is then used to advance or retard the symbol clock for the next timing estimate. The loop filter can be thought of as either a low-pass filter, a smoothing filter or simply as weighting older estimates less than newer ones. The loop filter controls a) how fast the timing converges and b) how much noise affects the estimates.

Another option is to use an equalizer which will then remove timing delay from the signal. This can also help for very noisy signals I believe.