An improvement for a method and system for tracking a spreading code, used in
a code division multiple access (CDMA) system. An input signal has spread-spectrum
modulation. The spreading code embedded in the spread-spectrum modulation has a
plurality of chips. The input signal is sampled, and half-chip offset samples are
formed from the sampled input signal. An even set of the half-chip offset samples
are grouped into an early set of samples, and an odd set of the half-chip offset
samples are grouped into a late set of samples. Each early set of samples is multiplied
by the spreading code c(n+1), c(n+2), . . . , c(n+L), to generate a first plurality
of products. L is approximately equal to the number of chips of delay between the
earliest and latest multipath signals. A first plurality of sums and magnitudes
are computed from the first plurality of products. The first plurality of magnitudes
are summed to generate an early signal-energy value. Each late set of samples is
multiplied by the spreading-code c(n-1), c(n-2), . . . , c(n-L), thereby generating
a second plurality of products. A second plurality of sums and magnitudes are computed
from the second plurality of products. The second plurality of magnitudes are summed
to generate a late signal-energy value. A difference is calculated between the
early signal-energy value and the late signal-energy value, thereby producing an
error signal.