summaryrefslogtreecommitdiff
path: root/chapter07/content_ch07.tex
blob: 919139d2afc281b736518d0e9a4f58ba84750c8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
% SPDX-License-Identifier: CC-BY-SA-4.0
%
% Copyright (c) 2020 Philipp Le
%
% Except where otherwise noted, this work is licensed under a
% Creative Commons Attribution-ShareAlike 4.0 License.
%
% Please find the full copy of the licence at:
% https://creativecommons.org/licenses/by-sa/4.0/legalcode

\chapter{Spread Spectrum and Multiple Access}

\begin{refsection}
	
The electromagnetic spectrum is a sparse resource. It must be used as efficient as possible because it is shared with numerous users and applications. However, modern digital communication systems use spread spectrum technologies that occupy a relatively wide frequency band

The purpose of spread spectrum is amongst others:
\begin{itemize}
	\item Immunity against noise and disturbances
	\item Encryption and confidentiality of the communication
	\item Plausible deniability that the communication had ever taken place
	\item Coexistence with other services (multiple access)
\end{itemize}

Especially, the multiple access is an important reason for employing spread spectrum technologies. In modern communication systems, the resource \emph{frequency} is not only allocated to a single user. For example, \ac{LTE} allows many users to access the service with high data rates and low latency. The resource \emph{frequency} must be shared. Efficient medium access relies on spread spectrum to achieve this.

\section{Spread Spectrum}

In the modulation techniques considered so far, are \emph{plain} or \emph{non-spread spectrum}. For the definition of spread spectrum signals, the symbol duration and the transmission bandwidth is investigated.
\begin{itemize}
	\item The signal duration is the amount of time required to convey an information. In digital communication system, an information is a symbol modulated onto a carrier. The signal duration is the symbol period $T_{sym}$.
	\item The signal bandwidth $\Delta f_{sym}$ is the minimum bandwidth required by the receiver to receive the signal. In the case of modulation, it is the \emph{transmission bandwidth}.
\end{itemize}
In the \ac{ASK}, \ac{PSK} and \ac{QAM} modulation of Chapter 5, the signal duration and the bandwidth are inversely proportional.
\begin{equation}
	\Delta f_{sym} = \frac{1}{T_{sym}}
\end{equation}

The product of the bandwidth and the duration -- the \index{time-bandwidth product} \textbf{time-bandwidth product} -- is constantly $1$.\footnote{This is the ideal case. For real implementations, the constant may differ from $1$ depending on the modulation technique. However, it will be close to $1$.}
\begin{equation}
	T_{sym} \cdot \Delta f_{sym} = 1
\end{equation}

\paragraph{Time-Bandwidth Product.}

The time-bandwidth product is used for the definition of spread spectrum:
\begin{definition}{Spread spectrum}
	The time-bandwidth product of \index{spread spectrum} \textbf{spread spectrum} signals is significantly greater than $1$.
	\begin{equation}
		T_{sym} \cdot \Delta f_{sym} \gg 1
	\end{equation}
\end{definition}

Typically, this means that the bandwidth $\Delta f_{sym}$ is increased while the symbol duration and thereby the symbol rate is kept constant.
\begin{itemize}
	\item The symbol sequence (time-bandwidth product of $1$) is altered in a way which distributes the signal power over a wider frequency band. This process is called \index{spreading} \textbf{spreading}.
	\item The inverse process is \index{despreading} \textbf{despreading}. The original symbol sequence is reconstructed from the wide-band spread spectrum signal.
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}
		\begin{axis}[
			height={0.15\textheight},
			width=0.8\linewidth,
			scale only axis,
			xlabel={$\omega$},
			ylabel={$|\mathrm{S}_{XX}|$},
			%grid style={line width=.6pt, color=lightgray},
			%grid=both,
			grid=none,
			legend pos=north east,
			axis y line=middle,
			axis x line=middle,
			every axis x label/.style={
				at={(ticklabel* cs:1.05)},
				anchor=north,
			},
			every axis y label/.style={
				at={(ticklabel* cs:1.05)},
				anchor=east,
			},
			xmin=0,
			xmax=10.5,
			ymin=0,
			ymax=1.2,
			xtick={0},
			xticklabels={0},
			ytick={0},
			axis x discontinuity=parallel,
		]
			\addplot[blue, smooth] coordinates {(4.6,0) (4.7,0.02) (4.8,0.2) (4.9,0.71) (5,1) (5.1,0.71) (5.2,0.2) (5.3,0.02) (5.4,0)};
			\addlegendentry{Narrow-band signal};
			\addplot[red, smooth] coordinates {(2,0) (2.5,0.01) (3,0.05) (5,0.05) (7,0.05) (7.5,0.01) (8,0)};
			\addlegendentry{Spread spectrum signal};
		\end{axis}
	\end{tikzpicture}
	\caption[PSD of a narrow-band and spread spectrum signal]{\acs{PSD} of a narrow-band and spread spectrum signal. Both signals carry the same information and have the equal power. The narrow-band signal concentrates the whole signal power in a narrow frequency band. In contrast, the spread spectrum signal distributes the signal power over a wide frequency band.}
\end{figure}

\paragraph{Noise-like Signal.}

The signal power remains constant while the signal is spread.
\begin{itemize}
	\item The \ac{PSD} is reduced.
	\item But, the \ac{PSD} is integrated over a wider frequency range.
	\item The overall power remains constant.
\end{itemize}

The \ac{PSD} of the spread spectrum signal is flat in approximation.
\begin{itemize}
	\item The flat \ac{PSD} resembles the \ac{PSD} of noise.
	\item Spread spectrum signal are therefore \emph{noise-like}.
\end{itemize}

A third party who has no knowledge of neither the existence of the spread spectrum signal nor the technology used cannot detect the signal.
\begin{itemize}
	\item The spread spectrum signal looks like noise or a wide-band disturbance from the view of the receiver which does not participate in the communication.
	\item This circumstance can be used to conceal the existence of the signal (plausible deniability of its existence).
\end{itemize}

\paragraph{Despreading.}

\index{despreading} Despreading reconstructs the symbols -- and thereby the data -- from the spread spectrum signal.
\begin{itemize}
	\item The spreading is reversed.
	\item The symbols (time-bandwidth product of $1$) are reconstructed. This can be seen like re-concentrating the spread signal power in a narrow-band symbol sequence.
	\item The disturbances which are uncorrelated to the spread spectrum signal are converted into the wide-band noise with a low \ac{PSD}.
	\begin{itemize}
		\item The wide-band noise floor (like thermal noise or quantization noise) remains wide-band.
		\item Strong but narrow-band disturbing signals (like other users of the electromagnetic spectrum) are spread to low-\acs{PSD} wide-band noise during the despreading. The \ac{SNR} is increased by spreading the signal power of the disturbance.
	\end{itemize}
\end{itemize}

\subsection{Direct-Sequence Spread Spectrum}

A simple method for increasing the bandwidth systematically re-encoding the symbols using new symbols at a higher symbol rate.
\begin{itemize}
	\item The input symbols are at the rate of $f_{sym}$.
	\item The \emph{spreading} is achieved by re-encoding each symbol by $L$ new symbols, called \index{chip} \textbf{chips}.
	\item After re-encoding, the rate of the new symbols -- the \emph{chips} -- is $f_{chp}$. $f_{chp}$ is the \index{chip rate} \textbf{chip rate}. \nomenclature[Sf]{$f_{chp}$}{Chip rate}
	\item $L$ is the \index{spreading factor} \textbf{spreading factor}.
	\begin{equation}
		L = \frac{f_{chp}}{f_{sym}}
	\end{equation}
\end{itemize}

