Professional Documents
Culture Documents
sequences in a practical manner is outlined. That strategy was • The period of u is at most N = 2n-1, where n is the
coded in MatLab and in section III the corresponding number of cells in the shift register, or equivalently, the
implementation details are fully discussed. Then, in section degree of h(x).
IV we present a design example of a spread spectrum system • There are exactly N nonzero periodic sequences
using a Gold sequence of order five. Final conclusions and generated by h(x), and they are just N different phases of
remarks are given in section V. u; namely u, Tu, T2u, …, TN-1u.
• A sequence of period N is a maximum length sequence if
II. MATHEMATICAL BACKGROUND and only if it has the shift-and-add property, which can
We start our discussion with the following mathematical be formulated as follows. Given distinct integers i and j,
definitions. Let h(x ) = h0 x n + h1 x n−1 + ... + hn−1 x + hn denote 0 ≤ i, j < N, there is a unique integer k, distinct from i
a binary monic polynomial of degree n where h0=hn=1 and and j, such that 0≤k<N and: T i u ⊕ T j u = T k u .
the other hi’s can take values of 0 or 1. It is customary to In most practical applications, a binary sequence is actually
represent such polynomial as a binary transmitted as a sequence of positive and negative pulses of
vector h = (h0 , h1 ,..., hn ) , and to express that vector in octal unit amplitude. By convention, the waveform to be
notation. For example, the polynomials x 4 + x + 1 and transmitted is obtained by replacing each 1 of the original
binary sequence by a –1 and each 0 by a +1. We can map any
x 5 + x 2 + 1 are represented by the binary vectors 10011 and arbitrary {0, 1}-valued periodic sequence u, by using the
100101, respectively, and the octal notation for those function χ such that:
polynomials is 23 and 45, respectively.
A periodic binary sequence u is said to be a sequence χ(α) = (-1)α for α ∈ {0, 1}. (2)
generated by the binary polynomial h(x) defined above if for
all integers j: Notice that T i (χ (u )) = χ T i u and( )
h0 u j ⊕ h1u j −1 ⊕ h2 u j −2 ⊕ ... ⊕ hn u j −n = 0 (1) ∑ χ (u ) = χ (u ) + χ (u ) + ... + χ (u ) = N − 2hw(u)
0 1 N −1 (3)
A given polynomial h(x) is called primitive, if its Where hw(u) denotes the Hamming weight of u, and N is the
associated periodic sequence has the maximum theoretical period of the sequence u.
period of repetition given by N = 2n-1.
Having defined binary periodic sequences and their
From equation (1) it follows that the periodic sequence u associated generating polynomial, let us define now the
can be generated by an n-stage binary linear feedback shift important concept of periodic cross-correlation between
register which has a feedback tap connected to the i-th cell if sequences.
hi = 1, 0 < i < n as is shown in Fig. 1 [Glissic95, Viterbi95].
Notice that since hn = 1, there is always a connection for the Definition 1 For sequences x and y of period N, we define
nth cell. the periodic cross-correlation function by:
N −1
θ x , y (l ) = ∑ xn y n+l
Lineal Feedback Shift Register LFSR
(4)
n n-1 n-2 3 2 1
n =0
FF + FF + FF + FF + FF + FF
It is straightforward to verify that for each l∈Ζ,
AND AND AND AND AND AND θ x , y (l ) = θ x , y (l + N ) (5)
+ + + + + + Salida
n n-1 n-2 3 2 1 Also, we define the periodic auto-correlation function θx(l)
for the sequence x as θx,x(l).
Code Mask
Within the context of applications for spread-spectrum
Fig. 1 Realization of a maximum length sequence
communications we are interested in the problem of how to
A shift register can generate several different periodic find sets of periodic pseudo-random sequences with the
sequences, one of which is the all-zeroes sequence. Of following two properties:
course, only the nonzero sequences are of interest. The
following properties of shift register periodic sequences are • For each sequence x = xn in the set, |θx,x(l)| is as small as
well known and are stated here for convenience: possible for 1≤ l ≤ N-1;
• For each pair of sequences x = xn and y = yn, |θx,y(l)| is as
• If u is a periodic sequence generated by h(x), then for all small as possible for all l.
integers i, Tiu is also a sequence generated by h(x);
where the operator Ti shifts the periodic sequence u by i Sequences that exhibit the above two properties and the
places. Hence, any shift register can generate different design problem of how to implement them efficiently in
phases of the same periodic sequence. hardware are the main subject of this paper. In the remaining
• If u and v are generated by h(x), then so is u⊕v. part of this section, we will derive the theoretically best
3 F. Rodríguez-Henríquez, J.M. Rocha-Pérez, F. Amaro-Sánchez and F. Sandoval-Ibarra
results that one can possibly expect from such a set of by f(x) = h(x)g(x) then, from the above properties of m-
periodic sequences. sequences, we get that either:
Applying the definition given in (2) to the cross- y = T i u;
correlation formula of equation (4) we obtain:
or y = T j v; (9)
∆ N −1
θ u ,v (l )= θ χ (u ),χ (v ) (l ) = ∑ χ (ui )χ (vi +l ) y = T u ⊕ T v.
i j
or
i =0
N −1 Where 0 ≤ i, j ≤ N-1. From equation (9) it follows that y must
= ∑ (− 1) (− 1)
i =0
ui vi + l
be some phase of one of the sequences in the set G(u, v)
(6) defined as,
N −1
= ∑ (− 1)u ⊕v
i i +l
{ }
G (u , v ) ≡ u , v, u ⊕ v, u ⊕ Tv, u ⊕ T 2 v,..., u ⊕ T N −1v (10)
i =0
N −1 Note that G(u, v) contains a total of N =2 = 2n + 1 sequences
= ∑ χ (ui ⊕ vi+l )
i =0
of period N. Every single pair of sequences that belongs to
the set G(u, v), has the property that its cross-correlation
Plugging the result of equation (3) into the last equation, we function can only take one of the three different values
obtain: defined for the preferred pair of sequences: -1, -t(n), and
θ u ,v (l ) = N − 2hw(u ⊕ T l v )
t(n)–2.
(7)
Therefore, in order to construct a Gold-sequence set for a
Let us now, define t(n) as given order n, we can use the following methodology:
⎢n + 2⎥ 1) Find a preferred pair of primitive polynomials h(x) and
⎢ ⎥
t ( n) = 1 + 2 ⎣ 2 ⎦
, (8) g(x) of order n.
2) By using the shift-register architecture, implement the
Where ⎣α ⎦ denotes the integer part of the real number
sequences u and v corresponding to the polynomials h(x)
α. Then with n≠ 0 mod 4, there always exist pairs of and g(x), respectively.
sequences with three valued cross-correlation functions,
where the three values are: -1, -t(n), and t(n)–2 [Prasad96, 3) Use the N different phases of either u or v, in order to
Ziemer92, Simon94]. A cross-correlation function taking find each of the N+2 Gold sequences as they are given in
these and only these values is called preferred three-valued equation (10).
cross-correlation function and the corresponding pair of In the next section we explain how we can obtain Gold
polynomials associated with it, is called a preferred pair of sequences based on the above three-step strategy.
polynomials.
Input: Two monic polynomials of degree n P1, P2
In the next subsection we will show how to use a preferred Output: Cross-correlation plot.
pair of polynomials to generate a set of pseudo-random function o = crossc(poly1, poly2)
sequences with theoretical-minimum cross-correlation values. % 0 Initialization
figure(2); crossc = [];
A. Gold Sequences % 1. Generating sequences u, v from the gen. polynomials.
Gold sequences form an important class of periodic u = pn(poly1);
sequences, which provide larger sets of sequences with good v = pn(poly2);
periodic cross-correlation. A set of Gold sequences of period % 2. Finding the order&length of the generator polynomials.
N = 2n –1, consists of N+2 sequences for which we have ord = length(oct2bin(poly1));
excellent cross-correlation properties. A set of Gold N = (2^(ord-1) - 1)*2;
sequences can be constructed from appropriately selected % 3. Obtaining the periodic Cross-correlation spectrum
maximum length sequences as described below. % if poly1 and poly2 form a preferred pair of m sequences
% then, its cross-correlation can only take three values: 1, -%
Suppose a shift register polynomial f(x) factors into
t(n) and t(n) - 2, where t(n) = 1+ 2^|(n+2)/2|
h(x)g(x) where h(x) and g(x) have no factors in common.
for i = 0: N-1
Then the set of all sequences generated by f(x) is just the 8set
% 4 Crosscorralating with shift i.
of all sequences of the form a ⊕ b where a is some
crossc = [crossc sum(summ(u, [v(1+i: N) v(1:i)]))];
sequence generated by h(x), b is some sequence generated by
end
g(x), and where both, a and b can be either nonzero or zero
% 5 Plotting.
sequences.
Figure; stem(crossc);
Assuming now that h(x) and g(x) are two preferred pair of grid; title('Crosscorrelation function');
primitive polynomials of degree n and that each one of them xlabel('Shift (from 0 to N-1)'); ylabel('Teta');
generates the m-sequences u and v of maximum period N =
2n-1, respectively. If y denotes a nonzero sequence generated
F. Rodríguez-Henríquez, J.M. Rocha-Pérez, F. Amaro-Sánchez y F. Sandoval-Ibarra 4
Spreading Despreading
the preferred cross-correlation characteristic, we can use the Code Code
Transmitter Channel
Receiver
For n = 7, the algorithm in Fig. 2 finds (among others) the
Fig. 4 Spread Spectrum concept
following candidates as a preferred pair of polynomials (all
of them in octal representation): 221 and 345; 211and 217; In the transmitter side of the system shown in Fig. 4, a
211 and 247; 211 and 235; 301and 313, etc. On the other random binary message m, with bandwidth B is spread into a
hand, one can check that the pair of primitive polynomials: bandwidth PG times greater through the use of a
211 and 221; 313 and 323, do not form a preferred pair of pseudorandom PN sequence c. PG is called the processing
polynomials. Those results completely agree with the gain. We also assume that the distortion introduced by the
diagram of maximum connected sets described in channel can be modeled as an additive white Gaussian noise,
[Sarwate80]. AWGN composed of two main components: The white noise
intrinsic to the channel and, the noise contribution of all the
Fig. 3 shows a code that stores all the Gold-sequences other users sharing the channel.
generated by a preferred pair of polynomials. The output
matrix has a size of N+2 rows and N-1 columns, and it In the receiver side, a process of de-spreading is carried
contains all the N+2 gold sequences associated with the out by multiplying the received signal with an exact copy of
preferred pair, each of them having a total length of N-1 the PN sequence used during transmission. The received
(where N = 2n-1, and where n is the given order of the signal (before de-spreading) looks as shown in Figure 5.
primitive polynomials). However, after the process of de-spreading is performed, the
system is able to recover the original information, as is
Input: Two preferred monic polys of degree n P1, P2 shown in Fig. 6, where both, the original and the recovered
Output: Associated Gold Sequences signals can be compared.
function seq_m = gold(poly1, poly2) It is apparent that for this kind of systems the generation
% Each row of the seq_m matrix, contains one of the 2^n +1 of high quality pseudorandom m-sequences is one of the
% Gold sequences generated by the given preferred pair of crucial design issues in order to obtain a correct performance
% polynomials poly1 and poly2. of the communications system.
% 0 Initialization 8.00
figure;
% 1. Generating sequences u, v from the gen. polynomials.
u = pn(poly1); 4.00
v = pn(poly2);
% 2. Finding the order&length of the generator polynomials.
0.00
ord = length(oct2bin(poly1));
N = (2^(ord-1) - 1)*2;
% 3. Generation of Gold Sequences. -4.00
seq_m(1,:) = u;
seq_m(2,:) = v;
for i = 1: N -8.00
g(D)=45 +
1.00
0.00
g'(D)=75
Cross-correlation Funtion
8
Cross
-2.00 Correlation 6
0.00 20.00 40.00 60.00 80.00 100.00
0
As it was explained in section II, Gold sequences are a
-2
special class of m-sequences that happen to be particularly
suitable for spread spectrum applications. An attractive -4
having a three-valued cross-correlation function among them Fig. 8 Cross-correlation function for Gold sequences of order
[Prasad96, Ziemer92, and Simon94]. For example, for n=10, 5.
using equation (8), we have t(10) = 26+1=65 and the only
three values for the cross-correlation function of the preferred
Gold sequences will be: {-1, -65, 63}. V. CONCLUSIONS
For spread spectrum applications, we can choose the
The most important properties of m-sequences, Gold
length of the sequence according to the desired capacity of
sequences and their application to spread spectrum have been
the channel (in terms of the number of users). Since the
presented. Gold-sequence implementation requires finding a
spread spectrum processing gain PG is directly proportional
preferred pair of m-sequences which is in general a difficult
to the length of the m-sequences, a more common criterion
task. In this paper an efficient and practical methodology has
used frequently in practice is to select first the gain (in dB) in
been introduced together with its corresponding Matlab
order to comply with some given specification in the
implementation. By following our methodology and through
reception side of the communication channel [Jen-Shi97].
the use of our Matlab-coded algorithms we can find and
Once that the length of the sequences has been fixed we
generate preferred m-sequences and therefore we can
need to select a pair of preferred sequences. A different initial
construct Gold sequences of any order. For illustration
phase of the sequence can be assigned to each user in the
purposes a specific design example for Golden sequences of
system. In this way, each user has a code that identifies
order n=5 was presented, although the program is able to find
him/her uniquely.
preferred pairs of any order.
As an illustrative example, let n=5 be the required order
for a set of Gold sequences. In order to find a preferred pair
V. REFERENCES
of m-sequences we fed the primitives polynomials in octal
[Flikkema97] Flikkema, Paul G., Spread Spectrum
notation to the Matlab program shown in Fig. 2. The program
Techniques for Wireless Communication IEEE Signal
gives information about which polynomials form preferred
Processing Magazine, May 1997.
pairs. For the case in hand, the program found the pair 45 and
[Ziemer92] Ziemer Rodger E., Peterson Roger L.,
75 as one of the preferred pairs. With this information we can
Introduction to Digital Communication, MacMillan
construct the circuit of Figure 7.
Publishing Company, 1992.
It is very important to verify that the circuit indeed
[Glisic95] Glisic Savo G., Leppanen Pentti A., Code
accomplishes the cross-correlation property defined by
Division Multiple Access, Kluwer Academic Publishers, 1995
equation (8). The plot of the corresponding cross-correlation
[Pickholtz82] Pickholtz, Schilling, Laurence, Milstein,
function is obtained with the Matlab code of Fig. 2. Notice
Theory of Spread Spectrum Communications - A Tutorial,
that for this case n=5, hence t(n) = {-1, -9, 7}. As we can see
IEEE Trans. on Comm, May 1982.
in Fig. 8, the cross-correlation function values obtained
[Viterbi95] Viterbi Andrew J., CDMA Principles of
correspond to the predicted ones.
Spread Spectrum Communication, Addison-Wesley
Publishing Company, 1995
F. Rodríguez-Henríquez, J.M. Rocha-Pérez, F. Amaro-Sánchez y F. Sandoval-Ibarra 6