I am generating a preamble with a sequence of [1 -1 1 -1 1 -1....] and spread with a barker-11 sequence. Now, the transmitted signal becomes [B(Barker), -B(Inverse of Barker), B, -B,....]. In channel, there is a random phase added to signal. In order to estimate the phase, First, I am doing the cross-correlation received signal with known barker sequence. When the peak value, I know it is barker sequence, I removed the symbol phases according to the barker sequence, now only random phase will present on the symbols.
However, I am also getting the peak value when it is correlated with '-B', then it inherently introducing 180 degree phase offset. How to avoid this problem??
Cross correlation I am doing by following:
if barker sequence [1 0 1 1 0 1 1 1 ....], and received symbols are complex,[r1 r2 r3 r4 r5 ....].
Corr_Real = real(r1) - real(r2) + real(r3) + real(r4) - real(r5) +......
Corr_Imag = imag(r1) - imag(r2) + imag(r3) + imag(r4) - imag(r5) +......
Correlation Index = Corr_Real^2 + Corr_Imag^2.
Please tell me if any other way to do.