working papers T h eD aV i n c iGalileo Code and Others

Guenter W. Hein, Jose-Angel Avila-Rodriguez, Stefan Wallner

GNSSsignals might fairly be characterized as an enigma wrapped inside a conundrum. M orethan any others, two factors givethe signals this quality: techniques and their code structure. T hefirst hides the signals in a “cellar” belowthe thermal floor of the R Fspectrum; the second disperses them into a long and apparently random sequence of digits.T headvent of E urope’sGalileo system and introduction of new G PSsignals stimulated a re-examination of the subject ofcodes, buttressed by advances in electronics that allowed new approaches to implementing codes in a GNSS receiver. Thiscolumn explores the growing categories of codes, their production, and the qualities that make them suitable for use in GNSSsystems. A longthe way, we take a brief excursion to discover the surprising genesis of spread spectrum radio in the collaboration of a glamorous actress and an avant-garde pianist.

odes are a fundamental element in which are codes optimized in a highly ate pseudorandom codes, giving special any code division multiple access multidimensional space to make them attention to those code structures that (CDMA) system such as GPS and look as random as possible. GPS and Galileo will be implementing Galileo, because these codes are But Galileo is not alone in bringing in the near future. theC tool that enables a GNSS receiver to new concepts into the world of GNSS. distinguish one satellite from another. In Modernized GPS signals also use new Spread Spectrum spite of their great importance, no great structures of codes based on so-called Communications innovations have been made in the world Legendre sequences, which will be applied Spread spectrum radio communica- of satellite navigation in this area — not for the very first time in navigation. tions stem from the work of Hollywood since GPS used the Gold codes for the Given the great importance that actress Hedy Lamarr and the pianist first time in its L1 C/A signal introduced codes play in any GNSS system that George Antheil who described in 1941 nearly 30 years ago. relies on CDMA and more generally, on a secure radio link to control torpedos With GIOVE-A, however, the first spread spectrum (SS) communications, and received for that U.S. patent number Galileo test satellite is now in space. And, SS techniques will be an important focus 2,292,387. (See the sidebar, “Player Pia- together with new signals and new tech- of this paper. This column, therefore, will nos, Sex Appeal, and Patent No. 2, 292, nologies, new code concepts developed begin by discussing various techniques 387” that begins on page 64.) Although in recent years will appear in Galileo that rely on codes and the history behind the idea was not taken seriously at the transmissions. Galileo will broadcast for them. Then we will concentrate on the beginning and was even forgotten, the the first time so-called random codes, many possibilities that exist to gener- scientific community rediscovered it in

62 InsideGNSS september 2006 www.insidegnss.com 1957 at the Sylvania Electronic Systems or roughly, Division. Unspreaded Today, spread spectrum radio has signal Processing gain become one of the most important mod- which can also be expressed as ulation techniques, covering completely different applications ranging from 3G . This last expression says that to mobile telecommunications, W-LAN, and to satellite positioning send an error-free information for a Spreaded systems such as GPS and Galileo. given noise-to-signal ratio in a channel, signal In spread spectrum communications we only need to perform the fundamen- Noise floor a higher-frequency signal is injected tal SS signal-spreading operation: into a baseband signal bandwidth. This increase the transmitted bandwidth. results in the energy used in transmit- FIGURE1 Spread Spectrum despreading opera - ting the information of the baseband Not So Simple t i o n . T h e d e s i r e d s i g n a l ( b l u e ) i s b e l o w t h e n o i s e fl o o r ( g r e e n ) b u t a f t e r c o r r e l a t ion signal being spread over a wider band- The SS principle seems simple and evi- thereceiver, it unspreads (red) over the noise width as shown in Figure 1. Typically, the dent, but its implementation is complex. floor making detection possible.T he ratio SS power level drops below the RF noise In order to accomplish this objective, betweenthe unspread signal and the spread signal is the processing gain. floor, which makes the SS signal invis- different SS techniques are available, ible for unauthorized users. The ratio (in but they all have decibels) between the spread baseband one thing in com- HPA Data and the original signal is called process- mon: they perform DSSS Antenna ing gain (see Figure 1). Typical SS pro- the spreading and (Direct Sequence) cessing gains run from 10dB to 60dB. despreading opera- THSS The importance of spread spectrum tion by means of LO (Time Hopping) can be seen if we take a look at the well- a pseudo random FHSS known Shannon and Hartley channel- noise (PRN) code (Frequency Hopping) capacity theorem: attached to the com- FIGURE 2 SStechniques classification depending on the point in the sys- munication chan- temat which the PRNcode is inserted in the communication channel nel. The manner of where inserting this code into the transmitting where the signal will be placed in • C is the channel capacity in bits chain before the antenna is actually what the frequency domain after the next per second (bps). This is the maxi- defines the particular SS technique in hop and how long it will stay at the mum data rate for a theoretical bit- question, as Figure 2 shows in detail. new center frequency. The Bluetooth error rate (BER) and represents the According to this, we distinguish technology makes use of FHSS. amount of information allowed by between: • Time Hopping Spread Spectrum when the communication channel. • Direct Sequence Spread Spectrum the PRN acts as a switch to the trans- • B is the required channel bandwidth (DSSS) when the PRN is inserted mitted signal. in Hertz, at the data level. In practice, the It is, of course, possible to mix all the • and S/N is the signal-to-noise power pseudo-random sequence is mixed above techniques to form a hybrid SS ratio and describes the environmen- or multiplied with the information technique, such as DSSS + FHSS. DSSS tal conditions or the physical charac- signal. This is the way GPS and Gali- and FHSS are the two techniques most teristics of the channel. leo work. in use today. An elegant interpretation of this • Frequency Hopping Spread Spectrum The spreading operation, as the name equation, especially valid for difficult (FHSS) when the PRN acts at the clearly says, consists of spreading the environments with low S/N ratios, is carrier-frequency level. Applied at desired signal below the noise floor. In that one can maintain or even increase the LO stage, FHSS PRN codes force contrast, during the despreading opera- the communication performance (high the carrier-frequency to change or tion, when the received signal is corre- channel capacity C) by allowing or hop according to the pseudo-ran- lated with the correct code the desired injecting more bandwidth (high B), dom sequence. The bandwidth signal will “unspread,” rising over the whatever the level of the signal is. of the modulated signal remains noise floor while unwanted signals will After some math, if we slightly mod- unchanged when compared to the remain below it. ify the previous equation and assume original signal and, although the One might think that spreading a that the S/N is usually low, as it is the desired signal power is above the signal across a wide bandwidth does not case in GNSS applications, Shannon’s noise level, it is secured because an spare the limited frequency resource we expression simplifies to unauthorized user never knows Working Papers continued on pg 66. www.insidegnss.com september 2006 InsideGNSS 63 working papers Player Pianos, Sex Appeal, and Patent No. 2,292,387 Eliza Schmidkunz