\begin{example}{\acs{IEEE} 802.11b (Wi-Fi)}
	\acs{IEEE} 802.11b is an early \ac{WLAN} standard from 1999, defining data rates of \SI{1}{Mbit/s} to \SI{11}{Mbit/s}.\footnote{In comparison to that, modern \ac{WLAN} standards like \acs{IEEE} 802.11ax have data rates of several \si{Gbit/s}. But they use other spread spectrum technologies.} Usually, the data rate is proportional to the transmission bandwidth. But, \acs{IEEE} 802.11b uses \ac{DSSS} to implement an adaptive data rate whilst retaining a constant bandwidth (approximately \SI{22}{MHz}).
	
	\begin{figure}[H]
		\centering
		\begin{circuitikz}
			\node[mixer](Spreader){};
			\node[draw,block,below=1.5cm of Spreader](Code){Code\\ generator};
			\node[draw,block,right=3cm of Spreader](Mod){\acs{BPSK}\\ modulator};
			
			\node[above=3mm of Spreader,align=center]{Multiplier as\\ the spreader};
			
			\draw[-o] (Spreader.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Input data\\ at $f_{sym}$};
			\draw (Code.north) -- node[midway,right,align=left]{Spreading code\\ at $f_{chip}$} (Spreader.south) node[inputarrow,rotate=90]{};
			\draw (Spreader.east) -- node[midway,above,align=center]{Chip\\ sequence} (Mod.west) node[inputarrow]{};
			\draw (Mod.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{Baseband\\ signal};
		\end{circuitikz}
		\caption{Simplified spreading and \acs{PSK} modulation signal chain of an \acs{IEEE} 802.11b conforming transmitter}
	\end{figure}

	Data is represented by bits. At a data rate of $f_{sym} = \SI{1}{Mbit/s}$, the data is spread by a factor $L = 11$. The data symbols are multiplied by the \emph{spreading code}. Because of the multiplication, the same block symbol as the mixer is used. The code has a \emph{chip rate} of $f_{chp} = L f_{sym} = \SI{11}{Mchp/s}$.\footnote{Physically, the units \si{bit} and \si{chp} are dimension-less. Therefore, $\SI{1}{Mbit/s} = \SI{1}{Mchp/s} = \SI{1}{MHz}$. However, the units shall refer to the quantity being considered.}
	
	\vspace{0.5em}
	
	For $L = 11$, the \index{Barker code} \textbf{Barker code} with $\vect{C}_{11} = \left[+1, +1, +1, -1, -1, -1, +1, -1, -1, +1, -1\right]$ is used as the spreading code. Let's consider a bit stream of $(10)_2$ as th data, which is encoded as the symbols $\vect{D} = \left[-1, +1\right]$. The spread sequence is:
	\begin{equation}
		\begin{split}
			\vect{S} &= \vect{D} \otimes \vect{C}_{11} \\
			 &= \left[\underbrace{-1, -1, -1, +1, +1, +1, -1, +1, +1, -1, +1}_{\text{Spread symbol } -1},\right. \\ &\qquad \left.  \underbrace{+1, +1, +1, -1, -1, -1, +1, -1, -1, +1, -1}_{\text{Spread symbol } +1}\right]
		\end{split}
	\end{equation}
	
	The \emph{chip sequence} $\vect{S}$ is at a rate of \SI{11}{Mchp/s}. In this case, the \emph{chip} have two discrete states $-1$ or $+1$. They can be modulated by a \ac{BPSK} modulator. It baseband is then mixed to the \ac{RF} band of \SI{2.4}{GHz} using an IQ modulator.
	
	\begin{figure}[H]
		\centering
		
		\subfloat[Data symbols]{
			\begin{tikzpicture}
				\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
				\draw[-latex] (0,-1.2) -- (0,1.5) node[left, align=right]{$D[n]$};
				\foreach \y in {-1, 0, +1}{
					\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
				}
				\foreach \x/\t in {5.5/1, 11/2}{
					\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\SI{\t}{\micro{}s}$};
				}
			
				\foreach \x/\n in {0/0, 5.5/1}{
					\draw[latex-latex] (\x,1.1) -- node[midway,above,align=center]{$D[\n]$} ({\x+5.5},1.1);
				}
				
				\draw[red,thick] (0,-1) -- (5.5,-1) -- (5.5,1) -- (11,1);
				
				\draw[latex-latex] (5.5,-1.1) -- node[midway,below,align=center]{$T_{sym} = 1/f_{sym}$} (11,-1.1);
			\end{tikzpicture}
		}
	
		\subfloat[Code chips]{
			\begin{tikzpicture}
				\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
				\draw[-latex] (0,-1.3) -- (0,1.5) node[left, align=right]{$C_l$};
				\foreach \y in {-1, 0, +1}{
					\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
				}
				\foreach \x/\t in {5.5/1, 11/2}{
					\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\SI{\t}{\micro{}s}$};
				}
				
				\draw[blue,thick] (0,0) \foreach \n in {0, 1} {
					\foreach \l/\c in {0/+1, 1/+1, 2/+1, 3/-1, 4/-1, 5/-1, 6/+1, 7/-1, 8/-1, 9/+1, 10/-1}{
						-- ({(\n*5.5)+(\l*0.5)},\c) -- ({(\n*5.5)+(\l*0.5+0.5)},\c)
					}
				};
			
				%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
				%\draw[dashed] (11,-1.2) -- (11,1.2);
				\foreach \n in {0, 1} {
					\foreach \l in {0,1,...,10}{
						\node[anchor=west,rotate=90,align=center] at({((\n*11+\l)*0.5)+0.25},1.2) {\scriptsize $C_{\l}$};
						\draw[dashed] ({((\n*11+\l)+1)*0.5},-1.1) -- ({((\n*11+\l)+1)*0.5},1.2);
					}
				}
			
				\foreach \x/\n in {0/0, 5.5/1}{
					\draw[latex-latex] (\x,-1.2) -- node[midway,below,align=center]{$\vect{C}_L$} ({\x+5.5},-1.2);
				}
			\end{tikzpicture}
		}
	
		\subfloat[Output chips]{
			\begin{tikzpicture}
				\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = m \cdot T_{chp}$};
				\draw[-latex] (0,-1.2) -- (0,1.5) node[left, align=right]{$S[m]$};
				\foreach \y in {-1, 0, +1}{
					\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
				}
				\foreach \x/\t in {5.5/1, 11/2}{
					\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\SI{\t}{\micro{}s}$};
				}
				
				\draw[olive,thick] (0,0) \foreach \n/\d in {0/-1, 1/+1} {
					\foreach \l/\c in {0/+1, 1/+1, 2/+1, 3/-1, 4/-1, 5/-1, 6/+1, 7/-1, 8/-1, 9/+1, 10/-1}{
						-- ({(\n*5.5)+(\l*0.5)},{\c*\d}) -- ({(\n*5.5)+(\l*0.5+0.5)},{\c*\d})
					}
				};
			
				%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
				%\draw[dashed] (11,-1.2) -- (11,1.2);
				\foreach \m in {0,1,...,21}{
					\node[anchor=west,rotate=90,align=center] at({(\m*0.5)+0.25},1.1) {\scriptsize $S[\m]$};
					\draw[dashed] ({(\m+1)*0.5},-1.2) -- ({(\m+1)*0.5},1.2);
				}
			
				\draw[latex-latex] (6,-1.1) -- node[midway,below,align=center]{$T_{chp} = 1/f_{chp}$} (6.5,-1.1);
			\end{tikzpicture}
		}
	
		\caption{Data, spreading code and output chips of IEEE 802.11b symbols at a spreading factor of $L = 11$}
		\label{fig:ch07:wlan_dsss}
	\end{figure}
	
	At a data rate of \SI{11}{Mbit/s}, the data is \underline{not} spread ($L = 1$). The spreading code is $\vect{C}_{1} = \left[+1\right]$. The \emph{chip rate} equals the data bit rate. The \emph{chip rate} remains constant at \SI{11}{Mchp/s}.
	
	\vspace{0.5em}
	
	\textbf{Why adaptive data rate?} Spreading by $L = 11$ increases the \ac{SNR}. Each symbol is effectively repeated 11 times. This circumstance can be used to achieve a processing gain and increase noise immunity. The higher data rate at a lower spreading factor of $L = 1$ comes at the drawback of decreased noise immunity.
\end{example}

The \index{direct-sequence spread spectrum} \textbf{\acf{DSSS}} spreads the symbols by multiplying each data symbol with the whole spreading code.
\begin{itemize}
	\item The data symbol sequence is represented by the vector $\vect{D}$. A single data symbol is $D[n]$. \nomenclature[Sd]{$\vect{D}$}{Data symbol sequence}
	\begin{equation}
		\vect{D} = \left[D[0], D[1], \dots\right]
	\end{equation}
	\item The data comes at the rate of $f_{sym}$.
	\item The code sequence is represented by the $L$-dimensional vector $\vect{C}_L$. $L$ is the length of the code. A single chip of the code is $C_l$. \nomenclature[Sd]{$\vect{C}_L$}{Spreading code for direct-sequence spread spectrum}
	\begin{equation}
		\vect{C} = \left[C_0, C_1, \dots, C_{L-1}\right]
	\end{equation}
	\item The code repeats at $f_{sym}$. The rate of the single code chips is $f_{chp} = L f_{sym}$.
\end{itemize}
The process of multiplying each data symbol $D_n$ with the whole code sequence $\left[C_0, C_1, \dots, C_{L-1}\right]$ is represented by the \index{Kronecker product} \textbf{Kronecker product} $\otimes$. \nomenclature[Fk]{$\otimes$}{Kronecker product}
\begin{equation}
	\begin{split}
		\vect{S} &= \vect{D} \otimes \vect{C}_{L} \\
		S[m] &= S[n L + l] = D[n] \cdot C_l \qquad \forall 0 \leq l < L
	\end{split}
\end{equation}
$\vect{S} = \left[S[0], S[1], \cdots\right]$ is the sequence of output chips -- the \emph{spread spectrum signal}. The chips in $\vect{S}$ are at the chip rate of $f_{chp} = M f_{sym}$. \nomenclature[Ss]{$\vect{S}$}{Chip sequence of a spread spectrum signal}

