# The meaning of correlating “Time Aligned” pseudo-random or walsh code sequences

Correlation is from a mathematical point of view a shift in time domain +multiplication + summation operation

I thought that if 2 codes are "time aligned" then correlation reduces to a dot product multiplication and summation, so no shift.

So suppose I have a sequence -1 1 1 -1, then if it is time aligned with itself , the result of correlation or dot product +summation is 4 and nothing else. I have to say that I acquired this understanding from looking at a CDMA receiver where I always see a multiplication when signal are being despread

I guess my interpretation or understanding of the term "Time Aligned" when it comes to correlation is not correct, right?

• I thought that if 2 codes are "time aligned" then correlation reduces to a dot product multiplication and summation, so no shift. No. What you're thinking of is a correlation coefficient. Correlation is still a function of shift. – Marcus Müller Nov 20 '18 at 18:51
• What I meant is cross correlation, and i wasn't sure what is done in an actual DSSS receiver – Hatem Tawfik Nov 20 '18 at 19:24
• a correlation is a function of the shift. That's how it is. You can certainly say "assuming that we are synchronized, it's sufficient to just calculate the correlation coefficient to detect a transmission in a DSSS system". – Marcus Müller Nov 20 '18 at 20:18
• Just to be clear, "Correlation" is simply the dot product (without any normalization scaling). The "Correlation Function" is the correlation versus time offset. In an actual DSSS receiver we simply multiply and accumulate to perform the correlation (which is a dot product). We vary the delay to determine time synchronization, and often we are switching back and forth between two delays and subtract the result (early minus late) to maintain synchronization in a tracking loop. – Dan Boschen Nov 21 '18 at 12:20

## 1 Answer

Cross-correlation $$r[l]$$ between two sequences $$x[n]$$ and $$y[n]$$ is defined as:

$$r[l] = \sum_n x[n]y[n+l]$$.

You can say that $$x[n]$$ and $$y[n]$$ are "time-aligned" at lag $$l^\star = \arg \max_l r[l]$$. It is possible that the time-alignment is achieved at $$l^\star=0$$, which is the case you described above. However, in a communication channel with multipath delays, the alignment may happen at a lag $$l^\star \neq 0$$. Since you referenced DSSS receivers, I'd encourage you to read about a rake receiver and how signals from different fingers are combined.