obal Foundation/Getty Images Foundation/Getty obal K John John Hedwig Kiesler Markey AKA Hedy Lamarr in a 1944 movie publicity shot from“ The Conspirators.” At right, the patent drawings for the “Secret Communications System” she proposed with composer George Antheil. ere’s the concept: A supremely useful in the remote control of dirigible craft, such studied at Max Reinhardt’s famous Ber- gorgeous Hollywood star and as torpedoes. . . lin acting school and was the first actress Briefly, our system as adapted for radio con- a Paris expatriate composer to appear (tastefully) nude in a major trol of a remote craft employs a pair of synchro- develop a secret new technology nous records, one at the transmitting station and motion picture, Ekstase, in 1933. Hit- toH thwart Nazi torpedoes during World ler’s Germany banned the film because one at the receiving station, which change the War II . . . the same year that “Casablan- tuningof the transmitting and receiving apparatus Kiesler was Jewish. The United States ca” is released on the big screen. from time to time, . . . we contemplate employing banned the film because it was erotic. It is simply too good to be true. records of the type used for many years in player That same year, the young actress But by now we know that Hedy pianos, and which consist of long rolls of paper married a husband 14 years her senior. Lamarr and George Antheil were award- having perforations variously positioned in a plu- Austrian “Cartridge King” Fritz Mandl ed U.S. Patent No. 2,292,387 on August rality of longitudinal rows along the records. In was director general of weapons manu- 11, 1942 for a “Secret Communication a conventional Player Piano record there may be facturer Hirtenberger Patronenfabrik. System.” And that, indeed, the two art- 88 rows of perforations. And in our system such a The year of his marriage, Mandl was record would permit the use of 88 different carrier ists invented the “frequency hopping” embroiled in a notorious illegal arms frequencies, from one to another of which both method of radio signal transmission, the transmitting and receiving station would be transport scandal, the “Hirtenberger later to be known as “spread spectrum.” changed at intervals. . . Waffenaffaire,” in which his company As they explained in their patent appli- smuggled German and Austrian weap- cation: ons out of the country under Swiss How did it happen? labels. This invention relates broadly to secret com- Hedy Lamarr, born Hedwig Kiesler in The company made shells and gre- munication systems involving the lie of carrier 1913 or 1914 to a Vienna banking family, nades as well as aircraft from the mid- waves of different frequencies and is especially did not study electrical engineering. She 1930s on and supplied arms for Musso-

64 InsideGNSS september 2006 www.insidegnss.com lini’s 1935 invasion of Africa. Mandl was is] the first piece of music that has been acquired a 49 percent claim to the patent also interested in control systems. He composed OUT OF and FOR machines, from Lamarr for an undisclosed amount frequently entertained key buyers and ON EARTH.” of stock. sellers of arms — as well as Hitler and The Paris Tribune announced the Antheil continued to compose a Mussolini themselves — during the run- first performance in 1924, saying, “Paris number of Hollywood movie scores, up to World War II. The bright Madame will hear the strident screech and crash among them The Plainsman (1936) Mandl’s role as hostess provided her link of giant machines evocative of modern and In a Lonely Place (1950). He died in to discussions of weapons technology industrial America very shortly . . . “Bal- 1959. and, most likely, radio-controlled torpe- let Mechanique.”. . . will be played on four Lamarr made many films, most does and the need for an anti-jamming player pianos simultaneously, with elec- notably Samson and Delilah (1949). In device. tricity as the motive power and a further 1997, three years before her death, she volume of sound supplied by four electric was honored by the Electronic Frontier bells, and two electric motors driving a Foundation for her contributions to steel propeller and a wooden rattle. . . wireless technology. The EEF is a civil In 1940, the renamed Hedy Lamarr liberties advocacy organization that met Antheil at a Hollywood party. The investigates, among other things, pat- two made a perfect pair — technologi- ent abuses. cally if not romantically. Today, No. 2,292,387 is considered Lamarr had an idea for an anti-jam- the foundational patent for spread spec- ming device for radio controlled torpe- trum technologies. does. Antheil’s artistic use of machines And the story behind it is every bit as foreshadowed the electronic age. A 1990 good as “Casablanca.” Forbes magazine article on the pair said, ElizaSchmidkunz is director of marketing for Inside “Antheil understood instantly that syn- GNSS and a graduate of the University of Oregon

nthiel chronizing a series of split-second hops School of Journalism. between radio frequencies would be no more difficult — than syn- chronizing player pianos.”

satet of George A Lamarr talked about quit- he E