\begin{figure}[H]
	\centering
	\begin{circuitikz}
		\node[draw,block](Spreader){Spreader\\ $\vect{D} \otimes \vect{C}_{L}$};
		\node[draw,block,below=1.5cm of Spreader](Code){Code\\ generator};
		\node[draw,block,right=2.5cm of Spreader](Mod){Modulation\\ (\acs{BPSK}, \acs{QPSK},\\ \acs{QAM}, ...)};
		
		\draw[-o] (Spreader.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Input symbol\\ sequence $\vect{D}$};
		\draw (Code.north) -- node[midway,right,align=left]{Spreading\\ code $\vect{C}_{L}$} (Spreader.south) node[inputarrow,rotate=90]{};
		\draw (Spreader.east) -- node[midway,above,align=center]{Chip\\ sequence\\ $\vect{S}$} (Mod.west) node[inputarrow]{};
		\draw (Mod.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{Baseband\\ signal};
	\end{circuitikz}
	\caption{Abstract \acs{DSSS}}
	\label{fig:ch07:abstract_dsss}
\end{figure}

Figure \ref{fig:ch07:abstract_dsss} depicts an abstract view on \ac{DSSS}. The \emph{spreading code} is a \index{pseudorandom code} \textbf{pseudorandom code}.
\begin{itemize}
	\item The code is generated by an algorithm and is thereby predictable if the algorithm is known.
	\item For a receiver that does not know the code generation algorithm, the code sequence is random. It is noise-like.
	\item \textit{The fact, that the code must be known to the receiver, can be used to implement data \texttt{}encryption.}
\end{itemize}

Time-bandwidth product:
\begin{itemize}
	\item The bandwidth of the signal is the \emph{chip rate} $f_{chp}$. It is $L$ times the bandwidth of a non-spread symbol.
	\item The symbol period is not touched and remains $T_{sym}$.
	\item The transmission bandwidth of a non-spread symbol $\frac{1}{T_{sym}}$.
	\item The time-bandwidth product is
	\begin{equation}
		T_{sym} \cdot \Delta f_{chp} = T_{sym} \cdot \frac{L}{T_{sym}} = L \gg 1
	\end{equation}
	\item The \ac{DSSS} fulfils the spread spectrum condition.
\end{itemize}

Example usage of \ac{DSSS}:
\begin{itemize}
	\item \acs{IEEE} 802.11b specification for \ac{WLAN}
	\item \ac{GPS}
\end{itemize}

\subsection{Frequency-Hopping Spread Spectrum}

Another straightforward method spreading a signal across the frequency spectrum is transmitting each symbol at another frequency. This technique is called \index{frequency-hopping spread spectrum} \textbf{\acf{FHSS}}.
\begin{itemize}
	\item The frequency band $\Delta f_{FHSS}$ is divided into $M$ \index{sub-band} \textbf{sub-bands} with a bandwidth of $\Delta f_{sub}$. \nomenclature[Sf]{$\Delta f_{sub}$}{Bandwidth of a sub-band}
	\begin{equation}
		\Delta f_{sub} = \frac{\Delta f_{FHSS}}{M}
		\label{eq:ch07:fhss_sub_f}
	\end{equation}
	\item The bandwidth of the sub-band $\Delta f_{sub}$ is the transmission bandwidth of a single, non-spread symbol. $\Delta f_{sub}$ is wide enough to accommodate a symbol.
	\item Each symbol is transmitted in a different sub-band $k$ ($0 \leq k < M$).
	\item The sub-band n is selected according to the certain pattern, which is again called \index{spreading code} \textbf{spreading code}.
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{circuitikz}
		\node[draw,block](Mod){Modulation\\ (\acs{BPSK}, \acs{QPSK},\\ \acs{QAM}, ...)};
		\node[draw,block](Code) at([yshift=-3.5cm]Mod) {Code\\ generator};
		\node[mixer,right=2.5cm of Mod](Mix){};
		\node[oscillator](LO) at([yshift=-3.5cm,xshift=5mm]Mix) {};
		
		\node[right=3mm of LO,align=left]{\acs{LO}};
		
		\draw[-o] (Mod.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Input symbol\\ sequence $\vect{D}$};
		\draw (Mod.east) -- node[midway,above,align=center]{Baseband\\ signal} (Mix.west) node[inputarrow,rotate=0]{};
		\draw (Code.east) -- node[midway,below,align=center]{Spreading\\ code $C_M[n]$} (LO.west) node[inputarrow,rotate=0]{};
		\draw (LO.north) -- node[midway,right,align=left]{Carrier} (Mix.south) node[inputarrow,rotate=90]{};
		\draw (Mix.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{\acs{RF}\\ signal};
	\end{circuitikz}
	\caption{Simplified block diagram of a \acs{FHSS} transmitter}
\end{figure}

Following can be said about the \emph{spreading code}:
\begin{itemize}
	\item The values of the \emph{spreading code} $C_M[n]$ define the sub-band $k$ where the symbol $D_n$ shall be transmitted. \nomenclature[Sd]{$\vect{C}_;$}{Spreading code for time-hopping or frequency-hopping spread spectrum}
	\begin{equation}
		k = C_M[n] \qquad , 0 \leq C_M[n] < M
		\label{eq:ch07:fhss_sub_index}
	\end{equation}
	One code sample $C_M[n]$ corresponds to the data symbol $D[n]$.
	\item The length of the \emph{spreading code} is generally not restricted. It can be repeating. But a repeating pattern is not required.
	\item The rule which generates the \emph{spreading code} (the algorithm) must be known to both the transmitter and receiver.
\end{itemize}

If $f_c$ is the centre frequency of the carrier, the exact transmission frequency $f_{n}$ of the symbol $S_n$ is:
\begin{equation}
	\begin{split}
		f_n &= \underbrace{f_c - \frac{\Delta f_{FHSS}}{2} + \frac{\Delta f_{sub}}{2}}_{\text{Centre frequency of the 1st sub-band}} + \underbrace{k \cdot \Delta f_{sub}}_{\text{Sub-band centre frequency offset}} \\
		 &\quad \text{Using \eqref{eq:ch07:fhss_sub_f} and \eqref{eq:ch07:fhss_sub_index}:} \\
		 &= f_c - \frac{M \cdot \Delta f_{sub}}{2} + \frac{\Delta f_{sub}}{2} + C_M[n] \cdot \Delta f_{sub} \\
		 &= f_c + \Delta f_{sub} \left(\frac{1-M}{2} + C_M[n] \right)
	\end{split}
\end{equation}

\begin{example}{\acs{FHSS}}
	Let's consider an example symbol sequence $\vect{D}$ with a length of $6$. The signal is spread by $M =4$.
	
	The spreading code generated by the algorithm is:
	\begin{equation}
		\vect{C}_4[n] = \left[C_4[0], C_4[1], \dots\right] = \left[1,0,3,2,0,1,\dots\right]
	\end{equation}
	
	The frequency usage can be plotted over time:
	\begin{figure}[H]
		\centering
		\begin{tikzpicture}[x=1cm,y=1cm]
			\draw[-latex] (0,0) -- (6.5,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
			\draw[-latex] (0,0) -- (0,0.4) (0,0.6) -- (0,5.5) node[left, align=right]{$f$};
			\draw (-0.3,0.4) -- (0.3,0.4);
			\draw (-0.3,0.6) -- (0.3,0.6);
			
			\draw (0,3) -- (-0.2,3) node[left,align=right]{$f_c$};
			\draw[latex-latex] (-1,2) -- node[midway,left,align=center,anchor=south,rotate=90]{$\Delta f_{sub}$} (-1,3);
			\draw[latex-latex] (-2,1) -- node[midway,left,align=center,anchor=south,rotate=90]{$\Delta f_{FHSS}$} (-2,5);
			\draw[latex-latex] (1,-0.5) -- node[midway,below,align=center]{$T_{sym} = 1/f_{sym}$} (2,-0.5);
		
			\foreach \k in {0, 1, 2, 3}{
				\draw[dotted] (0,{\k+1}) -- (8,{\k+1});
				\node[right,align=left] at(7,{\k+1.5}) {\small\itshape Sub-band $k = \k$};
			}
			\draw[dotted] (0,5) -- (8,5);
			
			\foreach \n/\c in {0/1, 1/0, 2/3, 3/2, 4/0, 5/1}{
				\node[fill=gray!50, draw=black, minimum size=1cm, anchor=south west] at({\n},{\c+1}) {\footnotesize $D[\n]$};
			}
		\end{tikzpicture}
		\caption[Time-frequency plot of a symbol sequence spread by a \acs{FHSS} with $M = 4$]{Time-frequency plot of a symbol sequence spread by a \acs{FHSS} with $M = 4$. The $M = 4$ sub-bands are distributed around the centre frequency $f_c$. Each sub-band has the bandwidth $\Delta f_{sub}$. The duration of one symbol is $T_{sym}$ (symbol period).}
		\label{fig:ch07:fhss_ex}
	\end{figure}

	Each symbol in Figure \ref{fig:ch07:fhss_ex} is modulated (\ac{BPSK}, \ac{QPSK}, \ac{QAM}, ...).
\end{example}

Time-bandwidth product:
\begin{itemize}
	\item The bandwidth of the signal is $\Delta f_{FHSS} = M \Delta f_{sub}$. It is $M$ times the bandwidth of a non-spread symbol.
	\item The symbol period is not touched and remains $T_{sym}$.
	\item The sub-band bandwidth is the transmission bandwidth of a non-spread symbol $\Delta f_{sub} = \frac{1}{T_{sym}}$.
	\item The time-bandwidth product is
	\begin{equation}
		T_{sym} \cdot \Delta f_{FHSS} = M \gg 1
	\end{equation}
	\item The \ac{FHSS} fulfils the spread spectrum condition.
\end{itemize}

Benefits:
\begin{itemize}
	\item The benefits are the same as for \ac{DSSS} and other \emph{spread spectrum} techniques.
	\item The noise and disturbance immunity is improved.
\end{itemize}

Example usage of \ac{FHSS}:
\begin{itemize}
	\item \acs{IEEE} 802.15.1 (Bluetooth) -- Bluetooth employs a more sophisticated frequency-hopping scheme. The sub-bands are not spaced equally. The sub-band are located in the gaps between the \ac{WLAN} bands in the \SI{2.4}{GHz} band. This reduces the mutual interference of Bluetooth and \ac{WLAN}. Both services can coexists with minimum disturbance.
\end{itemize}

\subsection{Time-Hopping Spread Spectrum}

A third way of spreading the signal power across the frequency is shortening the symbol width $T_{chp}$ while keeping time symbol repetition period $T_{sym}$ constant. This technique is called \index{time-hopping spread spectrum} \textbf{\acf{THSS}}.
\begin{itemize}
	\item The transmission bandwidth is increased to $f_{sym} = \frac{1}{T_{chp}}$.
	\item The symbol is now a pulse -- called \index{chip} \textbf{chip} -- in the time-domain with a width of $T_{chp}$. A rest of the time portion, until the next symbol is transmitted, is zero.
	\item The pulse/symbol width is related to the symbol period $T_{sym}$.
	\begin{equation}
		T_{sym} = M \cdot T_{chp}
	\end{equation}
	\item The time-bandwidth product is
	\begin{equation}
		T_{sym} f_{sym} = M T_{chp} \frac{1}{T_{chp}} = M \gg 1
	\end{equation}
	The requirement for \emph{spread spectrum} signals is fulfilled.
\end{itemize}

The shortened pulse is then shifted in time.
\begin{itemize}
	\item The symbol period $T_{sym}$ is divided into $M$ time slots of equal length $T_{chp} = \frac{T_{sym}}{M}$.
	\item The shortened symbol is shifted to the $n$-th time slot.
	\item The values of the \emph{spreading code} $C_M[n]$ define the time slot $m$ (pulse position) where the pulse of the symbol $D_n$ shall be transmitted.
	\begin{equation}
		m = C_M[n] \qquad , 0 \leq C_M[n] < M
		\label{eq:ch07:thss_sub_index}
	\end{equation}
	One code sample $C_M[n]$ corresponds to the data symbol $D[n]$.
	\item The length of the \emph{spreading code} is generally not restricted. It can be repeating. But a repeating pattern is not required.
	\item The rule which generates the \emph{spreading code} (the algorithm) must be known to both the transmitter and receiver.
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{circuitikz}
		\node[draw,block](Mod){Modulation\\ (\acs{BPSK}, \acs{QPSK},\\ \acs{QAM}, ...)};
		\node[draw,block,right=1.5cm of Mod](Shifter){Time-shifter\\ and pulse shaper};
		\node[draw,block,below=2cm of Shifter](Code){Code\\ generator};
		
		\draw[-o] (Mod.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Input symbol\\ sequence $\vect{D}$};
		\draw (Mod.east) -- (Shifter.west) node[inputarrow,rotate=0]{};
		\draw (Code.north) -- node[midway,right,align=left]{Spreading\\ code $C_M[n]$} (Shifter.south) node[inputarrow,rotate=90]{};
		\draw (Shifter.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{Baseband signal\\ (chip sequence $\vect{S}$)};
	\end{circuitikz}
	\caption[Simplified block diagram of a \acs{THSS} transmitter]{Simplified block diagram of a \acs{THSS} transmitter. The time-shifter and pulse shaper play a key role. The pulse shaper forms the shortened pulse with a width of $T_{chp} = \frac{T_{sym}}{M}$. The time-shifter shifts the pulse to the $C_n$-th time slot.}
\end{figure}

The output chip sequence $\vect{S} = \left[S[0], S[1], \dots\right]$ is at the rate $f_{chp} = M \cdot f_{sym}$. It is defined by:
\begin{equation}
	S[m] = S[n M + l] = \begin{cases}
		D[n] &\quad \text{if } l = C_M[n], \\
		0 &\quad \text{if } l \neq C_M[n].
	\end{cases}
\end{equation}

\begin{example}{\acs{THSS}}
	A data symbol sequence is spread by the spreading code:
	\begin{equation}
		\vect{C}_4[n] = \left[C_4[0], C_4[1], \dots\right] = \left[1,3,\dots\right]
	\end{equation}
	
	\begin{figure}[H]
		\centering
		
		\subfloat[Data symbols]{
			\begin{tikzpicture}[x=1cm,y=1cm]
				\draw[-latex] (0,0) -- (9,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
				\draw[-latex] (0,0) -- (0,2.5) node[left, align=right]{$D[n]$};
				\foreach \x/\t in {4/1, 8/2}{
					\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
				}
			
				\foreach \n in {0, 1}{
					\node[fill=gray!50, draw=black, minimum width=4cm, minimum height=2cm, anchor=south west] at({\n*4},0) {$D[\n]$};
				}
			\end{tikzpicture}
		}
	
		\subfloat[Spreading code]{
			\begin{tikzpicture}
				\draw[-latex] (0,0) -- (9,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
				\draw[-latex] (0,0) -- (0,2.5) node[left, align=right]{$C_4[n]$};
				\foreach \x/\t in {4/1, 8/2}{
					\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
				}
				
				\foreach \n/\c in {0/1, 1/3}{
					\node[fill=gray!50, draw=black, minimum width=4cm, minimum height=2cm, anchor=south west] at({\n*4},0) {$C_4[\n] = \c$};
				}
			\end{tikzpicture}
		}
		
		\subfloat[Output chips]{
			\begin{tikzpicture}
				\draw[-latex] (0,0) -- (9,0) node[below right, align=left]{$t = m \cdot T_{chp}$};
				\draw[-latex] (0,0) -- (0,2.5) node[left, align=right]{$S[m]$};
				\foreach \x/\t in {4/1, 8/2}{
					\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
				}
			
				\foreach \n in {0, 1}{
					\foreach \m in {1, 2, 3, 4}{
						\draw[dashed] ({(\n*4)+(\m)},0) -- ({(\n*4)+(\m)},2.5);
					}
				}
			
				\foreach \n/\c in {0/1, 1/3}{
					\node[fill=gray!50, draw=black, minimum width=1cm, minimum height=2cm, anchor=south west] at({(\n*4)+(\c)},0) {\footnotesize $D[\n]$};
				}
			
				\draw[latex-latex] (1,2.4) -- node[midway,above,align=center]{$T_{chp} = 1/f_{chp}$} (2,2.4);
			\end{tikzpicture}
		}
		
		\caption[\ac{THSS} signal]{\ac{THSS} signal. The symbol is shortened to a chip whose position is chosen by the spreading code.}
	\end{figure}
\end{example}

Benefits are the same as in other spread spectrum techniques. The noise immunity is improved.

Example usage of \ac{THSS}:
\begin{itemize}
	\item \ac{UWB} systems conforming to \acs{IEEE} 802.15.4
\end{itemize}

\subsection{Symbol Reconstruction}

\index{despreading} \textbf{Despreading} reconstructs the symbol sequence from the received \emph{spread spectrum} signal.

A despreader uses a cross-correlator to detect the spread symbols in the received signal. Remember that this is one of the purposes of cross-correlation.
\begin{itemize}
	\item The received signal is correlated with the \emph{spreading code}.
	\item The symbols spread with the same \emph{spreading code} can thereby be detected in the received signal.
\end{itemize}

\begin{remark}
	You may wonder why the autocorrelation is not used. Both receiver and transmitter use the same \emph{spreading code}. In deed, this a common misunderstanding. The received signal is different from the code and from the transmitted signal. The received signal contains noise and is subject to the transfer function of the transmission channel.
\end{remark}

\begin{figure}[H]
	\centering
	\begin{adjustbox}{scale=0.7}
		\begin{circuitikz}
			\node[draw,block](Demod){Demodulation\\ (\acs{BPSK}, \acs{QPSK},\\ \acs{QAM}, ...)};
			\node[draw,block,right=3cm of Demod](Corr){Cross corelation};
			\node[draw,block,below=1.5cm of Corr](Code){Code\\ generator};
			\node[draw,block,right=1.5cm of Corr](Det){Detector};
			
			\draw[-o] (Demod.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Received signal $r(t)$};
			\draw (Code.north) -- node[midway,right,align=left]{Spreading\\ code $\vect{C}$} (Corr.south) node[inputarrow,rotate=90]{};
			\draw (Demod.east) -- node[midway,above,align=center]{Received chip\\ sequence $\vect{R}$} (Corr.west) node[inputarrow]{};
			\draw (Corr.east) -- node[midway,above,align=center]{$\mathrm{R}_{RC}$} (Det.west) node[inputarrow]{};
			\draw (Det.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{Data};
		\end{circuitikz}
	\end{adjustbox}
	\caption{Abstract despreader using a cross-correlator}
	\label{fig:ch07:abstract_spreader}
\end{figure}

\subsubsection{Despreading of DSSS Signals}

\begin{figure}[H]
	\centering
	\begin{adjustbox}{scale=0.7}
		\begin{circuitikz}
			\node[draw,block](Demod){Demodulation\\ (\acs{BPSK}, \acs{QPSK},\\ \acs{QAM}, ...)};
			\node[mixer,right=3cm of Demod](Mul){};
			\node[draw,block,right=1cm of Mul](Acc){Accumulator};
			\node[draw,block,below=2cm of Mul](Code){Code\\ generator};
			\node[draw,block,right=1cm of Acc](Det){Detector};
			
			\node[above=3mm of Mul,align=center]{Multiplier as\\ despreader};
			
			\draw[-o] (Demod.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Received signal $r(t)$};
			\draw (Code.north) -- node[midway,right,align=left]{Spreading\\ code $\vect{C}_L$} (Mul.south) node[inputarrow,rotate=90]{};
			\draw (Demod.east) -- node[midway,below,align=center]{Received chips\\ $\vect{R}$} (Mul.west) node[inputarrow]{};
			\draw (Mul.east) -- (Acc.west) node[inputarrow]{};
			\draw (Acc.east) -- (Det.west) node[inputarrow]{};
			\draw (Det.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{Data};
			
			\draw[dashed] ([shift={(5mm,2cm)}]Acc.north east) node[anchor=south east,align=right]{Cross-correlation} -- ++(0,-3.5cm) -- ++(-7cm,0) -- ++(0,3.5cm) -- cycle;
		\end{circuitikz}
	\end{adjustbox}
	\caption{Simplified \acs{DSSS} despreader}
	\label{fig:ch07:abstract_dsss_spreader}
\end{figure}

\begin{itemize}
	\item The spreading, which was a multiplication of the data with the \emph{spreading code}, is reversed by multiplying the received chips again with the \emph{spreading code}.
	\item The accumulation then sums up the correlated chips.
	\item When the full code length has been accumulated:
	\begin{itemize}
		\item The detector decides which data symbol is received based on the correlator output.
		\item The correlator is reset in order to receive the next symbol.
	\end{itemize}
\end{itemize}

Let's consider three situations based on the IEEE 802.11b examples (Figure \ref{fig:ch07:wlan_dsss}):
\begin{itemize}
	\item Reception of a noise-free signal
	\item Reception of pure noise
	\item Reception of a noisy signal
\end{itemize}

\begin{figure}[H]
	\centering
	
	\subfloat[Received chips]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = m \cdot T_{chp}$};
		\draw[-latex] (0,-1.2) -- (0,1.5) node[left, align=right]{$R[m]$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[olive,thick] (0,0) \foreach \n/\d in {0/-1, 1/+1} {
			\foreach \l/\c in {0/+1, 1/+1, 2/+1, 3/-1, 4/-1, 5/-1, 6/+1, 7/-1, 8/-1, 9/+1, 10/-1}{
				-- ({(\n*5.5)+(\l*0.5)},{\c*\d}) -- ({(\n*5.5)+(\l*0.5+0.5)},{\c*\d})
			}
		};
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \m in {0,1,...,21}{
			\node[anchor=west,rotate=90,align=center] at({(\m*0.5)+0.25},1.1) {\scriptsize $R[\m]$};
			\draw[dashed] ({(\m+1)*0.5},-1.2) -- ({(\m+1)*0.5},1.2);
		}
		
		\draw[latex-latex] (6,-1.1) -- node[midway,below,align=center]{$T_{chp} = 1/f_{chp}$} (6.5,-1.1);
		\end{tikzpicture}
	}
	
	\subfloat[Code chips]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.3) -- (0,1.5) node[left, align=right]{$C_l$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[blue,thick] (0,0) \foreach \n in {0, 1} {
			\foreach \l/\c in {0/+1, 1/+1, 2/+1, 3/-1, 4/-1, 5/-1, 6/+1, 7/-1, 8/-1, 9/+1, 10/-1}{
				-- ({(\n*5.5)+(\l*0.5)},\c) -- ({(\n*5.5)+(\l*0.5+0.5)},\c)
			}
		};
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \n in {0, 1} {
			\foreach \l in {0,1,...,10}{
				\node[anchor=west,rotate=90,align=center] at({((\n*11+\l)*0.5)+0.25},1.2) {\scriptsize $C_{\l}$};
				\draw[dashed] ({((\n*11+\l)+1)*0.5},-1.1) -- ({((\n*11+\l)+1)*0.5},1.2);
			}
		}
		
		\foreach \x/\n in {0/0, 5.5/1}{
			\draw[latex-latex] (\x,-1.2) -- node[midway,below,align=center]{$\vect{C}_L$} ({\x+5.5},-1.2);
		}
		\end{tikzpicture}
	}
	
	\subfloat[Accumulation of cross-correlation. The grey circles are the sampling (detection) and reset points.]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.3) -- (0,1.5) node[left, align=right]{$\sum \mathrm{R}_{RC}$};
		\foreach \y/\v in {-1/-11, 0, +1/+11}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\v$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[green,thick] (0,0) -- ++(5.5,-1);
		\draw[fill=gray!50,draw] (5.5,-1) ++(0:0.1) arc(0:360:0.1);
		\draw[green,thick] (5.5,0) -- ++(5.5,1);
		\draw[fill=gray!50,draw] (11,1) ++(0:0.1) arc(0:360:0.1);
		
		\foreach \y in {-0.5,0.5}{
			\draw[orange] (0,\y) -- (11,\y) node[anchor=south east,align=right]{Data detection threshold};
		}
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \n in {0, 1} {
			\foreach \l in {0,1,...,10}{
				%\node[anchor=west,rotate=90,align=center] at({((\n*11+\l)*0.5)+0.25},1.2) {\scriptsize $C_{\l}$};
				\draw[dashed] ({((\n*11+\l)+1)*0.5},-1.1) -- ({((\n*11+\l)+1)*0.5},1.2);
			}
		}
		\end{tikzpicture}
	}
	
	\subfloat[Data symbols]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.2) -- (0,1.5) node[left, align=right]{$D[n]$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\foreach \x/\n in {0/0, 5.5/1}{
			\draw[latex-latex] (\x,1.1) -- node[midway,above,align=center]{$D[\n]$} ({\x+5.5},1.1);
		}
		
		\draw[red,thick] (0,-1) -- (5.5,-1) -- (5.5,1) -- (11,1);
		\end{tikzpicture}
	}
	
	\caption{Despreading of a noise-free \acs{DSSS} signal}
\end{figure}

\begin{figure}[H]
	\centering
	
	\subfloat[Received chips]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = m \cdot T_{chp}$};
		\draw[-latex] (0,-1.2) -- (0,1.5) node[left, align=right]{$R[m]$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[olive,thick] (0,0) \foreach \m/\r in {0/-1, 1/-1, 2/+1, 3/+1, 4/-1, 5/-1, 6/-1, 7/+1, 8/+1, 9/+1, 10/+1, 11/-1, 12/+1, 13/+1, 14/+1, 15/+1, 16/-1, 17/-1, 18/-1, 19/+1, 20/+1, 21/-1}{
				-- ({(\m*0.5)},{\r}) -- ({(\m*0.5+0.5)},{\r})
		};
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \m in {0,1,...,21}{
			\node[anchor=west,rotate=90,align=center] at({(\m*0.5)+0.25},1.1) {\scriptsize $R[\m]$};
			\draw[dashed] ({(\m+1)*0.5},-1.2) -- ({(\m+1)*0.5},1.2);
		}
		
		\draw[latex-latex] (6,-1.1) -- node[midway,below,align=center]{$T_{chp} = 1/f_{chp}$} (6.5,-1.1);
		\end{tikzpicture}
	}
	
	\subfloat[Code chips]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.3) -- (0,1.5) node[left, align=right]{$C_l$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[blue,thick] (0,0) \foreach \n in {0, 1} {
			\foreach \l/\c in {0/+1, 1/+1, 2/+1, 3/-1, 4/-1, 5/-1, 6/+1, 7/-1, 8/-1, 9/+1, 10/-1}{
				-- ({(\n*5.5)+(\l*0.5)},\c) -- ({(\n*5.5)+(\l*0.5+0.5)},\c)
			}
		};
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \n in {0, 1} {
			\foreach \l in {0,1,...,10}{
				\node[anchor=west,rotate=90,align=center] at({((\n*11+\l)*0.5)+0.25},1.2) {\scriptsize $C_{\l}$};
				\draw[dashed] ({((\n*11+\l)+1)*0.5},-1.1) -- ({((\n*11+\l)+1)*0.5},1.2);
			}
		}
		
		\foreach \x/\n in {0/0, 5.5/1}{
			\draw[latex-latex] (\x,-1.2) -- node[midway,below,align=center]{$\vect{C}_L$} ({\x+5.5},-1.2);
		}
		\end{tikzpicture}
	}
	
	\subfloat[Accumulation of cross-correlation. The grey circles are the sampling (detection) and reset points.]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.3) -- (0,1.5) node[left, align=right]{$\sum \mathrm{R}_{RC}$};
		\foreach \y/\v in {-1/-11, 0, +1/+11}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\v$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[green,thick] (0,0) \foreach \v in {-1,-1,+1,-1,+1,+1,+1,-1,-1,+1,-1}{ -- ++(0.5,{\v/11})};
		\draw[fill=gray!50,draw] (5.5,{-1/11}) ++(0:0.1) arc(0:360:0.1);
		\draw[green,thick] (5.5,0) \foreach \v in {-1,+1,+1,-1,-1,+1,-1,+1,-1,+1,+1}{ -- ++(0.5,{\v/11})};
		\draw[fill=gray!50,draw] (11,{+1/11}) ++(0:0.1) arc(0:360:0.1);
		
		\foreach \y in {-0.5,0.5}{
			\draw[orange] (0,\y) -- (11,\y) node[anchor=south east,align=right]{Data detection threshold};
		}
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \n in {0, 1} {
			\foreach \l in {0,1,...,10}{
				%\node[anchor=west,rotate=90,align=center] at({((\n*11+\l)*0.5)+0.25},1.2) {\scriptsize $C_{\l}$};
				\draw[dashed] ({((\n*11+\l)+1)*0.5},-1.1) -- ({((\n*11+\l)+1)*0.5},1.2);
			}
		}
		\end{tikzpicture}
	}
	
	\subfloat[Data symbols]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.2) -- (0,1.5) node[left, align=right]{$D[n]$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[red,thick] (0,0) -- node[midway,above,align=center]{No data} (11,0);
		\end{tikzpicture}
	}
	
	\caption{\acs{DSSS} despreading of pure noise}
