I've been looking at 2 different methods to acquire a known prn code in a CDMA signal. The first trys Xor prn code chip to I sign data. Then average the result over a time period to determine the data bit. I have not had reliable success with this method. The second which I am going to try performs a real multiply of a the code chip and the sign then adds or subtracts the I data magnitude value over a time span. Is one method known to be more reliable than the other? I'm typing on phone so I can't post any coding right now. If it would help I can update this question later. Thanks
CDMA signals typically have a pilot that is sent along with the data. This pilot is a known chip sequence that is transmitter over and over again. Receivers can use the pilot to lock onto the signal by correlating the received signal with the expected pilot.
The autocorrelation is typically done by FFT'ing the received signal, multiplying it by the FFT'ed expected pilot, and IFFT'ing the result. This is done both for computational efficiency and because the circular correlation that you get with FFT's is actually helpful in this case because the pilot is repeated. Thus you should be able to "catch" the pilot no matter which phase it starts at in your captured signal.
Once you have locked onto the pilot you know the signal's phase and it should be pretty straightforward at that point to despread the signal and recover the data, providing you know the data's spreading sequence.