T ting MGM and working for the National Inventor’s Council American composer and pianist George (NIC), a government agency Antheil in New York, 1927 formed during WWII as a tech- Within four years of her unhappy nology transfer link between marriage, Madame Mandl had escaped citizen inventors and the mili- her domineering husband and sailed to tary. She submitted her concept, the United States, where she eventually and the NIC encouraged Lamarr became citizen in 1953. She continued and Antheil to develop it into a her acting career for film factory Metro patentable idea. Goldwyn Mayer, whose legendary boss, Hedy Lamarr filed the patent Louis B. Mayer, renamed her “Lamarr.” as Hedwig Kiesler Markey, her His publicity department marketed her name in private life during her as “the most beautiful girl in the world.” marriage to screenwriter Gene Meanwhile, George Antheil had been Markey. For years, no one made composing movie scores in Hollywood the connection between the pat- since his return from Europe in 1933. ent holder and the movie star. Antheil was born in Trenton, New The War Office immedi- Jersey in 1900. In the 1920s, he joined ately classified it, and the patent the Lost Generation in Paris, where he lapsed 17 years later. Lamarr and lived above Sylvia Beach’s famous Left Antheil apparently considered Bank bookstore, Shakespeare & Com- it their contribution to the war pany. He made a name for himself as effort and neither made money a daring composer and concert pianist from their brilliant idea until in Paris and Berlin. He said of his most 1998, when wireless technol- famous piece - Ballet Mecanique “ [it ogy developer Wi-LAN, Inc. www.insidegnss.com september 2006 InsideGNSS 65 working papers

Working Papers continued from pg 63. niques to transmit a signal modulated as possible. This is of major importance wanted to use more efficiently with this by means of frequency shift keying or because the robustness of the spreading technique. But, in fact, that use of a wide binary phase-shift keying. So far, three and despreading operations depends on slice of radio spectrum is well compen- main signal transmission methods are the quality of the code. sated for by the possibility of many users available: Of course, perfectly random codes to share the enlarged frequency band, • FDMA or Frequency Division Multi- would be optimal. In such an ideal case, which can employ different PRN codes ple Access. FDMA allocates a specific we could have an infinite number of optimized to be almost orthogonal with carrier frequency to a communica- users with each completely distinguish- each other. Thus, many signals can oper- tion channel, and the number of dif- able from one another. But equally ate in the same swath of spectrum with ferent users is limited to the number important is that the codes must remain receivers able to distinguish the desired of slices in the frequency spectrum. reproducible. Otherwise, the receiver signals from the others. FDMA is the least efficient in term of will be unable to extract the message Now that we have gained some frequency-band usage. Glonass is the that has been sent. This is the reason insight in the SS techniques, let’s sum- only satellite navigation system using why the sequence is said to be “nearly marize the main characteristics of FDMA. random” or pseudo-random. spread spectrum communications: • TDMA: Time Division Multiple As we have seen, codes play an out- • Wideband technology Access. With TDMA different users standing role in a CDMA system as GPS and Galileo are. But what does it mean Pseudorandom noise (PRN) seems on observation to to say that a code is good or bad, better lack a definite cyclical pattern but, in fact, does follow or worse? To answer this question we a deterministic pattern that repeats itself eventually. have to talk first about pseudorandom noise, because a good code will be the one that best fulfils the characteristics • Resistance to interference and speak and listen to each other accord- of PRN. enhanced antijamming capability. ing to a defined allocation of time In cryptography, pseudorandom Intentional or unintentional inter- slots. Thus, different communica- noise refers to a signal that appears ference and jamming signals are tion channels can be established for similar to RF noise and satisfies one or rejected. a unique carrier frequency. Examples more of the standard tests for statistical • Resistance to interception. Only if of TDMA systems are GSM, DECT, randomness. This signal seems on obser- we apply the right code to the right TETRA, and IS-136. vation to lack a definite cyclical pattern signal (satellite) can we decode it. • CDMA: Code Division Multiple but, in fact, does follow a deterministic Indeed, without the right code, the Access. CDMA access relies on a pattern that repeats itself eventually. SS signal appears as noise or as an specific code. In that sense, spread This is of great importance, as we’ve interferer. Even better, signal levels spectrum is a CDMA access. The already pointed out, because the ran- can be below the noise floor, because code must be defined and known dom sequences not only have to look the spreading operation reduces the in advance at the transmitter and as “random” as possible but must also spectral density. The message is thus receiver ends. This has important be reproducible. In other words, a PRN made invisible, an effect that is par- implications in the code design as code is one that has a spectrum similar ticularly strong with the DSSS tech- we will see later. GPS and Galileo to a random sequence of bits but is deter- nique. Other receivers cannot “see” are two very significant examples ministically generated. the transmission and only register of CDMA in which every satellite For most of the PRN codes, except a slight increase in the overall noise is assigned a different code. This the “random” or memory codes that will level. enables the receiver to determine be discussed later, we need a pseudoran- • Resistance to fading (multipath the satellite from which each signal dom number generator (PRNG). The effects). This is of great importance, is coming and, consequently, to help PRNG is an algorithm that generates a especially for GNSS, because wire- the receiver calculate its position by sequence of numbers that are not truly less channels often include mul- simultaneous ranging to multiple random, but have very long periods. tiple-path propagation. As it is well satellites. Even more important than knowing known, multipath is one of the most the desired properties we want our codes important sources of error in satellite Not So Random Noise to have is keeping in mind the limita- navigation. Codes are digital sequences that, in tions of our approach. As John von Neu- It is important to note that SS is not a order to achieve the benefits that we mann (1951) memorably stated, “Anyone scheme, and thus it must not have described, must be as long and as who considers arithmetical methods of be confused with other types of modula- random as possible. That is equivalent to producing random digits is, of course, tion. One can, for example, use SS tech- saying they must appear as “noise-like” in a state of sin.”

66 InsideGNSS september 2006 www.insidegnss.com So, our task is to develop codes that The middle-square method has in order to improve the randomness of appear as “random” as possible, but at been improved upon for most purposes a set of codes, very long sequences are the same time we need to have a way to by more elaborate generators that pro- needed. The longer the codes, the better generate them and reproduce them — an duce pseudorandom sequences that are the properties present, but the price to apparent contradiction in terms. Indeed, uniformly distributed by any of several pay is that long integrations are needed a very careful mathematical analysis is statistics tests. Common classes of these to find the correct delay between the necessary to have any confidence that a algorithms include linear congruential satellite signal and the receiver replica, PRNG does really generate numbers that generators, lagged Fibonacci generators, which would not be practical for most are sufficiently “random”, as R. Matthews linear feedback shift registers (LFSRs), of the applications. and M. Luby have shown in their articles and generalized feedback shift regis- listed in the Additional Resources sec- ters. Recent instances of pseudorandom Pseudorandom Noise Codes tion at the end of this column. algorithms include Blum Blum Shub, Now that we have seen the broad palette Coming back to the inherent non- Fortuna, and the Mersenne twister, this of algorithms that exist to generate pseu- randomness of the sequences generated last one with a colossal period of 219937-1 dorandom sequences, we will analyze by a PRNG, one can easily imagine that iterations. the properties of the most commonly since PRNGs are run on a determinis- Another important point is that used codes in CDMA systems, paying tic computer — in contrast to quantum GNSS mass market applications require special attention to those that GPS and computers — we need to use a deter- receivers that are easy to implement. Galileo use now or will use in the near ministic algorithm to generate the PRN This explains why the feedback shift reg- future. sequences. In consequence, the output ister approach is still the most important Because codes comprise a very wide of any computer with finite memory will procedure to generate pseudorandom field, only some of the most popular inevitably have the property of periodic- sequences. The shift register approach sequences are listed here, and only the ity, and, as we have emphasized at several presents the advantage that only the first six families will be described in points already, random codes cannot be taps of the register have to be saved in detail in this article. Of special interest, periodic by definition. memory because the different outputs then, to CDMA-based systems are the are generated using the values of the taps following PRN codes: PRNGs: A Brief History according to a generation algorithm. • Maximal length sequences or m- The first works on computer-based When GPS was designed for the first sequences PRNGs were published in 1946 by time, memory chips were not as cheap as • Gold Codes John von Neumann, who proposed an they are today and thus the shift register • Kasami Codes approach for generating PRN codes, approach was the easiest to implement • Weil Codes known as the “middle square method.” in terms of memory. With the years, the • Random Codes – Memory Codes The idea of this method is as follows: take any number, square it, remove the The longer the codes, the better the properties middle digits of the resulting number as present, but the price to pay is that long integrations your “random number,” then use that are needed to find the correct delay between the number as the seed for the next itera- tion. satellite signal and the receiver replica. For example, squaring the number “1111” yields “1234321,” which can be memory capacities of microprocessors • Bent Codes and Bent-function written as “01234321,” an 8-digit num- have improved, but to keep backwards Sequences ber being the square of a 4-digit number. compatibility the approach has been • Barker Codes This produces “2343” as the “random” retained for the current existing codes. • GMW Sequences number. Repeating this procedure gives Today, memory capacity is no longer a • Hadamard-Walsh Codes “4896” as the next result, and so on. problem, as can be seen with the mem- • Rudin-Shapiro Sequences The main problem of this method is ory-random codes approach followed • Golay Codes that all sequences repeat themselves and by Galileo, which saves all the codes in • No Sequences some very quickly. Von Neumann was memory is not so problematic. • Kronecker product Sequences aware of this, but nonetheless he found Moreover, very long codes, in spite • Modified Jacobi Sequences the approach sufficient for his purposes. of their better properties would require • Zero Cross Zones Sequences Indeed, he judged hardware random very long integrations to find the correct Optimal PRN Code Selection. Selecting number generators unsuitable, because delay between the satellite signal and the best code is synonymous with select- without being able to record the gener- the receiver replica, which would not be ing the code that performs best when ated output at that time, they could not affordable for most of the applications. measured against a metric considered be tested for errors later. Moreover, as we observed earlier, to represent the “goodness” of a code. www.insidegnss.com september 2006 InsideGNSS 67 working papers

were employed to ness we will see when we talk about Bent account for the dif- codes, and all the works on sequences ferent users Gali- with large zero correlation zones (ZCZ) s(n) leo will be target- show promising fields that are still to be a3 a2 a1 a0 ing in the future, as explored by GNSS researchers. Soualle discusses in FIGURE 3 Feedback shift register representation detail. Additionally, Code Types Soualle et al. ana- Let’s examine more closely now some of This is not an easy task, as the develop- lyzed the code performance during the the leading codes used, or considered for ment of the Galileo codes described in signal acquisition and tracking phases use, in new GNSS signals. the article by F. Soualle et al. has shown separately. Maximum Length Sequences. Also (see Additional Resources). Indeed, most of these metrics include called m-sequences or n-sequences, Indeed, the goodness of a code the Welch bound in their expressions maximum length sequences (MLS) are should not depend on receiver imple- and are based on the concepts of auto- pseudorandom binary sequences gener- mentations, because the codes designed correlation and crosscorrelation. For ated using maximal linear feedback shift today will be transmitted for several example, one metric examines the registers. M-sequences owe their name decades, and it is impossible to predict autocorrelation properties of a code p to the fact that they can be reproduced changes in receiver implementation for of length n: which is by a shift register with m taps resulting this long period of time. defined as in a maximum length of 2m − 1 chips. Additionally, depending on the tar- Maximum length sequences are spec- geted application, some properties are trally flat, with the exception of a zero more important than others. For exam- continuous term. ple, the autocorrelation is more impor- where M-sequences also constitute the tant than the crosscorrelation for some n code length, basis for more complex structures such applications and exactly the opposite ak k – th code , as the Gold codes that will be described happens in other applications. foffs Doppler frequency offset, next. We should underline the fact that

Thus, since designing codes opti- fs sampling frequency. every particular code structure gen- mized for all the potential applications Equally, the crosscorrelation within a erated using a PRNG is based in gen- of GNSS is practically impossible, using set of M codes eral on a limited number of primary a code-centric metric is more appropri- between code sequences. ate. This is the reason why the Welch p and q, , is Using these basics, the correspond- bound has gained importance in recent defined as ing code family is achieved by manipu- years as a suitable metric for evaluating lations, that is, a shift and add in most PRN codes. cases. Additional randomness can be The Welch lower bound is defined in Autocorrelation and crosscorrela- gained by adding various m‑sequences the article by L. Welch (see Additional tion are two figures that contain a lot of of differing lengths and/or short-cycling Resources) as information about the code-properties them to obtain the desired length (trun- of a family. For the optimization of GPS cated codes) as is the case with GPS L5 L1C codes, similar metrics are expected and L2. Given the fact that m-sequences to have been considered. can be implemented inexpensively in It determines the theoretical mini- Furthermore, other metrics have also hardware or software, and relatively num of the maximum value of cross- shown to be good figures to identify good low-order feedback shift registers can correlation that can be obtained for a codes. The merit factor studied in the generate long sequences, they are the code length n within a set of M codes. article by S. J. MacMullan (see Addition- basis for most of the codes used nowa- This expression can be further simpli- al Resources), the anti-jamming robust- days for GNSS. fied when the number of sequences is Generation of m-sequences. As an relatively high, as it is the case in any #feedback Codelength # example, Figure 3 shows an MLS gen- GNSS application. In this case, the taps m n=2m-1 m-sequences erating system with four feedback taps. Welch Bound can be approximated to 13 8191 630 Any generating system of this type is . More accurate expressions described by a primitive polynomial 14 16383 756 on this bound have been obtained in that depends on the connections shown work described by Tang X.H. et al. 15 32767 1800 in the figure. For the optimization of the Gali- 17 131071 7710 The number of m-sequences that leo codes, various metrics (most of Table 1. N u m b e ro fm - s e q u e n c e sf o ra g i v e n exist for a given register length grows them are based on the Welch Bound) shift register length very quickly, making it extremely dif-

68 InsideGNSS september 2006 www.insidegnss.com Crosscorrelation of GPS C/A Code at 0 Hz Doppler Offset Crosscorrelation of GPS C/A Code at 1500 Hz Doppler Offset 0.8 0.03

0.025 0.6 0.02

0.4 0.015 Occurence Occurence 0.01 0.2 0.005

0 0 -100 -50 050 100 -100 -50 050 100 Crosscorrelation (nat. units) Crosscorrelation (nat. units)

FIGURE 4 Crosscorrelation of GPS C/A codes for 0 Hz Doppler FIGURE 5 Crosscorrelation of GPS C/A codes for 1500 Hz Doppler ficult to find the optimal one. Table 1 codes, this is the most popular type of shows the number of m-sequences that codes in the GNSS community today. exist with feedback taps from 13 to 17. Gold codes are named after their inven- Because MLS are periodic and shift tor Robert Gold, who introduced them registers cycle through every possible in two articles he published in 1967 and where m is the number of feedback taps binary value, registers can be initialized 1968 in the IEEE Transactions on Infor- and ci,cj denotes the combination of codes to any state, with the exception of the mation Theory. selected from the family. all-zero vector. This is what is called the A Gold code family is based on XOR Additionally the XOR operation of initialization vector. In the case of GPS addition of two m-sequences of identical two Gold codes is another Gold code in we can see this in the signal-in-space length n with an autocorrelation of the some phase. The famous GPS C/A Gold interface control document (SIS ICD), resulting code that consists beside the code is based on LFSRs of order 10. Fig- where every satellite is identified by a main peak of the three values ures 4 and 5 show that the three-valued different initialization vector or delay. crosscorrelation property just holds for 0 Properties of maximum length Hz Doppler frequency offset mentioned sequence. The properties of the m- earlier. sequences were formulated by S. Golomb in his text Shift Register Sequences. These where w i t h Kasami Codes include the number of feedback taps m and c Codes in the small Kasami set fulfill • Balance Property. The number of 1’s denotes the XOR summation of the two many desired properties, such as having in the sequence is one greater or equal m-sequences. optimal crosscorrelation values touching to the number of 0’s in the sequence. Every combination of m-sequences the Welch lower bound. • Run Property. This means that of all that holds the above criterion of a four- The procedure used to build the small the “runs” in the sequence of each valued autocorrelation function after Kasami set is as follows: Let m be an even type, one half of the runs are of XOR-ing them is called a preferred pair. integer and u an m-sequence of period length 1, one quarter of the runs are Obviously, the number of preferred pairs n=2m-1. Starting with this sequence u, of length 2, one eighth of the runs for a given number m of feedback taps we obtain a decimated sequence u[q] are of length 3, and so on. A “run” is is limited. by selecting every q-th chip of u until a a sub-sequence of 1’s or 0’s. With the XOR addition of a preferred periodic sequence is obtained. This will • Correlation Property. The autocor- pair, a first Gold Code is generated and happen at least after n elements. relation and crosscorrelation of the a whole code family can be obtained by If we work now with u[q] being m-sequence is periodic and binary adding the two sequences in their vari- and m being the degree valued. ous phases. Thus the overall size of the of the sequence u, then the decimated • Maximum length sequences are code family is n+1 (two codes of the sequence u[q] is periodic with 2m/2 –1 related to the Hadamard transform. preferred pair and n-1 codes by adding and, consequently, q-times repeating of them cyclically shifted), and it shows a u[q], which leads us to a new sequence Gold Codes three-valued crosscorrelation function that we call w=u[q]. Then the small set of Because the C/A codes used in the in cases where no Doppler frequency Kasami codes is obtained by XOR adding open GPS L1 signal are based on Gold offset is considered: u and cyclically shifted versions of w: www.insidegnss.com september 2006 InsideGNSS 69 working papers

Crosscorrelation at 0 Hz Doppler Offset Crosscorrelation at 1500 Hz Doppler Offset 0.8 0.03 GPS C/A GPS C/A Small Kasami Set Small Kasami Set 0.025 0.6 0.02

0.4 0.015 Occurence Occurence 0.01 0.2 0.005

0 0 -60 -40 -20 0 20 40 60 -100 -50 050 100 Crosscorrelation (nat. units) Crosscorrelation (nat. units)

FIGURE 6 Crosscorrelationof the Small K asamiset for 0 doppler offset in FIGURE 7 C r o s s c o r r e l a t i o no ft h eS m a l lK a s a m is e tf o r15 0 0d o p p l e ro ff s e t natural units in natural units

31.48 is almost reached in sion w (here the second m-sequence the case of 0 Hz Doppler fre- is blanked) where represents the modulo 2 addi- quency offset. The crosscorrelation function within tion (XOR) of the vectors u and shifted The hardware implementation of the large set of Kasami codes is five-val- versions of w. Kasami sequences may look very com- ued in the worst case and three-valued This formulation reveals that the plicated at first glance because a decima- for the special cases of the Gold codes’ number of codes in the small tion process requires much faster clock- respectively small set of Kasami Codes: set of Kasami is obviously very limited ings. However, the decimated sequence due to the repetition of u[q] within the u[q] is by itself an m-sequence of order sequence w. m/2, and the implementation complex- The maximum crosscorrelation ity is thus reduced. within the small set of Kasami codes Moreover, the large set of Kasami where m refers to the number of feed- shows optimal properties, as the cross- Codes is an enhancement of the small back taps of the m-sequence and ci,cj correlation just consists of the three set of Kasami codes as well as of the denote the combination of codes within values Gold codes. For its generation we use the code family. (See Figure 8.) as basis sequences the two m‑sequenc- As we see, Kasami codes have very es that were used for generation of the good properties regarding crosscorrela- Gold codes and the decimated sequence tion but present a significant problem in w=u[q] from the small set of Kasami that the small Kasami set is too small to where m refers to the number of feed- codes. be useful. This was, in fact, one of the back taps of the m-sequence and ci,cj The entire large set of Kasami codes drivers during the optimization of the denote the combination of codes within can be generated as c = u Ti v Tj w E1 OS codes as the article by Soualle et the code family. with u, v being a preferred pair of m- al discusses. Indeed, Galileo needs 100 For an even number of taps m we can sequences and w being the decimated codes and GPS will have around 420 as get a code family of with version of one of the two m-sequences, can be seen in the respective SIS ICDs an overall maximal absolute crosscor- as was introduced in the small set of cited in Additional Resources. relation of . The small set Kasami codes. of Kasami codes can be shown to touch Now within the large set of Kasami Weil Codes and the Welch Bound asymptotically. codes we can clearly identify a number Legendre Sequences Figures 6 and 7 show a comparison of special subsets: Weil Codes are named after André of the crosscorrelation function between • the two m-sequences that form the Weil and will be used in the future GPS the GPS C/A codes and a small set of preferred pair L1C. Weil codes are based on Legendre Kasami codes with the C/A codes’ first • the Gold Codes that can be created sequences; so, we will discuss the latter m-sequence used as origin. With a max- using these m-sequences sequences first. imum absolute crosscorrelation of 33 for • the small set of Kasami Codes that Legendre sequences are studied the sample of the small set of Kasami can be obtained by combining one in several articles cited in the Addi- codes shown here, the Welch bound of m-sequence with its decimated ver- tional Resources (Kitabayashi, S. et al;

70 InsideGNSS september 2006 www.insidegnss.com Crosscorrelation of Large Set of Kasami Codes at 0 Hz Doppler Offset Crosscorrelation of GPS C/A Code and Truncated GPS C/A Code 0.5 0.8 GPS C/A Truncated GPS C/A 0.4 0.6

0.3 0.4 Occurence Occurence 0.2 0.2 0.1

0 0 -60 -40 -20 0204060 -50 0 50 Crosscorrelation (nat. units) Crosscorrelation (nat. units)

FIGURE 8 Crosscorrelationof L argeSet of K asamiCode without Doppler FIGURE 9 C r o s s c o r r e l a t i o no fG P SC /A C o d ea n dc r o s s c o r r e l a t i o no fG P S Offset. C/A Code truncated by the last chip

Hoholdt, T. et al; Paterson, K.G.; Ding, Another way of generating Legen- the desired code length of 10 millisec- C. et al; and Green, D.H. et al). These dre sequences is based on the fact that onds (10230 chips) that GPS L1C will sequences are based on the quadratic binary Legendre or quadratic residue have. To reach the 10230 chips length, residue of a prime. sequences exist for all lengths L that a sequence of 7 chips (i.e., [0 1 1 0 1 0 Compared with other sequences like are prime. They can be constructed 0]) is inserted at a well-defined position Gold codes, Legendre sequences are using the Legendre symbol (i/L) which within every Weil Code. characterized by being based on prime is defined as: This position is referred as the Weil numbers. While Gold codes must be of index. length 2m‑1, Legendre sequences are of length prime. This is interesting because Random, Memory Codes the density of prime numbers within the Then, a Legendre sequence “Random” codes, also known as memory set of natural numbers is higher than a0, a1, a2,…,aL-1 is formed by writing codes in the literature, will be the ones that of 2m-1. that Galileo will use for the E1 Open Ser- For a prime number L and an arbi- vice (OS) and E6. As it has been shown, trary positive integer a (a

Autocorrelation Sidelobe Zero Property 1.2 randomly selected. important advantages for use in spread 1 Random codes, spectrum multiple access communica- 0.8 a l s o k now n a s tions systems. First, the sequences are memory codes are, “balanced”, which represents only a 0.6 despite their promis- slight advantage. Second, the sequence 0.4 ing name, not truely generators are easy to randomly initial- random. As we saw ize into any assigned code and hence Normalized AC F 0.2 in the introduction, can be rapidly “hopped” from sequence 0 no true random to sequence for code division multiple codes can be imple- access operation. -0.2 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2345678 mented with a finite Most importantly, the codes are length, but because nonlinear in that the order of the lin- Code Shift (chips) they aspire to reach ear difference equation satisfied by the FIGURE 10 Autocorrelation properties of a random code with ASZ the best possible sequence can be orders of magnitude p s e u d o r a n d o m larger than the number of memory ele- range, or the autocorrelation sidelobe behavior for a given length, the term ments in the generator that produced it. zero (ASZ) property. This latter ASZ (see “random” is not completely wrong. The equivalent linear span of these codes Figure 10) guarantees that the autocor- Random codes will be used for the is bound above by relation values of every code correlate first time in Galileo E1 OS und E6. Inter- to zero with a delayed version of itself, est in them is growing because today delayed by one chip. memory chips can be produced ever The plain number of choices to set more cheaply. Memory codes are unlike The linear span of a sequence is the 0’s and 1’s for the whole code fam- LFSR-generated codes in which only a defined as the minimum number of ily is with 2nM (n referring to the code short memory is needed to save the taps stages of a linear feedback shift register length and M to the number of codes) of the shift register and an algorithm needed to generate the given sequence. unimaginably high. Even if doubled runs continuously to obtain the code A high equivalent linear span ensures codes as well as codes with periodic- output at any moment. Instead, memory that the code sequence cannot be read- ity fault are excluded, the dimension of codes have the complete sequence saved ily analyzed by a sophisticated enemy the problem is still huge. Consequently, in memory and only need to be “read”. and then used to neutralize the advan- special algorithms have to be applied to The disadvantage of random codes tages of the spread spectrum process- generate random codes efficiently (mini- for receiver manufacturers then is that ing. mizing a cost function). more memory is needed to have all the Bent sequences present very interest- One possible implementation is the codes saved, because they do not have ing code linear span values, which offer use of genetic algorithms that follow the to follow any generation procedure. But, a good metric to measure how robust principle of evolution and mutations, as we have already commented, the cost a code is against jamming in spread according to the Darwinist principle of of memory units has fallen dramatical- spectrum systems. The span of the code the “survival of the fittest”. Thus, start- ly in the last few years, and the trend is should be several times the processing ing with an initial set of codes or, if we expected to continue. gain. Jammers cannot determine the stick to the biology notation, starting linear recursion of the code in a short with an initial population, the codes or Bent Codes and Bent- enough time to harm the SS transmis- individuals that show the worst perfor- Function Sequences sion. In fact, linear SS codes are not mance according to our selected figure Bent function sequences are a family of acceptable for anti-jam spread spectrum of merit are chosen and eliminated or nonlinear binary signal sets that achieve systems. For more information on Bent replaced by new ones. the Welch’s lower bound on simultane- sequence the following papers are rec- Continuing with a smaller set of ous crosscorrelation and autocorrela- ommended: R. Scholtz (1978), P. Kumar codes is the most extreme way, but the tion magnitudes (J. Olsen (1982)). Given (1983) and J.-S. No (2003) rule that is applied most often is to allow a parameter m with mod(m,4) = 0 the We summarize in Table 2 the proper- mutations within the code until a bet- period of the sequences is 2m -1, the ties of all the code families discussed at ter code is found. A mutation must be number of sequences in the set is 2m/2 length here. understood in this context as a random and the cross/auto correlation function flip of a number of chips within the code. has three values with magnitude lower Conclusions If the mutated code shows better proper- or equal to 2m/2+1. Codes are a fundamental element in ties than the original one, the mutation These new code sets have the same any GNSS system. Indeed, the final is accepted, otherwise the mutation is size and correlation properties as the performance a receiver will experience rejected and new bits for flipping are small set of Kasami Codes, but they have depends much on the quality of the

72 InsideGNSS september 2006 www.insidegnss.com Stefan Wallner studied at Period Size of Maximum Code Family Correlation Value Constraints theT echnical University of Munichand graduated with Gold Codes * a Diploma in techno- mathematics. He is now Small set of *, mod(m, 2) = 0 research associate at the Kasami Codes Institute of Geodesy and Navigation at theU niversity FAF Munich.W allner’s main topics of interests are the spreading codes Large set of *, mod(m, 4) = 2 Kasami Codes and the signal structure of Galileo and also inter- ferenceand interoperability issues involving GNSS systems. Weil Codes L (L-1)/2 mod(L,2) = 1 Additional Resources Bent Codes mod(m,4) = 0 Von Neumann J., and A.S. Householder, G.E. For- Table 2. Comparisonbetween Golf Codes, Small and Largeset of K asamiCodes, W eilCodes and sythe, and H.H. Germond,“Various techniques Bent Codes. * Generating m-sequences have to be preferred pairs used in connection with random digits,” in eds., Monte Carlo Method, National Bureau of Stan- Authors dards Applied Mathematics Series, 12 (Washing- Civilcodes Galileo GPS ton, D.C.: U.S. Government Printing Office, 1951), “Working Papers” explore E1/L1 Random Gold codes (C/A) pp. 36-38 codes (E1 OS) Weil codes (L1C) the technical and scien- tificthemes that underpin Matthews R.,“ Maximally Periodic Reciprocals,” L2 - m-sequences* GNSSprograms and appli - Bulletin of the Institute of Mathematics and its E5/L5 m-sequences m-sequences** cations. This regular col- Applications 28, pp. 147-148, 1992 E6 Random - umn is coordinated by Luby M. (1996),“ A definitive source of techniques codes Prof. Dr.-Ing. Günter forprobably random sequences,” P seudorandom- Hein. ness and Cryptographic Applications, Princeton Table 3. Civil GNSS codes. *T h es a m ep o l y n o m i a lg e n e r a t o ru s e df o rL 2 Prof. Hein is a member of the European Com- Univ Press, 1996 C M a n d L 2 C L w i t h t h e d i ff e r e n c e t h atL 2 C M mission’s Galileo SignalT ask Force and organizer Soualle F., M. Soellner, S. Wallner S., J. A. Avila- is reset after 20 ms and L2 CL after 1.5 of the annual Munich Satellite Navigation Sum- Rodriguez, G. W. Hein, B. Barnes, T. Pratt, L. Ries, seconds. ** The different codes of the mit. He has been a full professor and director of family are obtained employing different J.W inkel, C. Lemenager, and P. Erhard,“Spreading the Institute of Geodesy and Navigation at the m-sequences and short-cycling. Code Selection Criteria for the Future GNSS Gali- University of the Federal Armed Forces Munich leo,” Proceedings of GNSS 2005, Munich 19-22 selected family of codes. Gold codes (University FAF Munich) since 1983. In 2002, July 2005 he received the United States Institute of Navi- and truncated codes have been the most Welch L.,“ Lower bounds on the maximum cross gation Johannes Kepler Award for sustained and used solutions in the past but in the last correlation of signals,” IEEE Transactions on Infor- significant contributions to the development of mation Theory, Vol. IT-20, No. 3, pp. 397–399, years with the optimization of GPS and satellite navigation. Hein received his Dipl.-Ing May 1974 the birth of Galileo radically different and Dr.-Ing. degrees in geodesy from the Univer- approaches with better properties have sity of Darmstadt, Germany. Contact Prof. Hein at Tang, X.H., and P. Z. Fang, and S. Matsufuji,“ Lower come into play. This is not a static field . bounds on correlation of spreading sequence set with low or zero correlation zone,” Electronic Let- of study at all and a quick look in the lit- José-Ángel Ávila- erature shows that much work has been Rodríguez is a research ters, Vol. 36, No. 6, pp. 210–218, March 2000 done and remains to be done. associate at the Institute MacMullan S. J., and O. M. Collins,“ A Comparison As we have seen in this paper, opti- of Geodesy and of Known Codes, Random Codes, and the Best mizing codes is not an easy task. In fact, Navigation at the Codes,” IEEETIT: IEEE Transactions on Informa- the desirable properties a family should University FAF Munich. tion Theory, 1998 He is responsible for IS-GPS-200: NAVSTAR GPS Space Segment/Navi- present depend highly on the application research activities on gation User Interfaces the code is intended to serve. What use GNSS signals, including BOC, BCS, and MBCS we will make of GNSS in the future is .Ávila- Rodríguezis involved in the Golomb, S., Shift Register Sequences, San Fran- something that only time will tell, and Galileo program, in which he supports the cisco, Holden-Day, 1967 thus the goodness of the codes for every European Space Agency, the European Gold, R.),“ Optimal binary sequences for spread certain application will definitely not be Commission,and the Galileo Joint U ndertaking, spectrum multiplexing (Corresp.),” IEEE Transac- uniform. throughthe Galileo Signal T askForce. He studied tions on Information Theory. Volume 13, Issue 4, Table 3 at theT echnical Universities of Madrid, Spain, Oct. 1967, pp. 619–621 As a summary, shows the code andVienna, A ustria,and has an M .S.in electrical families that will be used by Galileo and engineering.His major areas of interest include Gold, R.,“ Maximal recursive sequences with 3- GPS in every band. the Galileo signal structure, GNSS receiver valued recursive crosscorrelation functions (Cor- design and performance, and Galileo codes. Working Papers continued on pg 75. www.insidegnss.com september 2006 InsideGNSS 73 working papers resp.),” IEEE Transactions on Information Theory. Vol. 14, Issue 1, January 1968, pp.154–156 Galileo SIS ICD 23/05/2006 Kitabayashi S., and T. Ozawa and M. Hata,“ Prop- erty of the Legendre Subsequence” Singapore ICCSllSlTA, 1992 Hoholdt T., and H. E. Jensen,“Determination of the Merit Factor of Legendre Sequences,” IEEE Transactions on Information Theory, Vol. 34, No. 1, January 1988 Paterson K. G.,“New Binary Sequence Sets with FavourableCorrelations”’ ISl T1997, U lm,Germany, June 29 – July 4, 1997 Ding C., and T. Helleseth, W. Shan W,“ On the Lin- ear Complexity of Legendre Sequences “, IEEE Transactions on Information Theory, Vol. 44, No. 3, May 1998 Green D. H., and P. R. Green P.R.,“ Polyphase relat- ed-prime sequences”, IEE Proc.-Comput-Digit. Tech, Vol. 148, No. 2, March 2001 Winkel J., Patent number WO2006063613, 22- 6-2006, H04J13/04, H04B1/707, H04J13/02, H04B1/707 Olsen, J., and R. Scholtz and L. Welch,“ Bent-func- tion sequences”, IEEE Transactions on Informa- tionT heory. Vol. 28, Issue 6, November 1982, pp. 858–864 Scholtz, R., and L. Welch and P. Kumar, “Group characters:Sequences with good correlation prop - erties,” IEEE Transactions on Information Theory, Vol. 24, Issue 5, September 1978, pp. 537–545 Kumar, P., Scholtz, R.(1983),“ Bounds on the lin- ear span of bent sequences, ” IEEE Transactions on Information Theory. Volume 29, Issue 6, Nov 1983 Page(s): 854 – 862 Jong-Seon No, Gang-Mi Gil, Dong-Joon Shin (2003),“Generalized construction of binary bent sequenceswith optimal correlation property,” I EEE Transactions on InformationT heory.Volume 49, Issue 7, July 2003 Page(s): 1769 - 1780

74 InsideGNSS september 2006 www.insidegnss.com