\end{figure}

\begin{figure}[H]
	\centering
	
	\subfloat[Received chips]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = m \cdot T_{chp}$};
		\draw[-latex] (0,-1.2) -- (0,1.5) node[left, align=right]{$R[m]$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
	
		\draw[olive,thick] (0,0) \foreach \m/\r in {0/-1, 1/-1, 2/-1, 3/-1, 4/+1, 5/+1, 6/-1, 7/+1, 8/+1, 9/+1, 10/+1, 11/+1, 12/+1, 13/+1, 14/-1, 15/+1, 16/-1, 17/-1, 18/-1, 19/-1, 20/+1, 21/-1}{
			-- ({(\m*0.5)},{\r}) -- ({(\m*0.5+0.5)},{\r})
		};
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \m in {0,1,...,21}{
			\node[anchor=west,rotate=90,align=center] at({(\m*0.5)+0.25},1.1) {\scriptsize $R[\m]$};
			\draw[dashed] ({(\m+1)*0.5},-1.2) -- ({(\m+1)*0.5},1.2);
		}
		
		\draw[latex-latex] (6,-1.1) -- node[midway,below,align=center]{$T_{chp} = 1/f_{chp}$} (6.5,-1.1);
		\end{tikzpicture}
	}
	
	\subfloat[Code chips]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.3) -- (0,1.5) node[left, align=right]{$C_l$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[blue,thick] (0,0) \foreach \n in {0, 1} {
			\foreach \l/\c in {0/+1, 1/+1, 2/+1, 3/-1, 4/-1, 5/-1, 6/+1, 7/-1, 8/-1, 9/+1, 10/-1}{
				-- ({(\n*5.5)+(\l*0.5)},\c) -- ({(\n*5.5)+(\l*0.5+0.5)},\c)
			}
		};
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \n in {0, 1} {
			\foreach \l in {0,1,...,10}{
				\node[anchor=west,rotate=90,align=center] at({((\n*11+\l)*0.5)+0.25},1.2) {\scriptsize $C_{\l}$};
				\draw[dashed] ({((\n*11+\l)+1)*0.5},-1.1) -- ({((\n*11+\l)+1)*0.5},1.2);
			}
		}
		
		\foreach \x/\n in {0/0, 5.5/1}{
			\draw[latex-latex] (\x,-1.2) -- node[midway,below,align=center]{$\vect{C}_L$} ({\x+5.5},-1.2);
		}
		\end{tikzpicture}
	}
	
	\subfloat[Accumulation of cross-correlation. The grey circles are the sampling (detection) and reset points.]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.3) -- (0,1.5) node[left, align=right]{$\sum \mathrm{R}_{RC}$};
		\foreach \y/\v in {-1/-11, 0, +1/+11}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\v$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\draw[green,thick] (0,0) \foreach \v in {-1,-1,-1,+1,-1,-1,-1,-1,-1,+1,-1}{ -- ++(0.5,{\v/11})};
		\draw[fill=gray!50,draw] (5.5,{-7/11}) ++(0:0.1) arc(0:360:0.1);
		\draw[green,thick] (5.5,0) \foreach \v in {+1,+1,+1,+1,-1,+1,-1,+1,+1,+1,+1}{ -- ++(0.5,{\v/11})};
		\draw[fill=gray!50,draw] (11,{+7/11}) ++(0:0.1) arc(0:360:0.1);
		
		\foreach \y in {-0.5,0.5}{
			\draw[orange] (0,\y) -- (11,\y) node[anchor=south east,align=right]{Data detection threshold};
		}
		
		%\draw[dashed] (5.5,-1.2) -- (5.5,1.2);
		%\draw[dashed] (11,-1.2) -- (11,1.2);
		\foreach \n in {0, 1} {
			\foreach \l in {0,1,...,10}{
				%\node[anchor=west,rotate=90,align=center] at({((\n*11+\l)*0.5)+0.25},1.2) {\scriptsize $C_{\l}$};
				\draw[dashed] ({((\n*11+\l)+1)*0.5},-1.1) -- ({((\n*11+\l)+1)*0.5},1.2);
			}
		}
		\end{tikzpicture}
	}
	
	\subfloat[Data symbols]{
		\begin{tikzpicture}
		\draw[-latex] (0,0) -- (12,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,-1.2) -- (0,1.5) node[left, align=right]{$D[n]$};
		\foreach \y in {-1, 0, +1}{
			\draw (0,\y) -- (-0.2,\y) node[left,align=right]{$\y$};
		}
		\foreach \x/\t in {5.5/1, 11/2}{
			\draw (\x,0) -- (\x,-0.2) node[below,align=center]{$\t T_{sym}$};
		}
		
		\foreach \x/\n in {0/0, 5.5/1}{
			\draw[latex-latex] (\x,1.1) -- node[midway,above,align=center]{$D[\n]$} ({\x+5.5},1.1);
		}
		
		\draw[red,thick] (0,-1) -- (5.5,-1) -- (5.5,1) -- (11,1);
		\end{tikzpicture}
	}
	
	\caption[Despreading of a noisy \acs{DSSS} signal]{Despreading of a noisy \acs{DSSS} signal. The noise shows up as flipped chips in the received chip sequence.}
