Professional Documents
Culture Documents
Software-Defined Radio
Receiver for IEEE 802.11n
Matilda Ödquist
Master of Science Thesis in Electrical Engineering
Software-Defined Radio Receiver for IEEE 802.11n:
Matilda Ödquist
LiTH-ISY-EX--20/5338--SE
iii
Acknowledgments
I want to thank FOI for giving me the opportunity to write my master thesis,
and the support from everyone at the department. A special thank you to my
supervisor at FOI, Peter Nagy, for all the help with technical advise and input. I
would also like thank my supervisor and examiner at Liu, Giovanni Interdonato
and Danyo Danev. I received great support and feedback throughout the project,
and the thesis is in way better shape after the proofreading done by Giovanni.
v
Contents
Notation ix
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Problem statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Theory 5
2.1 Supported bandwidths . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 OFDM and modulation constellation patterns . . . . . . . . . . . . 5
2.3 The 802.11n layers . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.1 Physical layer . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.2 Medium access control . . . . . . . . . . . . . . . . . . . . . 9
2.3.3 Logical link control and higher layers . . . . . . . . . . . . 9
2.4 The 802.11n PHY layer . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.1 Non-HT short training field and non-HT long training field 10
2.4.2 Non-HT signal field . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.3 HT signal field . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.4 HT short training field . . . . . . . . . . . . . . . . . . . . . 13
2.4.5 HT long training field . . . . . . . . . . . . . . . . . . . . . . 14
2.4.6 Data field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.5 USRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3 Method 19
3.1 Overview of the workflow of the receiver . . . . . . . . . . . . . . . 19
3.2 System model in detail . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.1 Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.2 Symbol timing . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.3 Carrier frequency offset correction . . . . . . . . . . . . . . 21
3.2.4 Channel estimation using L-LTF . . . . . . . . . . . . . . . . 22
3.2.5 Noise variance estimation . . . . . . . . . . . . . . . . . . . 22
3.2.6 Recovery of L-SIG . . . . . . . . . . . . . . . . . . . . . . . . 23
vii
viii Contents
4 Results 27
4.1 Test set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2 Packets received on USRP . . . . . . . . . . . . . . . . . . . . . . . 27
4.3 USRP tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.5 Comparison of USRP tests and simulations . . . . . . . . . . . . . . 31
4.6 Reasons for unsuccessful packet decoding . . . . . . . . . . . . . . 31
5 Discussion 33
5.1 Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.1.1 Tests done with simulated channel . . . . . . . . . . . . . . 33
5.1.2 Tests done with USRPs . . . . . . . . . . . . . . . . . . . . . 33
5.2 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.3 The project in further context . . . . . . . . . . . . . . . . . . . . . 34
6 Conclusion 35
6.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.2 Problem statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.3 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Bibliography 37
ix
x Notation
Notation
Abbreviations
Abbreviation Definition
bcc Binary convolutional codes
ber Bit error rate
bpsk Binary phase-shift keying
crc Cyclic redundancy check
dft Discrete Fourier transform
fec Forward error correction
gi Guard interval
ht High throughput
ht-dltf HT data long training field
ht-eltf HT extension long training field
ht-ltf HT long training field
ht-sig HT signal field
ht-stf HT short training field
idft Inverse discrete Fourier transform
l-ltf Non-HT long training field
l-sig Non-HT signal field
l-stf Non-HT short training field
ldpc Low-density parity-check
llc Logical link control
mac Medium access control
mcs Modulation and coding scheme
mimo Multiple input multiple output
mpdu MAC protocol data unit
ofdm Orthogonal frequency-division multiplexing
per Packet error rate
phy Physical layer
plcp Physical layer convergence protocol
ppdu PLCP protocol data unit
psdu PHY service data unit
qam Quadrature amplitude modulation
qpsk Quadrature phase-shift keying
sdr Software-defined radio
snr Signal-to-noise ratio
stbc Space-time block coding
usrp Universal software radio peripheral
wlan Wireless local area network
Notation xi
Terminology
Word Explanation
802.11n A wireless networking standard in the 802.11 set of
protocols. Also called “HT”.
NewRowFix
NewRowFix
Cyclic Abbreviated CRC. An error-detecting code used to de-
redundancy tect accidental changes to the data. A check value is
check generated and added to the data to be transmitted. Af-
ter reception, the calculation is repeated to obtain a
second check sequence. Two check sequences that do
not match indicate corrupt data.
NewRowFix
Guard Sometimes a guard interval is added to a symbol to
interval ensure that it does not get distorted due to interfer-
ence from other parts of the transmission. Typically
a “cyclic prefix” is added in the guard interval, which
means data is prefixed by a repetition of it’s end.
NewRowFix
MATLAB A MATLAB code generator which automatically con-
Coder verts MATLAB code directly to C code or C++ code.
It supports most of the MATLAB language and it also
supports many of the MATLAB toolboxes.
NewRowFix
NewRowFix
MATLAB A MATLAB toolbox which is useful when implement-
WLAN ing wireless LAN systems in MATLAB. For instance,
toolbox the toolbox provides functions that perform different
types of FEC encodings (“BCC encoding” and “LDPC
encoding”).
NewRowFix
OSI A model that standardises the communication func-
model tions of a telecommunication or a computing system.
The model is useful for developers when it comes to
understanding and discussing the technology.
NewRowFix
NewRowFix
Software- Abbreviated SDR. A radio communication system
defined used to transmit and receive radio signals, where com-
radio ponents that traditionally have been implemented in
hardware are implemented by means of software in-
stead.
Introduction
1
The aim of this section is to provide a motivation for the project described in this
report and to clarify the purpose of it. Problem statements are defined, as well as
the limitations of the project.
1.1 Motivation
By following the IEEE 802.11 protocol for wireless local area network (WLAN)
implementations, WLANs can be implemented. The 802.11 protocol has devel-
oped a lot throughout the years and one of the later versions is 802.11n, which
was introduced in 2009 [1]. The 802.11n standard has many features, such as
orthogoal frequency-division multiplexing (OFDM) and multiple input multiple
output (MIMO) [2]. By following the standard, one can reach a transmission
speed up to 600 Mbps 1 [2].
IEEE 802.11n is not the latest version of the standard. IEEE 802.11ac was in-
troduced in 2013 and is therefore even more modern. However, most of the tech-
niques used in the 802.11ac version were already used in the 802.11n version.
The 802.11ac version can be considered a development of the 802.11n version,
rather than its own revolutionary departure [3]. In contrast to 802.11ac, which
only operates in the 5 GHz frequency band, 802.11n supports both 2.4 GHz and
5 GHz [3]. A list of earlier versions of IEEE 802.11, and their release years, can
be seen in table 1.1.
1
2 1 Introduction
.
A device often used to test WLAN implementations is the software-defined radio
(SDR). A SDR is a programmable radio where components that traditionally have
been implemented in hardware can be implemented in software.
It is in the interest of the Swedish Defense Research Agency to obtain code (prefer-
ably in the coding language C) that records 802.11n signals on a SDR and then
restores the data on a computer. An image describing this arrangement can be
seen in figure 1.1.
Figure 1.1: A transmitter sending out 802.11n signals, which are captured
by a SDR and then sent to a computer for decoding.
1.2 Purpose
The purpose of this thesis is to propose a design for a receiver following the
802.11n standard, which will be useful for the Swedish Defense Research Agency
when it comes to decoding WLAN signals. The receiver will be implemented us-
ing a SDR and MATLAB, but it will be possible to compile the MATLAB code to
C code using MATLAB Coder. The type of SDR that will be used to capture trans-
mitted 802.11n signals is the universal software radio peripheral (USRP) B210
[5]. The SDR that will be used to transmit 802.11n signals during system tests is
the USRP B205 mini [6].
1.4 Limitations
IEEE 802.11n is fairly advanced and supports many types of configurations. One
of the 802.11n features is for instance multiple input multiple output (MIMO)
[1], meaning multiple antennas are used to make the radio signals take different
paths between transmitter and receiver. The implementation described in this
thesis will, however, not support all of these features. The receiver shall be able
to receive HT 2 frames from any transmitter following the protocol, no matter the
configuration of the transmitter, but the receiver itself will be limited in several
ways. These limitations are due to the extent of the project, which only has one
project member and is planned to go on for 5 months. It is also due to hardware
limitations. A list of the defined limitations can be seen below.
• The receiver is not expected to operate all layers of the OSI model, the re-
ceiver will only have the physical layer implemented.
• Functions from MATLAB WLAN toolbox are not to be used in the code of
the final version of the system.
• The receiver will only use one antenna, however it will be able to read sig-
nals from a multiple antenna transmitter. In other words, it will be a multi-
ple input single output (MISO) setup.
• Due to the system test arrangement, the speed of the WLAN will be limited.
Even though IEEE 802.11n supports a maximum speed of about 600 Mbps
[2], the receiver will record and recover the data packets at a lower rate.
• The receiver will work in the 2.4 GHz frequency band, but it is not expected
to successfully decode signals in the 5 GHz band. IEEE 802.11n supports
both frequency bands [2]. However, only the 2.4 GHz frequency band will
be used in the tests.
2 HT stands for high throughput and is the official name of the IEEE 802.11n physical layer [2].
2
Theory
This section aims to clarify the theory behind the project. That is, it explains
the structure of IEEE 802.11n focusing on the physical layer. This includes the
structure of the preamble, which is sent before the data sequence and used for fea-
tures such as detection and channel estimation, but also the modifications done
to the actual data sequence before it is transmitted. This section also includes
information about the USRPs used in this project.
5
6 2 Theory
Angular frequency
Figure 2.1: Orthogonal subcarriers. When one subcarrier peaks the others
ones are zero, making them orthogonal.
.
In addition to modulating the signal in terms of frequency, the phase and the
amplitude are also adjusted in digital communication systems. By adjusting the
phase and amplitude, different modulations of constellation patterns can be cre-
ated [8]. The modulation constellation patterns for the subcarriers supported
by IEEE 802.11n are BPSK, QPSK, 16-QAM and 64-QAM [1]. In 16-QAM and
64-QAM the different constellation points are created by adjusting both phase
and amplitude of the signal. In BPSK and QPSK the constellation points have
the same amplitude but different phase [8]. In figure 2.2, 2.3, 2.4 and 2.5 the
constellation diagrams supported in the standard are illustrated.
2.2 OFDM and modulation constellation patterns 7
I I
Figure 2.2: BPSK constellation diagram. Figure 2.3: QPSK constellation diagram.
I I
Figure 2.4: 16-QAM constellation diagram. Figure 2.5: 64-QAM constellation diagram.
.
Constellations with fewer points can tolerate larger frequency errors, i.e. errors
where frequency has been shifted due to synchronization problems, and lower
SNR than large constellations [9]. However, there is still a reason to use con-
stellations with more points, such as 64-QAM, since this allows more bits to be
transmitted in a shorter period of time. To get as high throughput as possible the
size of the constellation diagram is chosen by taking the channel into considera-
tion. One wants to get as many correct packets as possible, in the shortest period
of time [8].
8 2 Theory
Higher Layers
.
In the following subsections, the different layers of the reference model seen in
figure 2.6 are described briefly.
MPDU
MAC layer
PHY layer
Figure 2.7: The relationship between MAC and PHY layer. The MPDUs
created by the MAC layer become PSDUs and are handled by the PHY layer.
They are put into frames suitable for transmission.
The physical layer operates in terms of bits. The physical layer is where electri-
cal, mechanical and procedural specifications are defined [11]. This is described
further in section 2.4.
2.4 The 802.11n PHY layer 9
There are several options for how to do the PLCP framing of the information to be
transmitted. PLCP stands for “physical layer convergence protocol” and refers to
how the physical layer maps the data into a frame suitable for transmission [10].
The options for the frames are “non-HT mode”, “mixed mode” and “greenfield
mode” [2]. The non-HT mode is compatible with prior versions of the standard,
but does not have any of the features that are exclusive to the 802.11n version of
the standard. The mixed mode contains the features that were new when IEEE
802.11n was introduced, but it can not be fully decoded by receivers following
the prior versions of the standard. The greenfield mode can only be used in en-
vironments where no other devices than 802.11n devices are used, the mode is
therefore optional and not commonly implemented [2]. Figure 2.8 describes the
PLCP framing for the non-HT mode and mixed mode, according to the standard
[1].
Non-HT mode
Non-
Non-HT Short Non-HT Long
HT Signal Data Field
Training Field Training Field
Field
Mixed mode
Non-
Non-HT Short Non-HT Long HT Signal HT Short HT Long
HT Signal Data Field
Training Field Training Field Field Training Field Training Field
Field
Figure 2.8: The PLCP framing for the non-HT mode and mixed mode,
according to IEEE 802.11n [2].
10 2 Theory
2.4.1 Non-HT short training field and non-HT long training field
The non-HT short training field, “L-STF”, consists of 10 short training symbols,
each one having a duration of 0.8 µs. The total duration of the L-STF is always 8
µs (0.8 µs · 10 = 8 µs) regardless of the channel bandwidth [1], provided that the
signal has been sampled correctly.
The non-HT long training field, “L-LTF”, consists of two long training symbol
periods and a guard interval. It has a total duration of 8 µs. The guard interval
has a duration of 1.6 µs and each training symbol 3.2 µs [12].
The L-STF and L-LTF are useful for the receiver in several ways. They can be
used for detection of an incoming 802.11n packet, synchronizing timers and for
antenna selection [2]. The antenna selection entails the use of multiple antennas
and it is performed by transmitting a packet containing no data field. The rece-
vier uses the preamble to decide the optimal receive and transmit antennas [13].
The training symbols are also useful for channel estimation [9].
One technique used for detecting an incoming signal is the “delay and correlate"
technique. By looking at the periodicity of the L-STF, one can use the cross cor-
relation of an incoming signal and a delayed version of it. If they resemble each
other, it is likely that it is two following short training symbols that has been de-
tected [9].
but has not yet reached the second window, the ratio peaks [9]. Figure 2.9 illus-
trates the double-sliding window method. .
Incoming packet
Window A Window B
“Double-sliding window” and “delay and correlate” are just two examples of
methods used for detection. The engineer is also free to design own methods
at the receiver end, as long as the methods can handle a signal that has been mod-
ulated and transmitted according to the standard [9].
When the approximate start of an incoming signal has been detected using the
L-STF, the exact start can be found using symbol timing [9]. Symbol timing is the
task of finding the precise moment when individual OFDM symbols start and
end. Cross correlation is used in this case as well, by either using the end of L-
STF or the beginning of L-LTF [9].
Another important task for the receiver is the channel estimation, which means
the frequency response of the channel is estimated. To do so, the L-LTF can be
used [9]. By using the L-LTF one can get a good estimate of the channel frequency
response for all the subcarriers. Since the L-LTF is defined in the standard, and
therefore the same in all transmitted 802.11n signals, the receiver can use this
knowledge to estimate the channel. By comparing the received L-LTF sequence
with the known sequence for L-LTF, the receiver can estimate the channel fre-
quency response. The received long training symbols are equal to the product
of the correct sequence of the long training symbols and the channel frequency
response plus additive noise [9].
12 2 Theory
Mixed mode
Non-
Non-HT Short Non-HT Long HT Signal HT Short HT Long
HT Signal Data Field
Training Field Training Field Field Training Field Training Field
Field
Legacy fields
Figure 2.10: In the mixed mode frame, the first three fields are legacy fields.
Devices following the 802.11a or 802.11g protocols are able to decode the
legacy fields. The third legacy field, “L-SIG”, prevents 802.11a and 802.11g
transmitters from interrupting 802.11n transmitters.
HT-SIG1 HT-SIG2
Figure 2.11: The subfields of HT-SIG, which is the fourth field of the PLCP
framing. The HT-SIG field carries information about the received signal,
such as the guard interval (GI) and aggregation [2].
2.4 The 802.11n PHY layer 13
Name of HT-SIG
subfield Description
A field of 7 bits, which indicates the index of the MCS table used by the
Modulation and transmitter. The MCS table tells, among other things, how many spatial
Coding Scheme streams that has been used [1].
It is either 0 or 1. 0 indicates the use of 20 MHz bandwidth, whilst 1
CBW 20/40 indicates the use of 40 MHz bandwidth[1].
Indicates the number of octets of data in the PSDU, so that the
HT Length receiver knows what length the PSDU has. This field is 16 bits long [1].
This field is set to either 0 or 1, 1 means channel estimate smoothing
Smoothing is recommended and 0 means it is not [1].
Not Sounding It is set to 0 if the PPDU is a sounding PPDU, otherwise it is set to 1 [1].
Reserved This field is always set to 1 [1].
If this field is set to 1, it indicates that the packet has an aggregated
PSDU. Meaning several PSDUs are sent in the same packet [2]. If
Aggregation the packet is not aggregated, this field is set to 0 [1].
2 bits long and indicates the difference in the number of space-time
STBC streams and the number of spatial streams [1].
It is set to either 0 if BCC encoding is used or 1 if LDPC encoding is
FEC Coding used [1].
This field is set to 1 if only a short guard interval is used after the
HT training fields in the PLCP frame. If a long guard interval is
Short GI used this field is set to 0 [1].
This field contains two bits. They are set to either 00, 01, 10 or 11
Number of
extension depending on how many extension spatial streams are used (four
spatial streams transmission modes can be used by the transmitter) [1].
This field is 8 bits long and contains CRC (cyclic redundancy
check) of bits 0–23 in HT-SIG1 and bits 0–9 in HT-SIG2 [1]. The
CRC helps the receiver to detect if there are errors in the received
CRC HT-SIG [2].
Contains 6 bits which are all set to zero, needed for the convolutional
Tail Bits coder to work [1].
Table 2.1: The purpose of each subfield of the PLCP framing field HT-SIG.
The HT short training field, HT-STF, is used for similar reasons as the L-STF. The
HT-STF is implemented in order to help out when it comes to detection at the
receiver end and the field consists of a repeating pattern (the ten short training
symbols that were described in section 2.4.1) [2]. The HT-STF has a duration of
4 µs [1]. The actual sequence of the HT-STF is described further in the standard,
but it is different depending on whether 20 MHz or 40 MHz bandwidth is used. If
20 MHz bandwidth is used, the sequence used to generate the HT-STF is identical
to the L-STF one. The 40 MHz bandwidth case is similar to the 20 MHz one. It
origins from the 20 MHz version, but it is modulated in several ways [1]. Since
the HT-STF is half as long as the L-STF, only five (instead of ten) training symbols
14 2 Theory
The second part of the HT-LTF is optional, it is called “HT-ELTF”. The HT-ELTF
part is not used to synchronize the data field, but to sound the beamforming
functionality [1]. Beamforming is a transmission technique which consists in
shaping a signal with specific amplitude and phase to direct it towards the in-
tended receiver [15]. The HT-ELTF is an optional part of the standard [1]. It is
not commonly implemented [2].
The different modulations done before a signal is transmitted are described in the
following paragraphs. The PSDU is not always modulated the same way, there
are plenty of alternatives when mixed mode or greenfiled mode is used. The
modulations depend on different factors, such as what type of FEC encoder has
been chosen or how many space-time streams the transmitter will create [1]. A
receiver can find information about how a signal was modulated by decoding the
HT signal field, as described in section 2.4.3.
Scrambling
To avoid long sequences of ones or zeros, the data is scrambled [2]. The scram-
bling is helpful for timing recovery at the receiver side [9].
BCC, binary convolutional codes, encoding is a method where the input data and
delayed versions of it are combined. Parity-check bits are created which leads
to the possibility of correcting single bit errors if neighbouring bits are correct
[2]. The structure of a convolutional encoder is described in detail in the 802.11
protocol and an example of how a convolutional encoder can be structured is
shown in figure 2.12. At the receiver end it is recommended to use BCC decod-
ing based on the Viterbi algorithm [12]. The Viterbi algorithm is an algorithm
that implements a maximum likelihood decoding [9].
.
LDPC, low-density parity-check, codes are an alternative to the BCC encoding.
They work in a similar manner as the BCC encoding [2]. LDPC encoding is an
optional feature of the standard, but it generally works better than BCC since it
has a coding gain of 1.5 to 3 dB [13].
16 2 Theory
+ Output A
+ Output B
Stream parsing
When the data has been FEC encoded, by either using the BCC or the LDPC
method, it is divided and put into spatial streams. In other words, the data to
be transmitted is split up in order to transmit it on different antennas. The num-
ber of spatial streams varies depending on the setting of the transmitter, so the
stream parsing function needs to be adapted to this [2].
After the interleaving has been done the bits are mapped into selected constel-
lation mapping. There are plenty of alternatives for how to map the subcarriers.
The selected constellation mapping can be found in the MCS table. The modula-
tion and coding scheme used by the transmitter is reported in the first subfield of
the HT-SIG field, as described in table 2.1. The different constellations supported
by IEEE 802.11n are BPSK, QPSK, 16-QAM, and 64-QAM [2].
space-time streams will be equal to the number of spatial streams. When STBC
is activated, the number of space-time streams is larger than the number of spa-
tial streams [1]. More space-time streams than spatial streams means there are
multiples of the same spatial stream in the space-time streams.
Transmitter Receiver
Figure 2.13: MIMO system, with four data streams going out of the four
transmitter antennas. If the optional STBC is used two space-time streams
can contain the same data.
Spatial mapping
The spatial mapping is the process of mapping the data into transmit chains.
This can be done in different ways. If STBC is not in use, direct mapping is the
most common way of doing spatial mapping. Direct mapping means each spatial
stream is mapped into a space-time stream and then put into the transmit chain
[2].
Another way of doing spatial mapping is spatial expansion. This means that
space-time streams are retrieved from the STBC process and then spread across
all the transmit chains [2].
N −1
1 X
x(k) = X(n)e j2πkn/N . (2.3)
N
n=0
.
The cyclic shift is included as a prevention of the multi-path fading. The cyclic
shift can be inserted either before (prefix) or after (suffix) the IDFT and there
18 2 Theory
are three different types to choose from [1]. They are described further in the
protocol for 802.11n.
2.5 USRP
The software-defined radio hardware called universal software radio peripheral,
USRP, is developed by Ettus Research. It is commonly used by research labs and
universities for tests related to wireless communications [19].
The USRP can be used for experimentation with signals such as FM broadcast,
TV broadcast, WLAN and more. It can cover frequencies from 70 MHz to 6 GHz
and bandwidths up to 56 MHz [5, 6].
3
Method
This chapter describes how the project was carried out. The relationship between
the different parts of the system is explained. The implementation of each part
of the system is also described in detail.
In figure 3.1 a flowchart that describes the system work flow of the final system
can be seen. Decoding of non-HT mode frames was tested during implementa-
tion but not integrated into the final system.
19
20 3 Method
Detection of
incoming packet
No packet Packet
detected detected
Termination of Synchronization of
process detected packet
Channel estimation
Decoding of
HT-SIG
Termination of
Channel estimation
process
Decoding of mixed
mode data field
Information embedded in
HT-SIG used in this
process
Initially a complete 802.11n communication chain was designed using the MAT-
LAB WLAN toolbox. This was done by following instructions from the WLAN
toolbox getting started guide and relying on an example provided therein. The
communication chain worked without errors, but could not be used as a complete
receiver. Important features, such as detection of an incoming signal and using
the information from HT-SIG, were not implemented. WLAN toolbox functions
3.2 System model in detail 21
The two main parts in developing the final system were therefore to add the fea-
tures that were not implemented and to rewrite already implemented functions
to make them independent on WLAN toolbox. In the following subsections the
subsystems are described.
3.2.1 Detection
The double-sliding window method, described in section 2.4.1, was used as detec-
tion algorithm. The short training symbols forming the L-STF are being looked
for. Since the number of samples in each short training symbol depends on
whether 20 MHz or 40 MHz bandwidth has been used, the subsystem loops twice.
Initially, the detection algorithm looks for a pattern which repeats every 16th
sample. If such a pattern has been found, the short training symbols of a sig-
nal with 20 MHz bandwidth is considered detected. If no such pattern is found,
the subsystem goes on by looking for a pattern which repeats every 32nd sam-
ple. If such pattern is found, the short training symbols of a signal with 40 MHz
bandwidth is considered detected. Provided that the incoming signal has been
sampled correctly.
The subsystem provides a structure array containing the last index of all sub-
fields except for the HT-LTF and the data field. However, these indices are just
estimates. The detected start of an incoming packet is an estimate and the result
can therefore be a few samples away from the actual start.
The L-LTF sequence is provided with the system in a MAT file. The file contains
two vectors. The vectors contain the correct L-LTF sequences for the 20 MHz and
40 MHz bandwidth case, respectively. Knowledge about whether 20 MHz or 40
MHz bandwidth has been used is provided to the symbol timing subsystem from
the detection algorithm described earlier.
offset of the subcarriers in the L-STF sequence. A fine offset estimation is done
by doing the same with the L-LTF sequence. Since one symbol in the L-LTF se-
quence contains more samples than a L-STF symbol, there is more information
to base the estimation of the offset on. It is therefore used for fine tuning, how-
ever the length of the symbols restrains the range of the estimation. If the carrier
frequency offset is too large, the fine estimation can not be used. The L-STF is
therefore used beforehand to do a coarse estimation and compensation, therafter
the carrier frequency offset is within range for the fine estimation to be used.
Before the actual channel estimation is done the received L-LTF is demodulated.
OFDM demodulation is done to the sequence to recover the original state of it.
The demodulated L-LTF is compared to the actual L-LTF, defined in the IEEE
802.11n protocol, and a channel estimate is obtained by using the method of
least squares [20]. The equation solved by the subsystem is shown in 3.1. “Re-
cLLTF” is the received and demodulated L-LTF sequence whilst “LLTF” is the
correct one. “ChanEst” is the channel estimate, which is the unknown sequence
that the subsystem estimates. Equation 3.2 shows how the estimation is done.
“./” is the MATLAB command for right array division. “mean” stands for mean
value. The mean value is calculated along the second dimension, resulting in
a column vector corresponding to the channel estimate. The matrix containing
L-LTF sequences is a square matrix.
.
The noise variance was estimated to be used in the recovery of L-SIG, HT-SIG and
the transmitted data sequence.
3.2 System model in detail 23
The information embedded in the obtained bit sequence is extracted with a func-
tion which uses the information described in table 2.1. A cyclic redundancy check
is done to make sure the information has been extracted correctly.
The number of space-time streams was decided when extracting the information
embedded in the HT-SIG field, which was described in section 3.2.7. The band-
width also had to be taken into account when deciding the length of HT-LTF.
This is due to the fact that the number of samples is twice as much when 40 MHz
bandwidth is used compared to when 20 MHz bandwidth is used.
The channel estimation worked in similar manner as the one described in section
3.2.4. The number of space-time streams was taken into account when doing the
24 3 Method
estimation. If the transmitter transmitted only one space-time stream, the estima-
tion can be done straight away by using the method of least squares estimation. If
there were more than one space-time stream transmitted the number of training
symbols is increased.
The input parameters to the subsystem are the remaining samples of the received
signal, the channel estimation done by using HT-LTF, the noise variance estimate
and the information from HT-SIG about how the data has been decoded.
The subsystem does OFDM demodulation to retrieve the original state of the
sequence, before it was put into different subcarriers and inverse Fourier trans-
formed into time domain by the transmitter. It equalizes the data sequence by us-
ing the channel estimation. Thereafter the subsystem demaps the data symbols
to the state of them before they were put in constellation patterns at the trans-
mitter side. Every step the standard uses to encode the data is done in reverse in
this subsystem, to finally retrieve it the transmitted bit sequence, in figure 3.2 a
flowchart providing the subsystem work flow is given. When the subsystem has
worked its way, the data has finally been recovered.
BCC LDPC
BCC or LDPC channel
Deinterleaving Stream deparsing
decoding
Figure 3.2: Data recovery chain, done by the subsystem being responsible
for the data field.
sent the packets to a computer running MATLAB to perform data decoding. After
decoding, the received bit sequence was compared to the transmitted one. The
arrangement can be seen below, in figure 3.3.
Computer
.
The experimental tests were done using 20 MHz bandwidth, BCC encoding and
single input single output (one antenna on both transmitter and receiver). 100
packets were transmitted, received and decoded. The magnitude of the trans-
mitted packets was adjusted during the tests to obtain different SNR. This was
repeated for signals with all supported constellation patterns (BPSK, QPSK, 16-
QAM and 64-QAM). The MCS index used to obtain BPSK was 0, the index to
obtain QPSK was 1, the index to obtain 16-QAM was 3 and the index to obtain
64-QAM was 5.
Simulations were also done to evaluate the system. White gaussian noise was
added to the signal during the simulation tests to mimic a channel. The noise was
increased to decrease SNR, whilst the magnitude of the actual signal remained
constant.
In the simulations, the lowest and highest SNR had a noise variance of 0.6360
and 0.0064, respectively. A decreased noise variance leads to an increased SNR,
signal power being constant. The noise varied significantly in the USRP tests,
since nearby devices using the same frequencies distorted the tests. However, the
successful tests (where no distortions from nearby devices were detected) were
consistent in terms of noise floor and noise variance.
4
Results
The results of the performed tests are presented in this chapter. These results
include both experimental tests performed by using a pair of USRPs, and tests
performed solely in MATLAB with a simulated channel.
The transmitted bit sequences were semi-randomly generated from a seed. The
exact same sequences were used in the MATLAB tests as in the USRP tests.
27
28 4 Results
Whilst figure 4.2 shows the same sequence free of any interference. When per-
forming the tests, the received signals that had an obvious distortion added to
them were removed. However, is was complicated to sift out less obvious distor-
tions from nearby devices since they would not affect the magnitude that much.
Time
Time
BPSK and QPSK requires the same signal power to work successfully. Apart
from this exception, advanced modulations require higher SNR level to achieve
the same PER. Advanced modulations requiring higher SNR is in line with the
theory.
In figure 4.4 the BER versus SNR can be seen. The same data was used in the
BER plot as in the PER plot. However, one received packet would yield in a total
of 8192 received bits. Thereby there were more bits than packets available. In
the BER plot, BPSK and QPSK still require the same SNR to work successfully.
-1
10
-2
10
0 5 10 15 20 25 30 35 40
SNR
Figure 4.3: Packet error rate versus signal-to-noise ratio, tests performed
with USRPs.
30 4 Results
64-QAM
16-QAM
10 -1 QPSK
BPSK
10 -2
BER
10 -3
10 -4
0 5 10 15 20 25 30
SNR
Figure 4.4: Bit error rate versus signal-to-noise ratio, tests performed with
USRPs.
4.4 Simulations
For validation and comparison, the system was also tested in simulations. As
previously mentioned, the filter simulating a channel consisted of white gaussian
noise. The lowest and highest SNR had a noise variance of 0.6360 and 0.0064,
respectively. The higher the SNR, the lower the noise variance. In the simulations
one can clearly see that QPSK requires a higher SNR than BPSK. PER versus SNR
from the simulations can be seen in figure 4.5.
-1
10
10 -2
4 6 8 10 12 14 16 18 20 22
SNR
Figure 4.5: Packet error rate versus signal-to-noise ratio, simulated tests. In
contrast to the USRP tests, 64-QAM achieved error-free communication in
this case. The fact that only white gaussian noise, and no other distortions,
was used to simulate the channel is probably one reason for this.
4.5 Comparison of USRP tests and simulations 31
10 -1
10 -2
0 5 10 15 20 25 30 35 40
SNR
Figure 4.6: Packet error rate versus signal-to-noise ratio, simulated tests
and USRP tests.
35
30
%
25
20
15
10
5.1 Result
Tests done with a simulated channel were successful. As described in the previ-
ous chapter, the signals received on the USRPs were often very distorted though.
This aspect probably had a lot of impact on the USRP tests and is discussed fur-
ther in subsection 5.1.2.
33
34 5 Discussion
5.2 Method
The testing part of the project could have improved a lot. In general, the method
of developing the system design worked well though.
In terms of USRP testing, the main issue was probably the fact that only 100
packets were received for each PER calculation. Since the environment was very
unreliable in terms of distortions, tests including more packets would probably
have resulted in better plots.
If more time would have been assigned to the project, more transmit packets
could have been captured during the test phase. The USRP tests were automa-
tised in some ways, but could have been even more automatised. This would
have made the USRP tests more time effective.
Changing environment could have been another solution to avoid distortions and
thereby achieve better results. However, it is very hard to find an environment
free from signals in the 2.4 GHz frequency band since it is widely used by techni-
cal devices.
For whom different frequency bands should be available is also a society linked
issue related to WLAN systems. As mentioned in this thesis, IEEE 802.11n sup-
ports the 2.4 GHz and the 5 GHz frequency bands. The more technology develops,
the more pressure will be put on available channels.
Conclusion
6
In this chapter the purpose of the project, together with the problem statements
are discussed. A section about future work is also included, which describes
further developments that can be done.
6.1 Purpose
The purpose of the project was to implement a system which decodes IEEE 802.11n
signals. A MATLAB design has been proposed. This MATLAB design can be com-
piled into C code using MATLAB Coder. For the implemented system, C code
is preferred by the Swedish Defense Research Agency and the possibility to use
MATLAB Coder was thereby important.
The tests performed using the USRPs were not completely successful. However,
the tests worked to some extent. Even though the resulting plots did not look
as expected, packets transmitted through the air were possible to decode. This
includes all of the four supported constellation patterns.
35
36 6 Conclusion
modern features that are not compatible with prior versions of the standard. This
includes QAM constellation patterns, support for both 20 MHz and 40 MHz band-
width and the possibility of using multiple input multiple output.
A USRP can be used to effectively test the implemented system. The proposed de-
sign was tested using two USRPs and decoding of IEEE 802.11n packets worked.
Although, errors occured regularly as discussed in the previous chapter.
Developments that could be done to the proposed design is to advance the system
by adding more layers of the OSI model. A MAC layer would be a useful devel-
opment. More features could also be added to the implemented PHY layer. For
instance, the possibility of sounding the beamforming functionality supported
by IEEE 802.11n.
[9] J. Heiskala and J. Terry, OFDM Wireless LANs: A Theoretical and Practical
Guide. Sams, 2002.
[11] J. Geier, Wireless LANs: Implementing high performance IEEE 802.11 net-
works. Sams, 2002.
37
38 Bibliography