I want to design a receiver for a spread spectrum system. I know that two Pseudo sequence with two different length must be used in the receiver, but I can' t manage this with common receivers(such as integrate and dump and so on...) , can this be done? Regards.

• No, you don't have to use two different sequences in the receiver. You might be thinking of the generation of Gold codes? But yes, these can be done, quite ostensibly: Gold codes are actually used. – Marcus Müller Dec 16 '19 at 10:45
• @ Marcus Müller but in my situation, I have two pseudo sequence with two different length and they are m-sequence, and I don't come to mind any solution. – Velma Benedict Dec 16 '19 at 11:37
• Can you provide more details on the specific waveform implementation? How is each data symbol created using the two sequences? – Dan Boschen Dec 16 '19 at 12:40
• @Dan Boschen I updated a picture in my question. I have two Pseudo code with length 63 and 31 respectively. One data symbol spreads using 63 and then two sequential data symbol spreads with 31 and this procedure continues. – Velma Benedict Dec 16 '19 at 13:09
• Interesting - Do you know why this is being done? Same chip rate for both? – Dan Boschen Dec 16 '19 at 15:17

prn_code= 512;%sampled at Chip2x
early = rx_sig.*prn_code(+1 circular shift);
late = rx_sig.*prn_code(+1 circular shift);
if (early-late)>1
prn_code= prn_code(-1 circular shift )
else
prn_code= prn_code(+1 circular shift )
end
prompt = rx_sig.* prn_code;


Am I right? @Dan Boschen

• Can you delete your other answer and put that as a comment under mine (since it really isn’t an answer)? This should work as part of the code tracking implementation but note that you will be toggling back and forth 1/2 a chip on every update so wouldn’t provide for best demodulation (when you are 1/2 a chip off the signal level is -6 dB). Consider using a Code NCO that generates the chip clock that is used to generate the sequences and a control loop design to drive the early - late error to zero (the error would go into an integrating loop filter whose output would .... – Dan Boschen Dec 17 '19 at 18:53
• control the frequency control word of the NCO appropriately causing it to speed up when it needs to advance or slow down when it needs to retard. – Dan Boschen Dec 17 '19 at 18:55
• @VelmaBenedict I am not sure I follow what you are asking and this thread is getting long (can you post that as a separate question and detail the early late problem you are having?) – Dan Boschen Dec 18 '19 at 12:37
• @ Dan Boschen Only say me who you use separated I and Q correlator. – Velma Benedict Dec 18 '19 at 15:02

Just despread the same way with two different integrate and dump times for your two symbol types with appropriate blanking on each between longer and shorter code sequence periods.

I would be tempted to do all the acquisition and tracking on the longer symbol and then simply despread the shorter symbols using the synchronization from the longer one— with that approach envision a receiver for the just the longer sequence with 62 chip gaps between each symbol.

Alternatively if each code repeats at the same location in each symbol, given the relatively short sequences, a sliding complex correlator using I and Q FIR filters with the sequence as the coefficients (in reverse order) using two samples per chip would be a very simple approach —- the complex I and Q output of the filter would have a spike in time after every alignment with those symbols (0 or 180 degrees once aligned depending on the data symbol and given I and Q would have phase to provide for carrier recovery). Detect the spike with a threshold detector on the magnitude for acquisition, track the complex peak for carrier tracking and track the two samples on either side of the peak for early-late timing tracking. The peak sample will give you the same performance as an integrate and dump of the multiplication of the received sequence with the output of a code generator but given your peculiar waveform structure this may be a lot simpler.

Once all timing is established, a single 31 tap FIR filter on I can simply demodulate the other two symbols.

Summarizing this FIR approach:

One 126 tap FIR filter on I for carrier and timing recovery/tracking and demod of 63 chip symbols.

One 126 tap FIR filter on Q for carrier and timing recovery/tracking.

One 31 tap FIR filter on I for demod of the 31 chip symbols.

As @WilliamHa points out in the comments, this approach will only work if the same code sequence appears in each symbol, starting at the same location each time (beyond being inverted to designate a "1" or "0" data bit), but will not work if the code generators run continuously causing the code starting location to shift by one sample at the start of each longer sequence, and at the start of the pair of shorter sequences, due to the relationship between the two codes. In this case I would approach it using continuously running correlators where the outputs are blanked during the other symbols, using the longer code for tracking and carrier recovery and using the synchronized clock from that to demodulate the shorter codes. Similar to the FIR filter filter approach, there would be 6 correlators for the longer code: 2 for Early (I and Q), 2 for prompt (I and Q) and 2 for late (I and Q). Each of these should be running at at least 2 samples per chip. Only one I correlator is needed for the shorter codes at one sample per chip as the carrier and time reference is established from the longer code. The added complexity will be in timing the integrate and dump outputs of the correlator such that they are blanked during the shorter code sequences, but this would be determined in the timing recover process such that accumulation starts at the estimated start of the longer code and dumps after 63 chips, and then waits 62 chips before accumulating again. This structure assumes the code generators run continuously with the same chip rate, and the correlator structure is done by multiplying the code generator output with the received signal after having been down-converted to baseband. With this approach Carrier Recovery is done by monitoring the rotation of the I and Q prompt symbols of the longer code; a carrier error is determined using a complex conjugate multiply of one symbol with the previous and then multiplying that time I prompt to strip the +1/-1 data. Clock Recovery can be done by monitoring the magnitude of the Early and Late outputs of the longer code, where clock error = Early-Late. Acquistion is done by setting a threshold on the magnitude of the longer code.

Using the cross correlation property of the FFT, all the correlators could be done with FFT's as well, including one-shot joint frequency and delay acquisition if processing allows. I explain that approach further in this post: GPS signal acquisition

• Excellent, I would like implement integrate and dump using intdmp matlab function, but It doesn't look right, what method you suggest? – Velma Benedict Dec 16 '19 at 16:42
• What I described - using filter(a,1,signal) in Matlab where a is the reverse order of the code sequence. Set a threshold using “probability of false detection vs probability of false alarm” techniques tracking signal peaks when aligned versus average noise level when not aligned. – Dan Boschen Dec 16 '19 at 16:53
• that is very good , I can do acquistion but I can't do early and late properly and I faced with many error.... – Velma Benedict Dec 17 '19 at 16:27
• Use two samples per chip and offset the early and late correlators by 1/2 a chip – Dan Boschen Dec 17 '19 at 16:29
• I or someone else here can likely help you if you do what I just recommended in my last comment. Happy to help! Post a new question specific to your problem with the early late and prompt correlator. Give specific details of that problem and helpful if you can narrow it down to the simplest case, show what you tried and what is wrong. – Dan Boschen Dec 18 '19 at 12:06