\end{figure}


\subsubsection{Processing Gain}

In fact, the \ac{DSSS} despreading consists of
\begin{itemize}
	\item \textbf{Down-sampling}: The received and cross-correlated chips are down-sampled by $L$, the length of the \emph{spreading code} length.
	\item \textbf{Filtering}: The accumulator is in fact a \ac{FIR} low-pass filter.
\end{itemize}

The \emph{down-sampling} provides a \index{processing gain} \textbf{processing gain} of $L$.
\begin{itemize}
	\item The processing gain improves the \ac{SNR} by $+ \SI{10}{dB} \cdot \log_{10} \left(L\right)$.
	\item The spread spectrum signal is more immune against noise.
\end{itemize}

\begin{fact}
	Despreading of spread spectrum signals provides a processing gain.
\end{fact}

The processing gain is not only limited to wide-band (\ac{AWGN}, thermal, quantization, etc. noise). Narrow-band disturbances are suppressed as long as they are uncorrelated with the \emph{spreading code}. The cross-correlation has only a peak when the code matches and will be low if the code does not match. So, all uncorrelated superimposed signals can be removed. This is the strength of spread spectrum techniques.

\begin{figure}[H]
	\centering
	
	\subfloat[\acs{PSD} of the received signal \textbf{before} despreading]{
		\centering
		\begin{tikzpicture}
			\begin{axis}[
					height={0.15\textheight},
					width=0.8\linewidth,
					scale only axis,
					xlabel={$\omega$},
					ylabel={$|\mathrm{S}_{RR}|$},
					%grid style={line width=.6pt, color=lightgray},
					%grid=both,
					grid=none,
					legend pos=north east,
					axis y line=middle,
					axis x line=middle,
					every axis x label/.style={
						at={(ticklabel* cs:1.05)},
						anchor=north,
					},
					every axis y label/.style={
						at={(ticklabel* cs:1.05)},
						anchor=east,
					},
					xmin=0,
					xmax=10.5,
					ymin=0,
					ymax=1.2,
					xtick={0},
					xticklabels={0},
					ytick={0},
					axis x discontinuity=parallel,
				]
					\addplot[red, smooth] coordinates {(2,0) (2.5,0.01) (3,0.05) (5,0.05) (7,0.05) (7.5,0.01) (8,0)};
					\addlegendentry{Spread spectrum signal};
					\addplot[blue, smooth] coordinates {(4.6,0) (4.7,0.02) (4.8,0.2) (4.9,0.71) (5,1) (5.1,0.71) (5.2,0.2) (5.3,0.02) (5.4,0)};
					\addlegendentry{Narrow-band noise};
					\addplot[green, smooth] coordinates {(0,0.03) (10,0.03)};
					\addlegendentry{Wide-band noise};
			\end{axis}
		\end{tikzpicture}
	}

	\subfloat[\acs{PSD} of the received signal \textbf{after} despreading]{
		\centering
		\begin{tikzpicture}
			\begin{axis}[
				height={0.15\textheight},
				width=0.8\linewidth,
				scale only axis,
				xlabel={$\omega$},
				ylabel={$|\mathrm{S}_{\tilde{R}\tilde{R}}|$},
				%grid style={line width=.6pt, color=lightgray},
				%grid=both,
				grid=none,
				legend pos=north east,
				axis y line=middle,
				axis x line=middle,
				every axis x label/.style={
					at={(ticklabel* cs:1.05)},
					anchor=north,
				},
				every axis y label/.style={
					at={(ticklabel* cs:1.05)},
					anchor=east,
				},
				xmin=0,
				xmax=10.5,
				ymin=0,
				ymax=1.2,
				xtick={0},
				xticklabels={0},
				ytick={0},
				axis x discontinuity=parallel,
			]
				\addplot[red, smooth] coordinates {(4.6,0) (4.7,0.02) (4.8,0.2) (4.9,0.71) (5,1) (5.1,0.71) (5.2,0.2) (5.3,0.02) (5.4,0)};
				\addlegendentry{Spread spectrum signal};
				\addplot[blue, smooth] coordinates {(2,0) (2.5,0.01) (3,0.05) (5,0.05) (7,0.05) (7.5,0.01) (8,0)};
				\addlegendentry{Narrow-band noise};
				\addplot[green, smooth] coordinates {(0,0.03) (10,0.03)};
				\addlegendentry{Wide-band noise};
				
				\draw[latex-latex] (axis cs:4,0.05) -- node[midway,left,align=right]{Improved \acs{SNR}} (axis cs:4,1);
			\end{axis}
		\end{tikzpicture}
	}

	\caption[Processing gain of despreading]{Processing gain of despreading. The received signal is composed of the spread spectrum signal and two noise components (narrow-band and wide-band noise). After despreading the spread spectrum signal is reconstructed while both (uncorrelated) narrow-band and wide-band noise are attenuated. Despreading spreads the \acs{PSD} of the narrow-band noise, while the \ac{PSD} of the wide-band noise is not changed. The narrow-band noise does not interfere, even if it at the centre frequency of the spread spectrum signal like in this case.}
\end{figure}

\section{Multi-carrier Modulation}

Multi-carrier modulation is a spread spectrum technique, which does not only increase the bandwidth whilst keeping the data rate constant. Multi-carrier modulation is related to \ac{FHSS}, but does not implement a hopping scheme. Instead, all sub-band are used, to transmit $M$ data streams parallelly.

\begin{itemize}
	\item The (serial) sequence of data symbols is parallelized.
	\item The $M$ parallel symbol streams are then modulated independently.
	\item Each modulated symbol stream is then transmitted in another sub-band.
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{adjustbox}{scale=0.8}
		\begin{circuitikz}
			\node[draw,block,minimum height=6cm](SP){Serial-to-\\ parallel};
			\node[adder,right=8cm of SP](Add){};
			
			\draw[-o] (SP.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Data stream $\vect{D}$};
			
			\foreach \n/\y in {1/2.5, 2/1, M/-2.5}{
				\draw ([yshift={\y cm}]SP.east) -- ++(1cm,0) node[inputarrow]{} node[draw,block,anchor=west](Mod\n){Modulator \n};
				\draw (Mod\n.east) -- ++(1cm,0) node[inputarrow]{} node[mixer,anchor=west](Mix\n){};
			}
		
			\node[above=5mm of Mix1,align=center]{Sub-band\\ mixers};
		
			\draw (Mix1.east) -| (Add.north) node[inputarrow,rotate=-90]{};
			\draw (Mix2.east) -| (Add.north);
			\draw (MixM.east) -| (Add.south) node[inputarrow,rotate=90]{};
			
			\draw[draw=none] (Mod2.south) -- node[midway]{$\vdots$} (ModM.north);
		
			\draw (Add.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{Multi-carrier\\ signal};
		\end{circuitikz}
	\end{adjustbox}
	\caption{Multi-carrier modulator}
\end{figure}

\begin{itemize}
	\item If the rate of the input symbols is $f_{sym}$, the symbol rate in each of the $M$ parallel streams is $f_{sym,M}$. \nomenclature[Sf]{$f_{sym,M}$}{Symbol rate in one of the $M$ sub-bands}
	\begin{equation}
		f_{sym,M} = \frac{f_{sym}}{M}
	\end{equation}
	\item The symbol period in each sub-band is $M$ times longer. \nomenclature[Sf]{$T_{sym,M}$}{Symbol period in one of the $M$ sub-bands}
	\begin{equation}
		T_{sym,M} = M \cdot T_{sym}
	\end{equation}
	\item The bandwidth of one sub-band is approximately $\Delta f_{sub} \approx f_{sym,M}$.
	\item The total bandwidth $\Delta f_{MC}$ of all sub-bands together is approximately $\Delta f_{MC} = M \cdot \Delta f_{sub} \approx f_{sym}$.
	\item The duration of one transmitted symbol is $T_{sym,M}$.
	\item the \emph{time-bandwidth product} is
	\begin{equation}
		\Delta f_{MC} \cdot T_{sym,M} = M \gg 1
	\end{equation}
	The condition for a spread spectrum signal is fulfilled.
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}[x=1cm,y=1cm]
		\draw[-latex] (0,0) -- (6.5,0) node[below right, align=left]{$t = n \cdot T_{sym}$};
		\draw[-latex] (0,0) -- (0,0.4) (0,0.6) -- (0,5.5) node[left, align=right]{$f$};
		\draw (-0.3,0.4) -- (0.3,0.4);
		\draw (-0.3,0.6) -- (0.3,0.6);
		
		\draw (0,3) -- (-0.2,3) node[left,align=right]{$f_c$};
		\draw[latex-latex] (-1,2) -- node[midway,left,align=center,anchor=south,rotate=90]{$\Delta f_{sub}$} (-1,3);
		\draw[latex-latex] (-2,1) -- node[midway,left,align=center,anchor=south,rotate=90]{$\Delta f_{MC}$} (-2,5);
		\draw[latex-latex] (2,-0.5) -- node[midway,below,align=center]{$T_{sym,M} = M/f_{sym}$} (4,-0.5);
		
		\foreach \k in {0, 1, 2, 3}{
			\draw[dotted] (0,{\k+1}) -- (8,{\k+1});
			\node[right,align=left] at(7,{\k+1.5}) {\small\itshape Sub-band $k = \k$};
		}
		\draw[dotted] (0,5) -- (8,5);
		
		\foreach \n/\x/\k in {0/0/0, 1/0/1, 2/0/2, 3/0/3, 4/1/0, 5/1/1, 6/1/2, 7/1/3, 8/2/0, 9/2/1, 10/2/2, 11/2/3}{
			\node[fill=gray!50, draw=black, minimum height=1cm, minimum width=2cm, anchor=south west] at({\x*2},{\k+1}) {\footnotesize $D[\n]$};
		}
	\end{tikzpicture}
	\caption[Time-frequency plot: distribution of symbols in an $M$-ary multi-carrier modulation (with $M = 4$)]{Time-frequency plot: distribution of symbols in an $M$-ary multi-carrier modulation (with $M = 4$). $M$ symbols can be transmitted parallelly. The symbol rate is reduced proportionally.}
	\label{fig:ch07:mulcarr_mod_spectrum}
\end{figure}

\subsection{Inter-Carrier Interference}

The \emph{\ac{ISI}} was an issue in the time-domain.
\begin{itemize}
	\item Neighbouring symbols interfered if no guard interval was inserted.
	\item The reason was the band limitation of the symbols, which flattened the ideal, rectangular slopes of the symbols in the time-domain.
\end{itemize}

Due to the duality of time-domain and frequency-domain, an analogous problem arises in the frequency domain -- the \index{inter-carrier interference} \textbf{inter-carrier interference}.
\begin{itemize}
	\item Symbols are assumed to be ideal. They have a rectangular shape.
	\item Their Fourier transform is a sinc-function, whose \ac{PSD} spreads across the infinite frequency range.
	\item The side lobes of neighbouring sinc-functions would overlap. A symbol in one sub-band would interfere with its neighbouring sub-bands.
	\item \textbf{A \emph{guard band} must be inserted to reduce the interference.}
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}
		\begin{axis}[
			height={0.15\textheight},
			width=0.7\linewidth,
			scale only axis,
			xlabel={$f$},
			ylabel={Sub-bands},
			%grid style={line width=.6pt, color=lightgray},
			%grid=both,
			grid=none,
			legend pos=outer north east,
			axis y line=middle,
			axis x line=middle,
			every axis x label/.style={
				at={(ticklabel* cs:1.05)},
				anchor=north,
			},
			every axis y label/.style={
				at={(ticklabel* cs:1.05)},
				anchor=east,
			},
			xmin=-0.5,
			xmax=8.5,
			ymin=0,
			ymax=1.7,
			%xtick={0,0.125,...,1},
			%xticklabels={$- \omega_S$, $- \frac{\omega_S}{2}$, $0$, $\frac{\omega_S}{2}$, $\omega_S$},
			%ytick={0},
		]
			\addplot[blue,smooth] coordinates {(-1.5,0) (0,0.5) (0.5,0.85) (1,1) (1.5,0.85) (2,0.5) (3.5,0)};
			\addplot[red,smooth] coordinates {(0.5,0) (2,0.5) (2.5,0.85) (3,1) (3.5,0.85) (4,0.5) (5.5,0)};
			\addplot[green,smooth] coordinates {(2.5,0) (4,0.5) (4.5,0.85) (5,1) (5.5,0.85) (6,0.5) (7.5,0)};
			\addplot[olive,smooth] coordinates {(4.5,0) (6,0.5) (6.5,0.85) (7,1) (7.5,0.85) (8,0.5) (9.5,0)};
			
			\draw[dashed] (axis cs:2,0) -- (axis cs:2,1.2);
			\draw[dashed] (axis cs:4,0) -- (axis cs:4,1.2);
			\draw[latex-latex] (axis cs:2,1.1) -- node[midway,above,align=center]{Sub-band bandwidth $\Delta f_{sub}$} (axis cs:4,1.1);
		\end{axis}
	\end{tikzpicture}
	\caption{Neighbouring sub-bands interfering with each other and thereby causing inter-carrier interference}
\end{figure}

\begin{fact}
	All frequency-division spread spectrum techniques (\ac{FHSS} and multi-carrier) suffer from inter-carrier interference.
\end{fact}

A draw-back of inserting guard bands is the increased bandwidth of the whole multi-carrier signal.

\subsection{Orthogonal Frequency-Division Multiplex}

The increased bandwidth makes frequency-division spread spectrum techniques unattractive. Luckily, the inter-carrier interference issue can be mitigated without significantly increasing the bandwidth.
\begin{itemize}
	\item The sinc-function has a special property. It has \emph{zeros} at each $f = k \cdot \frac{1}{T_{sym,M}}$ (or as an angular freuqency $\omega = k \cdot \frac{2\pi}{T_{sym,M}}$) for all integer values except zero $k \in \mathbb{Z} \ \left\{0\right\}$.
	\item If the centre frequency (sub-carrier frequency) of the neighbouring sub-bands were at these zeros of the sinc-function, the inter-carrier interference would be minimal.
	\item Because the sub-carrier frequency is in a zero of the sin-function, \textbf{all sub-carriers are orthogonal}.
	\item This means that the optimal spacing between the carriers of the sub-bands $\Delta f_{sc-sc}$ (the \index{sub-carrier spacing} \textbf{sub-carrier spacing}) is
	\begin{equation}
		\Delta f_{sc-sc} = \frac{1}{T_{sym,M}} = f_{sym,M}
	\end{equation}%
	\nomenclature[Sf]{$\Delta f_{sc-sc}$}{Sub-carrier spacing in a multi-carrier system}
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}
		\begin{axis}[
			height={0.15\textheight},
			width=0.7\linewidth,
			scale only axis,
			xlabel={$f$},
			ylabel={\acs{OFDM} sub-bands},
			%grid style={line width=.6pt, color=lightgray},
			%grid=both,
			grid=none,
			legend pos=outer north east,
			axis y line=middle,
			axis x line=middle,
			every axis x label/.style={
				at={(ticklabel* cs:1.05)},
				anchor=north,
			},
			every axis y label/.style={
				at={(ticklabel* cs:1.05)},
				anchor=east,
			},
			xmin=-0.5,
			xmax=8.5,
			ymin=0,
			ymax=1.7,
			%xtick={0,0.125,...,1},
			%xticklabels={$- \omega_S$, $- \frac{\omega_S}{2}$, $0$, $\frac{\omega_S}{2}$, $\omega_S$},
			%ytick={0},
		]
			\addplot[blue,smooth,domain=0:8,samples=50] plot({\x},{(sinc(pi*(\x-3)))});
			\addplot[blue,smooth,domain=0:8,samples=50] plot({\x},{-(sinc(pi*(\x-3)))});
			\addplot[red,smooth,domain=0:8,samples=50] plot({\x},{(sinc(pi*(\x-4)))});
			\addplot[red,smooth,domain=0:8,samples=50] plot({\x},{-(sinc(pi*(\x-4)))});
			\addplot[green,smooth,domain=0:8,samples=50] plot({\x},{(sinc(pi*(\x-5)))});
			\addplot[green,smooth,domain=0:8,samples=50] plot({\x},{-(sinc(pi*(\x-5)))});
			\addplot[olive,smooth,domain=0:8,samples=50] plot({\x},{(sinc(pi*(\x-6)))});
			\addplot[olive,smooth,domain=0:8,samples=50] plot({\x},{-(sinc(pi*(\x-6)))});
			
			\draw[dashed] (axis cs:4,0) -- (axis cs:4,1.2);
			\draw[dashed] (axis cs:5,0) -- (axis cs:5,1.2);
			\draw[latex-latex] (axis cs:4,1.1) -- node[midway,above,align=center]{Sub-carrier spacing $\Delta f_{sc-sc}$} (axis cs:5,1.1);
		\end{axis}
	\end{tikzpicture}
	\caption[The \acs{PSD} of an \acs{OFDM} multi-carrier signal]{The \acs{PSD} of an \acs{OFDM} multi-carrier signal with $M = 4$ sub-bands. The \ac{PSD} of the sub-bands is assumed to be a sinc-function (ideal rectangular symbol shape in the time-domain). With a proper selection of the sub-carrier spacing, the carriers are exactly in the zeros of all other sinc-functions. The carriers are orthogonal. The inter-carrier interference issue is mitigated.}
\end{figure}

The total bandwidth occupied is
\begin{equation}
	\Delta f_{MC} = M \Delta f_{sc-sc}
\end{equation}
which is the minimum possible value and therefore optimal.

The optimal sub-carrier spacing makes the sub-carriers orthogonal. The technique is called \index{orthogonal frequency-division multiplex} \textbf{\acf{OFDM}}.

\subsubsection{OFDM Implementation Using the FFT}

Please remember Chapter 4, when we discussed the orthogonality of the frequency vectors of a \ac{DFT}. This circumstance is used to implement the \ac{OFDM}.
\begin{itemize}
	\item Symbol are parallelized.
	\item Each parallel sub-symbol is then modulated (\acs{BPSK}, \acs{QPSK}, \acs{QAM}, ...). The modulator generates a complex-valued IQ output for each sub-band.
	\item The complex-valued modulator output is then fed into an \ac{IFFT}. Each sub-carrier is represented by one input frequency-domain sample of the \ac{IFFT}.
	\item The \ac{IFFT} transforms the multi-carrier signal to the time-domain.
	\item It complex-valued IQ output of the \ac{IFFT} is the complex-valued baseband signal.
	\item The complex-valued baseband signal is then converted to an analogue signal is mixed by an IQ modulator to the \ac{RF} band.
\end{itemize}
The \ac{IFFT} is, like the \ac{FFT}, implemented by an efficient algorithm.

\begin{figure}[H]
	\centering
	\begin{adjustbox}{scale=0.6}
		\begin{circuitikz}
			\node[draw,block,minimum height=6cm](SP){Serial-to-\\ parallel};
			\node[draw,block,minimum height=6cm,right=5cm of SP](IFFT){\acs{IFFT}};
			\node[draw,block,minimum height=3cm,right=4cm of IFFT](IQ){IQ modulator};
			
			\draw[-o] (SP.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Data stream $\vect{D}$};
			
			\foreach \n/\y in {1/2.5, 2/1, M/-2.5}{
				\draw ([yshift={\y cm}]SP.east) -- ++(1cm,0) node[inputarrow]{} node[draw,block,anchor=west](Mod\n){Modulator \n};
				\draw (Mod\n.east) -- ([yshift={\y cm}]IFFT.west) node[inputarrow]{};
			}
			\draw[draw=none] (Mod2.south) -- node[midway]{$\vdots$} (ModM.north);
		
			\node[above=5mm of Mod1,align=center]{\acs{BPSK}, \acs{QPSK},\\ \acs{QAM}, ...\\ modulation};
		
			\foreach \v/\y in {I/1, Q/-1}{
				\draw ([yshift={\y cm}]IFFT.east) to[dac,l={\v},>] ++(2cm,0) to[lowpass,>] ([yshift={\y cm}]IQ.west) node[inputarrow]{};
			}
			
			\draw (IQ.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{Multi-carrier\\ signal};
		\end{circuitikz}
	\end{adjustbox}
	\caption{\acs{OFDM} modulator (transmitter) using an \acs{IFFT}}
\end{figure}

In the receiver, the signal processing chain is reversed:
\begin{itemize}
	\item The IO demodulator outputs an complex-valued baseband signal which is digitized.
	\item The digitized \ac{I} and \ac{Q} components are given as time-domain samples to an \ac{FFT}.
	\item The \ac{FFT} calculates the frequency-domain samples.
	\item Each frequency-domain sample represents a sub-band.
	\item Each sub-band is demodulated (\acs{BPSK}, \acs{QPSK}, \acs{QAM}, ...) independently.
	\item The demodulated, parallel symbols are then serialized. The data stream is reconstructed.
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{adjustbox}{scale=0.6}
		\begin{circuitikz}
			\node[draw,block,minimum height=3cm](IQ){IQ demodulator};
			\node[draw,block,minimum height=6cm,right=4cm of IQ](FFT){\acs{FFT}};
			\node[draw,block,minimum height=6cm,right=5.5cm of FFT](PS){Parallel-to-\\ serial};
			
			\draw[-o] (IQ.west) node[inputarrow]{} -- ++(-1cm,0) node[left,align=right]{Multi-carrier\\ signal};
			
			\foreach \v/\y in {I/1, Q/-1}{
				\draw ([yshift={\y cm}]IQ.east) to[lowpass,>] ++(2cm,0) to[adc,l={\v},>] ([yshift={\y cm}]FFT.west) node[inputarrow]{};
			}
			
			\foreach \n/\y in {1/2.5, 2/1, M/-2.5}{
				\draw ([yshift={\y cm}]FFT.east) -- ++(1cm,0) node[inputarrow]{} node[draw,block,anchor=west](Demod\n){Demodulator \n};
				\draw (Demod\n.east) -- ([yshift={\y cm}]PS.west) node[inputarrow]{};
			}
			\draw[draw=none] (Demod2.south) -- node[midway]{$\vdots$} (DemodM.north);
			
			\node[above=5mm of Demod1,align=center]{\acs{BPSK}, \acs{QPSK},\\ \acs{QAM}, ...\\ demodulation};
			
			\draw (PS.east) -- ++(1cm,0) node[inputarrow]{} node[right,align=left]{Decoded\\ data stream\\ $\vect{\tilde{D}}$};
		\end{circuitikz}
	\end{adjustbox}
	\caption{\acs{OFDM} demodulator (receiver) using an \acs{FFT}}
\end{figure}

\section{Multiple Access}

In the previous sections, only two terminals were involved in the communication -- the transmitter and the receiver. \index{multiple access} \textbf{Multiple access} methods allow more than two terminals to transmit on the same transmission medium. The resources are shared.
\begin{itemize}
	\item The resource which must be shared is a frequency band.
	\begin{itemize}
		\item Frequency bands are allocated to the services by the national regulation authority.
		\item Each service has a limited bandwidth available.
		\item All users of the service must share the bandwidth.
	\end{itemize}
	\item Multiple access methods set the rules and techniques for this resource sharing.
	\item Multiple access methods are mostly based on \emph{spread spectrum} technologies.
	\begin{itemize}
		\item The symbol energy is spread across the frequency.
		\item Each user uses a different \emph{spreading code} to access the medium.
		\item By \emph{despreading}, the signals of the different users can be reconstructed.
	\end{itemize}
\end{itemize}

Multiple access involves \index{multiplexing} \textbf{multiplexing}. Multiplexing distributes the signal along certain dimensions of a resource, so that the resource (transmission medium) can transport independent information parallelly. There are four dimensions which can be multiplexed:
\begin{itemize}
	\item Space
	\item Time
	\item Frequency
	\item Code
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}
		\begin{scope}[shift={(-2,0)}]
			\draw (0,0) -- (-1,-2) -- (-1,2) -- cycle;
			\foreach \y in {1.5,1,0.5,0,-0.5,-1,-1.5}{
				\draw[-latex] (-2,\y) -- (-1,\y);
			}
			\node[anchor=east,align=right] at(-2.2,0) {Independent\\ signals};
		\end{scope}
		\begin{scope}[shift={(2,0)}]
			\draw (0,0) -- (1,-2) -- (1,2) -- cycle;
			\foreach \y in {1.5,1,0.5,0,-0.5,-1,-1.5}{
				\draw[-latex] (1,\y) -- (2,\y);
			}
			\node[anchor=west,align=left] at(2.2,0) {Independent\\ signals};
		\end{scope}
		\draw[very thick] (-2,0) -- node[midway,above,align=center]{Transmission\\ channel} (2,0);
	\end{tikzpicture}
	\caption[Principle of multiplexing]{Principle of multiplexing. Independent signals can be transmitted (quasi-) parallelly over the same transmission channel.}
\end{figure}

Multiple access methods are implemented in both the \emph{physical layer} (\acs{OSI} layer 1) and the \emph{data link layer} (\acs{OSI} layer 2).
\begin{itemize}
	\item The \index{medium access control} \textbf{\acf{MAC}} is a part of the \emph{data link layer} (\acs{OSI} layer 2). It contains the high-level logic which implements multiple access methods. It is responsible for the allocation of resources (scheduling). For example, it assigns \emph{spreading codes}, time-slots or sub-carriers to different users. The \ac{MAC} must provide reliable medium access. Data collisions of different users must be mitigated.
	\item The \emph{physical layer} (\acs{OSI} layer 1) changes the modulation and spreading parameters according to the instructions issued by the \emph{data link layer} (\acs{OSI} layer 2).
\end{itemize}

Reasons for multiple access:
\begin{itemize}
	\item \textbf{Number of users} -- A service is provided to lots of users.
	\item \textbf{Efficiency} -- Users occupy the medium for only a short time. Between the transmission bursts, other users can use the free medium.
	\item \textbf{Latency} -- Low latency can only be achieved if users can access the medium simultaneously.
\end{itemize}

\subsection{Space-Division Multiple Access}

A simple and \emph{non-spreading} method is \index{space-division multiple access} \textbf{\acf{SDMA}}.
\begin{itemize}
	\item Users are separated spatially.
	\item For wireless channels: The signals only have a limited range and cannot be received outside that range.
	\item For wired channels: The users are connected to different cables.
	\item The users are put into different spatial segments.
	\item All users can use the medium parallelly without interfering with each other.
\end{itemize}

\todo{SDMA figure}

\subsection{Time-Division Multiple Access}

A \emph{multiple access} method derived from \ac{THSS} is \index{time-division multiple access} \textbf{\acf{TDMA}}.
\begin{itemize}
	\item Each user obtains one of the $M$ time-slot for exclusive usage.
	\item Usually, the time-slots are long enough so that a series of symbols can be transmitted for one user. In contrast to pure \ac{THSS}, where one symbol is transmitted as a chip, \ac{TDMA} transmits a series of symbols for user 1 and then hands over the transmission channel to the next user.
	\item \ac{ISI} between the users is an issue. Guard intervals must be inserted.
\end{itemize}

\begin{remark}
	Optionally, users can obtain multiple time-slot allocations to increase their data rate.
\end{remark}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}[
		x={(0.5cm,0cm)},
		y={(0cm,0.5cm)},
	]
		\draw[-latex] (0,0) -- (11,0) node[below right,align=left]{Time $t$};
		\draw[-latex] (0,0) -- (0,11) node[above left,align=right]{Frequency $f$};
		
		\foreach \n/\c in {0/red, 1/blue, 2/green, 3/yellow, 4/olive}{
			\draw[fill=\c!50,draw=black] ({(\n*2)},0) -- ({(\n*2)},10) -- ({(\n*2)+1.5},10) -- ({(\n*2)+1.5},0) -- cycle;
			\node[align=center,rotate=90] at({(\n*2)+0.75},5) {User \n};
		}
	\end{tikzpicture}
	\caption[Time-slot allocation in a \acs{TDMA} system]{Time-slot allocation in a \acs{TDMA} system. In a \acs{TDMA} system, each user obtains a time-slot where it can exclusively use the whole bandwidth.}
\end{figure}

Advantages:
\begin{itemize}
	\item Only one carrier frequency $\leftarrow$ only one oscillator required for reception $\leftarrow$ simple receiver design
\end{itemize}

Drawbacks:
\begin{itemize}
	\item Time synchronization required
	\item Guard interval required
\end{itemize}

\subsection{Frequency-Division Multiple Access}

A \emph{multiple access} method derived from \ac{FHSS} is \index{frequency-division multiple access} \textbf{\acf{FDMA}}.
\begin{itemize}
	\item Each user obtains one of the $M$ sub-bands for exclusive usage.
	\item The \emph{spreading code} $C[m]$ is constant for each user and yields the sub-bands number.
	\item The frequency is not changed for a user. Thus, the frequency-hopping is replaced by a constant frequency.
	\item \emph{Inter-carrier interference} is an issue. Guard bands must be inserted.
\end{itemize}

\begin{remark}
	Optionally, users can obtain multiple sub-band allocations to increase their data rate.
\end{remark}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}[
		x={(0.5cm,0cm)},
		y={(0cm,0.5cm)},
	]
		\draw[-latex] (0,0) -- (11,0) node[below right,align=left]{Time $t$};
		\draw[-latex] (0,0) -- (0,11) node[above left,align=right]{Frequency $f$};
		
		\foreach \n/\c in {0/red, 1/blue, 2/green, 3/yellow, 4/olive}{
			\draw[fill=\c!50,draw=black] (0,{(\n*2)}) -- (10,{(\n*2)}) -- (10,{(\n*2)+1.5}) -- (0,{(\n*2)+1.5}) -- cycle;
			\node[align=center] at(5,{(\n*2)+0.75}) {User \n};
		}
	\end{tikzpicture}
	\caption[Sub-band allocation in an \acs{FDMA} system]{Sub-band allocation in an \acs{FDMA} system. In an \acs{FDMA} system, each user obtains a sub-band which it can exclusively use at any time.}
\end{figure}

Advantages:
\begin{itemize}
	\item No time synchronization required
\end{itemize}

Drawbacks:
\begin{itemize}
	\item More complex receiver design (many parallel oscillators or enhanced digital signal processing)
	\item Guard band required
\end{itemize}

\subsection{Hybrid TDMA and FDMA}

\ac{TDMA} and \ac{FDMA} can be combined to a hybrid system.
\begin{itemize}
	\item The allocation for both sub-bands and time-slots changes dynamically for each user.
	\item The pattern is determined by the \ac{MAC} layer (\acs{OSI} layer 2).
	\item Some users may lose allocations for the sake of enabling other users to use the transmission medium.
\end{itemize}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}[
		x={(0.5cm,0cm)},
		y={(0cm,0.5cm)},
	]
		\draw[-latex] (0,0) -- (9,0) node[below right,align=left]{Time $t$};
		\draw[-latex] (0,0) -- (0,9) node[above left,align=right]{Frequency $f$};
		
		\foreach \t/\f/\n/\c in {0/0/0/red, 0/1/1/blue, 0/2/2/green, 0/3/3/yellow,
			1/0/1/blue, 1/1/0/red, 1/2/3/yellow, 1/3/4/olive,
			2/0/2/green, 2/1/4/olive, 2/2/0/red, 2/3/3/yellow,
			3/0/4/olive, 3/1/5/gray, 3/2/2/green, 3/3/1/blue}{
			\draw[fill=\c!50,draw=black] ({(\t*2)},{(\f*2)}) -- ({(\t*2)+1.5},{(\f*2)}) -- ({(\t*2)+1.5},{(\f*2)+1.5}) -- ({(\t*2)},{(\f*2)+1.5}) -- cycle;
			\node[align=center] at({(\t*2)+0.75},{(\f*2)+0.75}) {U\n};
		}
	\end{tikzpicture}
	\caption{Sub-band and time-slot allocation in an \acs{TDMA}/\acs{FDMA} hybrid system}
\end{figure}

\begin{example}{2G cell phone -- \ac{GSM}}
	\todo{GSM example}
\end{example}

\subsection{Code-Division Multiple Access}

All \emph{spread spectrum} technologies rely on \emph{spreading codes}.
\begin{itemize}
	\item The \emph{spreading codes} are the parameter of the \emph{spread spectrum} technology which defines how the signal power is spread.
	\item Using \index{orthogonal spreading codes} \textbf{orthogonal spreading codes}, multiple \emph{spread spectrum} signals can superimpose without interfering each other.
	\item Different \emph{orthogonal spreading codes} can be assigned to different users for \emph{multiple access}.
	\item The receiver is able to split the simultaneously transmitted signals of the different users using the \emph{orthogonal spreading codes}.
	\item Due to the code orthogonality, the users cannot interfere. The other user's signals will be noise to the receiver which is suppressed.
\end{itemize}

The \emph{multiple access} method using \emph{orthogonal spreading codes} is \index{code-division multiple access} \textbf{\acf{CDMA}}.

It can be subdivided according to the underlying \emph{spread spectrum} technology.
\begin{itemize}
	\item \textbf{\acf{DS-CDMA}} uses \emph{\acf{DSSS}} with \emph{orthogonal spreading codes}.
	\item \textbf{\acf{FH-CDMA}} uses \emph{\acf{FHSS}} with \emph{orthogonal spreading codes}.
	\item \textbf{\acf{TD-CDMA}} uses \emph{\acf{THSS}} with \emph{orthogonal spreading codes}.
\end{itemize}

\subsubsection{Direct Sequence CDMA}

A \emph{\ac{CDMA} scheme} derived from \ac{DSSS} is \index{direct sequence code-division multiple access} \textbf{\acf{DS-CDMA}}.
\begin{itemize}
	\item \emph{Spreading codes} with a length of $L$ have $K$ combinations which are orthogonal.
	\item Each user obtains one of the $K$ \emph{orthogonal spreading codes} for exclusive usage.
	\item All users can transmit simultaneously using the whole bandwidth.
\end{itemize}

\begin{remark}
	Optionally, users can obtain multiple code allocations to increase their data rate.
\end{remark}

\begin{figure}[H]
	\centering
	\begin{tikzpicture}[
		x={(-0.35cm,-0.35cm)},
		y={(0.5cm,0cm)},
		z={(0cm,0.5cm)},
	]
		\draw[-latex] (0,0,0) -- (11,0,0) node[below right,align=left]{Time $t$};
		\draw[-latex] (0,0,0) -- (0,11,0) node[below right,align=left]{Frequency $f$};
		\draw[-latex] (0,0,0) -- (0,0,11) node[right,align=left]{Code $c$};
		
		\foreach \n/\c in {0/red, 1/blue, 2/green, 3/yellow, 4/olive}{
			\draw[fill=\c!50,draw=black] (10,0,{(\n*2)}) -- (10,10,{(\n*2)}) -- (10,10,{(\n*2)+1.5}) -- (10,0,{(\n*2)+1.5}) -- cycle;
			\draw[fill=\c!50,draw=black] (10,10,{(\n*2)}) -- (0,10,{(\n*2)}) -- (0,10,{(\n*2)+1.5}) -- (10,10,{(\n*2)+1.5}) -- cycle;
			\draw[fill=\c!50,draw=black] (0,0,{(\n*2)+1.5}) -- (10,0,{(\n*2)+1.5}) -- (10,10,{(\n*2)+1.5}) -- (0,10,{(\n*2)+1.5}) -- cycle;
			\node[align=center] at(10,5,{(\n*2)+0.75}) {User \n};
		}
	\end{tikzpicture}
	\caption[Code allocation in a \acs{DS-CDMA} system]{Code allocation in a \acs{DS-CDMA} system. In a \acs{DS-CDMA} system, each user obtains a spreading code which is orthogonal to all other user's codes. The whole bandwidth is used by all users simultaneously.}
\end{figure}

Advantages:
\begin{itemize}
	\item Only one carrier $\leftarrow$ one analogue \ac{LO} $\leftarrow$ simple receiver design (analogue part)
	\item Bandwidth is used efficiently.
	\item Good noise immunity.
\end{itemize}

Drawbacks:
\begin{itemize}
	\item High requirements on digital signal processing (parallel detection of different codes)
	\item Transmitters must be able to adjust their transmission power. Transmitters which are closer to the receiver must reduce their power. Otherwise, the receiver would be over-driven due to the limited dynamic range. It then cannot receive far transmitters whose signals are relatively weak.
\end{itemize}

\subsubsection{Frequency-Hopping CDMA}

A \emph{\ac{CDMA} scheme} derived from \ac{FHSS} is \index{frequency-hopping code-division multiple access} \textbf{\acf{FH-CDMA}}.
\begin{itemize}
	\item In contrast to \ac{FDMA}, the frequency is not constant.
	\item The frequency is changed as defined by the \emph{orthogonal spreading codes}.
\end{itemize}

\todo{FH-CDMA plot}

Benefits and drawbacks: See \ac{FDMA}

\subsubsection{Time-Division CDMA}

A \emph{\ac{CDMA} scheme} derived from \ac{THSS} is \index{time-division code-division multiple access} \textbf{\acf{TD-CDMA}}.
\begin{itemize}
	\item In contrast to \ac{TDMA}, the time-slot is not constant.
	\item The time-slot is changed as defined by the \emph{orthogonal spreading codes}.
\end{itemize}

\todo{TD-CDMA plot}

Benefits and drawbacks: See \ac{TDMA}

\subsection{Orthogonal Frequency-Division Multiple Access}

The \index{orthogonal frequency-division multiple access} \textbf{\acf{OFDMA}} is an extension of the \ac{FDMA} using \emph{orthogonal sub-carrier}. The \ac{OFDMA} method is implemented by a \ac{OFDM} system.
\begin{itemize}
	\item The sub-band allocation equals that of \ac{FDMA}.
	\item The carriers of the sub-bands are orthogonal. Guard bands are not required. The different users will not interfere.
\end{itemize}


\section{Orthogonal Codes}

\todo{OVSF}

%TODO \section{Duplexing}

\nocite{ipatov2005}

\phantomsection
\addcontentsline{toc}{section}{References}
\printbibliography[heading=subbibliography]
\end{refsection}