50
Master of Science Thesis in Electrical Engineering Department of Electrical Engineering, Linköping University, 2020 Software-Defined Radio Receiver for IEEE 802.11n Matilda Ödquist

Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

Master of Science Thesis in Electrical EngineeringDepartment of Electrical Engineering, Linköping University, 2020

Software-Defined RadioReceiver for IEEE 802.11n

Matilda Ödquist

Page 2: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

Master of Science Thesis in Electrical Engineering

Software-Defined Radio Receiver for IEEE 802.11n:

Matilda Ödquist

LiTH-ISY-EX--20/5338--SE

Supervisor: Giovanni Interdonatoisy, Linköping University

Peter NagySwedish Defense Research Agency (FOI)

Examiner: Danyo Danevisy, Linköping University

Division of Communication SystemsDepartment of Electrical Engineering

Linköping UniversitySE-581 83 Linköping, Sweden

Copyright © 2020 Matilda Ödquist

Page 3: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

Abstract

This thesis studies the physical layer (PHY layer) of the IEEE 802.11n wirelesslocal area network (WLAN) standard. The possibility of integrating a receiverdesigned according to the standard with software-defined radios is investigated.The proposed design was implemented in MATLAB and tested using two software-defined radios. One of the radios transmitted IEEE 802.11n signals whilst theother one captured them and sent them to a computer for decoding. In this way,evaluation of the proposed receiver design was done. The tests resulted in suc-cessfully decoded WLAN packets, although errors occured regularly due to dis-tortions in the air. The proposed MATLAB design can be developed further, withmore features, for future tests and research.

iii

Page 4: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used
Page 5: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

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 mysupervisor at FOI, Peter Nagy, for all the help with technical advise and input. Iwould also like thank my supervisor and examiner at Liu, Giovanni Interdonatoand 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.

Linköping, September 2020Matilda Ödquist

v

Page 6: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used
Page 7: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

Contents

Notation ix

1 Introduction 11.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Problem statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Theory 52.1 Supported bandwidths . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 OFDM and modulation constellation patterns . . . . . . . . . . . . 52.3 The 802.11n layers . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.3.1 Physical layer . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3.2 Medium access control . . . . . . . . . . . . . . . . . . . . . 92.3.3 Logical link control and higher layers . . . . . . . . . . . . 9

2.4 The 802.11n PHY layer . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.1 Non-HT short training field and non-HT long training field 102.4.2 Non-HT signal field . . . . . . . . . . . . . . . . . . . . . . . 122.4.3 HT signal field . . . . . . . . . . . . . . . . . . . . . . . . . . 122.4.4 HT short training field . . . . . . . . . . . . . . . . . . . . . 132.4.5 HT long training field . . . . . . . . . . . . . . . . . . . . . . 142.4.6 Data field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.5 USRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3 Method 193.1 Overview of the workflow of the receiver . . . . . . . . . . . . . . . 193.2 System model in detail . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.2.1 Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.2.2 Symbol timing . . . . . . . . . . . . . . . . . . . . . . . . . . 213.2.3 Carrier frequency offset correction . . . . . . . . . . . . . . 213.2.4 Channel estimation using L-LTF . . . . . . . . . . . . . . . . 223.2.5 Noise variance estimation . . . . . . . . . . . . . . . . . . . 223.2.6 Recovery of L-SIG . . . . . . . . . . . . . . . . . . . . . . . . 23

vii

Page 8: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

viii Contents

3.2.7 Recovery of HT-SIG . . . . . . . . . . . . . . . . . . . . . . . 233.2.8 Deciding the length of HT-LTF . . . . . . . . . . . . . . . . 233.2.9 Channel estimation using HT-LTF . . . . . . . . . . . . . . 233.2.10 Recovery of the transmitted data . . . . . . . . . . . . . . . 24

3.3 Performed tests and simulations . . . . . . . . . . . . . . . . . . . . 24

4 Results 274.1 Test set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.2 Packets received on USRP . . . . . . . . . . . . . . . . . . . . . . . 274.3 USRP tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.4 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.5 Comparison of USRP tests and simulations . . . . . . . . . . . . . . 314.6 Reasons for unsuccessful packet decoding . . . . . . . . . . . . . . 31

5 Discussion 335.1 Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.1.1 Tests done with simulated channel . . . . . . . . . . . . . . 335.1.2 Tests done with USRPs . . . . . . . . . . . . . . . . . . . . . 33

5.2 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345.3 The project in further context . . . . . . . . . . . . . . . . . . . . . 34

6 Conclusion 356.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356.2 Problem statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 356.3 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

Bibliography 37

Page 9: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

ix

Page 10: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

x Notation

Notation

Abbreviations

Abbreviation Definition

bcc Binary convolutional codesber Bit error ratebpsk Binary phase-shift keyingcrc Cyclic redundancy checkdft Discrete Fourier transformfec Forward error correctiongi Guard intervalht High throughput

ht-dltf HT data long training fieldht-eltf HT extension long training fieldht-ltf HT long training fieldht-sig HT signal fieldht-stf HT short training fieldidft Inverse discrete Fourier transforml-ltf Non-HT long training fieldl-sig Non-HT signal fieldl-stf Non-HT short training fieldldpc Low-density parity-checkllc Logical link controlmac Medium access controlmcs Modulation and coding schememimo Multiple input multiple outputmpdu MAC protocol data unitofdm Orthogonal frequency-division multiplexingper Packet error ratephy Physical layerplcp Physical layer convergence protocolppdu PLCP protocol data unitpsdu PHY service data unitqam Quadrature amplitude modulationqpsk Quadrature phase-shift keyingsdr Software-defined radiosnr Signal-to-noise ratiostbc Space-time block codingusrp Universal software radio peripheralwlan Wireless local area network

Page 11: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

Notation xi

Terminology

Word Explanation

802.11n A wireless networking standard in the 802.11 set ofprotocols. Also called “HT”.

NewRowFixNewRowFix

Cyclicredundancy

check

Abbreviated CRC. An error-detecting code used to de-tect accidental changes to the data. A check value isgenerated and added to the data to be transmitted. Af-ter reception, the calculation is repeated to obtain asecond check sequence. Two check sequences that donot match indicate corrupt data.

NewRowFixGuard

intervalSometimes a guard interval is added to a symbol toensure that it does not get distorted due to interfer-ence from other parts of the transmission. Typicallya “cyclic prefix” is added in the guard interval, whichmeans data is prefixed by a repetition of it’s end.

NewRowFixMATLAB

CoderA MATLAB code generator which automatically con-verts MATLAB code directly to C code or C++ code.It supports most of the MATLAB language and it alsosupports many of the MATLAB toolboxes.

NewRowFixNewRowFix

MATLABWLANtoolbox

A MATLAB toolbox which is useful when implement-ing wireless LAN systems in MATLAB. For instance,the toolbox provides functions that perform differenttypes of FEC encodings (“BCC encoding” and “LDPCencoding”).

NewRowFixOSI

modelA model that standardises the communication func-tions of a telecommunication or a computing system.The model is useful for developers when it comes tounderstanding and discussing the technology.

NewRowFixNewRowFix

Software-defined

radio

Abbreviated SDR. A radio communication systemused to transmit and receive radio signals, where com-ponents that traditionally have been implemented inhardware are implemented by means of software in-stead.

Page 12: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used
Page 13: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

1Introduction

The aim of this section is to provide a motivation for the project described in thisreport and to clarify the purpose of it. Problem statements are defined, as well asthe 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, whichwas introduced in 2009 [1]. The 802.11n standard has many features, such asorthogoal frequency-division multiplexing (OFDM) and multiple input multipleoutput (MIMO) [2]. By following the standard, one can reach a transmissionspeed 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, whichonly operates in the 5 GHz frequency band, 802.11n supports both 2.4 GHz and5 GHz [3]. A list of earlier versions of IEEE 802.11, and their release years, canbe seen in table 1.1.

1Megabits per second.

1

Page 14: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

2 1 Introduction

Version 802.11a 802.11b 802.11g 802.11n 802.11acRelease year 1999 1999 2003 2009 2013

Table 1.1: IEEE 802.11 release years [3, 4].

.A device often used to test WLAN implementations is the software-defined radio(SDR). A SDR is a programmable radio where components that traditionally havebeen 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 thenrestores the data on a computer. An image describing this arrangement can beseen in figure 1.1.

802.11ntransmitter

SDR Computer

Figure 1.1: A transmitter sending out 802.11n signals, which are capturedby 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 the802.11n standard, which will be useful for the Swedish Defense Research Agencywhen 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 toC 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 isthe USRP B205 mini [6].

1.3 Problem statements

The following problem statements have been formulated for the project:

• What are the main characteristics of IEEE 802.11n?

• Can a USRP together with MATLAB be used to effectively implement thephysical layer of an IEEE 802.11n receiver?

Page 15: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

1.4 Limitations 3

1.4 Limitations

IEEE 802.11n is fairly advanced and supports many types of configurations. Oneof the 802.11n features is for instance multiple input multiple output (MIMO)[1], meaning multiple antennas are used to make the radio signals take differentpaths between transmitter and receiver. The implementation described in thisthesis will, however, not support all of these features. The receiver shall be ableto receive HT 2 frames from any transmitter following the protocol, no matter theconfiguration of the transmitter, but the receiver itself will be limited in severalways. These limitations are due to the extent of the project, which only has oneproject member and is planned to go on for 5 months. It is also due to hardwarelimitations. 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 ofthe 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 expectedto successfully decode signals in the 5 GHz band. IEEE 802.11n supportsboth frequency bands [2]. However, only the 2.4 GHz frequency band willbe used in the tests.

2HT stands for high throughput and is the official name of the IEEE 802.11n physical layer [2].

Page 16: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used
Page 17: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

2Theory

This section aims to clarify the theory behind the project. That is, it explainsthe structure of IEEE 802.11n focusing on the physical layer. This includes thestructure 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 doneto the actual data sequence before it is transmitted. This section also includesinformation about the USRPs used in this project.

2.1 Supported bandwidths

When transmitting a signal according to the 802.11n version of the standard, onehas two bandwidths to choose from. The bandwidth can be either 20 MHz or 40MHz [2]. Using a 40 MHz bandwidth allows higher transmission speed, howeverit naturally requires twice as much bandwidth spectrum to be free compared towhen 20 MHz is used. This leads to the fact that less channels are often availablewhen transmitting with 40 MHz bandwidth [2].

2.2 OFDM and modulation constellation patterns

Orthogonal frequency-division multiplexing means a signal in the frequency spec-trum is divided into equally spaced subcarriers. These subcarriers are orthogonalto each other and each one of them carries a portion of the transmitted informa-tion [7]. OFDM makes the signal more bandwidth efficient and the orthogonalityprevents the subcarriers from interfering with each other [7]. A representation oforthogonal subcarriers can be seen in figure 2.1.

5

Page 18: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

6 2 Theory

Angular frequency

Figure 2.1: Orthogonal subcarriers. When one subcarrier peaks the othersones are zero, making them orthogonal.

.In addition to modulating the signal in terms of frequency, the phase and theamplitude are also adjusted in digital communication systems. By adjusting thephase and amplitude, different modulations of constellation patterns can be cre-ated [8]. The modulation constellation patterns for the subcarriers supportedby IEEE 802.11n are BPSK, QPSK, 16-QAM and 64-QAM [1]. In 16-QAM and64-QAM the different constellation points are created by adjusting both phaseand amplitude of the signal. In BPSK and QPSK the constellation points havethe same amplitude but different phase [8]. In figure 2.2, 2.3, 2.4 and 2.5 theconstellation diagrams supported in the standard are illustrated.

Page 19: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

2.2 OFDM and modulation constellation patterns 7

I

Q

BPSK constellation diagram

Figure 2.2: BPSK constellation diagram.

I

Q

QPSK constellation diagram

Figure 2.3: QPSK constellation diagram.

I

Q

16-QAM constellation diagram

Figure 2.4: 16-QAM constellation diagram.

I

Q

64-QAM constellation diagram

Figure 2.5: 64-QAM constellation diagram.

.Constellations with fewer points can tolerate larger frequency errors, i.e. errorswhere frequency has been shifted due to synchronization problems, and lowerSNR 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 betransmitted in a shorter period of time. To get as high throughput as possible thesize 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 periodof time [8].

Page 20: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

8 2 Theory

2.3 The 802.11n layers

To help out with orientation, a reference model with different layers has beendeveloped to describe WLAN systems. The purpose of having such a model isto help the developers out when it comes to understanding and discussing thetechnology [10]. In figure 2.6 the reference model is described.

Logical Link Control (LLC)

Medium Access Control(MAC)

Physical Layer (PHY)

Higher Layers

Figure 2.6: Reference model for development of WLAN systems.

.In the following subsections, the different layers of the reference model seen infigure 2.6 are described briefly.

2.3.1 Physical layer

The physical layer, or the PHY layer, is the lowest layer in the OSI model. Thelayer receives data from the layer above it, the MAC layer, and maps the data intoframes suitable for transmission and reception [10]. When the PHY layer receivesthe data from the MAC layer, it has been mapped into MAC protocol data units(“MPDUs”). The MPDUs are put into a physical layer frame, and become PHYservice data units (“PSDUs”) [10]. In figure 2.7 the mapping from MAC layer toPHY layer is illustrated.

.

PHY layer preamble PSDU

MAC layerPHY layer

MPDU

Framing of packet to be transmitted

Figure 2.7: The relationship between MAC and PHY layer. The MPDUscreated 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 describedfurther in section 2.4.

Page 21: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

2.4 The 802.11n PHY layer 9

2.3.2 Medium access control

The MAC layer is in charge of making it possible for a group of wireless systemsto share the same space and frequencies. Two transmitters can not send data onthe same channel at the same time, if they operate in the same area. That wouldmake the transmissions distort each other. The MAC layer makes sure this doesnot happen [11].

2.3.3 Logical link control and higher layers

The layer called “logical link control” is in charge of making sure that data is in-tact and detecting possible errors. The higher layers are responsible for featuressuch as moving data to the correct destination and interacting with the used soft-ware [11].

2.4 The 802.11n PHY layer

This subsection aims to clarify each part of the physical layer of the 802.11n ver-sion of the standard. That is, to explain modifications done to the data before itis transmitted and how the receiver recovers the data after it has been distortedduring the transmission.

There are several options for how to do the PLCP framing of the information to betransmitted. PLCP stands for “physical layer convergence protocol” and refers tohow 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 “greenfieldmode” [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 ofthe standard. The mixed mode contains the features that were new when IEEE802.11n was introduced, but it can not be fully decoded by receivers followingthe 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 istherefore optional and not commonly implemented [2]. Figure 2.8 describes thePLCP framing for the non-HT mode and mixed mode, according to the standard[1].

Non-HT ShortTraining Field

Non-HT LongTraining Field

Non-HT Signal

Field

HT SignalField

HT LongTraining Field

HT ShortTraining Field

Data Field

Non-HT mode

Non-HT ShortTraining Field

Non-HT LongTraining Field

Non-HT Signal

FieldData Field

Mixed mode

Figure 2.8: The PLCP framing for the non-HT mode and mixed mode,according to IEEE 802.11n [2].

Page 22: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

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 thesignal has been sampled correctly.

The non-HT long training field, “L-LTF”, consists of two long training symbolperiods and a guard interval. It has a total duration of 8 µs. The guard intervalhas 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 beused for detection of an incoming 802.11n packet, synchronizing timers and forantenna selection [2]. The antenna selection entails the use of multiple antennasand 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].

At the receiver end, the detection implementation is important since it finds anapproximate of the start of an incoming signal. The main problem when it comesto detection is the task of finding out whether there is a signal embedded in theincoming noise, or if it is just noise that the receiver is detecting. By formulatinga simple binary hypothesis test, the detection problem can be described [14]. Anincoming packet is considered present if a decision variable exceeds a predefinedthreshold [9]. In general it is better to detect an incoming signal a little bit toooften, rather than missing out on some of the incoming packets [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 eachother, it is likely that it is two following short training symbols that has been de-tected [9].

Another technique used for detection is the “double-sliding window” method.This method takes advantage of the fact that the received signal energy is in-creased when a transmitted signal, instead of noise, is received. A change in thereceived signal energy is being looked for. To reduce the impact of noise samplesthat happen to have large signal energy, a window of certain length is defined.The received signal energy is accumulated over the defined window length [9].An incoming signal would lead to an increased signal energy in a long sequenceof samples, and the defined window verifies that this has happened. A noisesample that happens to have large signal energy is thereby not mistaken for anincoming signal. To improve the detection further, two windows are used. Thealgorithm uses two consecutive windows when accumulating the received signalenergy and the ratio in signal energy between the two windows is taken underconsideration. When an incoming packet is covering the first window completely,

Page 23: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

2.4 The 802.11n PHY layer 11

but has not yet reached the second window, the ratio peaks [9]. Figure 2.9 illus-trates the double-sliding window method. .

Window A Window B

Incoming packet

Ratio between signal energy  contained inwindow A and B 

Figure 2.9: In double-sliding window detection two windows of a certainlength are defined. When an incoming packet has covered window A, butnot window B, the ratio between the signal energy of the windows peak.

This peak is being looked for in the detection algorithm.

“Double-sliding window” and “delay and correlate” are just two examples ofmethods used for detection. The engineer is also free to design own methodsat 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 theL-STF, the exact start can be found using symbol timing [9]. Symbol timing is thetask of finding the precise moment when individual OFDM symbols start andend. 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 meansthe frequency response of the channel is estimated. To do so, the L-LTF can beused [9]. By using the L-LTF one can get a good estimate of the channel frequencyresponse for all the subcarriers. Since the L-LTF is defined in the standard, andtherefore the same in all transmitted 802.11n signals, the receiver can use thisknowledge to estimate the channel. By comparing the received L-LTF sequencewith the known sequence for L-LTF, the receiver can estimate the channel fre-quency response. The received long training symbols are equal to the productof the correct sequence of the long training symbols and the channel frequencyresponse plus additive noise [9].

Page 24: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

12 2 Theory

2.4.2 Non-HT signal field

The non-HT signal field is abbreviated “L-SIG” and it describes the data rateand length in bytes of the frame for IEEE 802.11a and IEEE 802.11g devices [2].These versions of the 802.11 standard can not fully read a signal transmitted by a802.11n receiver, but it is important that devices following these prior protocolsknow when a 802.11n device is transmitting. The 802.11n device sets the datarate to 6 Mbps in L-SIG and a length corresponding the time it will take to trans-mit. Devices following the 802.11a and 802.11g protocols will read the L-SIGfield and thereby know when they are free to transmit themselves and when towait in order to not disturb present 802.11n transmitters [2]. In figure 2.10 thelegacy fields of the mixed mode frame are highlighted. The different physicallayer framings were described in section 2.4.

HT SignalField

HT LongTraining Field

HT ShortTraining Field

Non-HT ShortTraining Field

Non-HT LongTraining Field

Non-HT Signal

FieldData Field

Mixed mode

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.11gtransmitters from interrupting 802.11n transmitters.

2.4.3 HT signal field

The HT signal field, “HT-SIG”, is divided into HT-SIG1 and HT-SIG2 and bothHT-SIG1 and HT-SIG2 have several subfields [1]. The HT-SIG gives the receiverinformation on how to read the transmitted 802.11n signal. The subfields of theHT-SIG field are “Modulation and Coding Scheme”, “CBW 20/40”, “HT Length”,“Smoothing”, “Not Sounding”, “Reserved”, “Aggregation”, “STBC”, “FEC Cod-ing”, “Short GI”, “Number of extension spatial streams”, “CRC” and “Tail Bits”[1]. A description of the purpose of each of these fields can be found in table 2.1.An image describing the structure of the HT-SIG field can be seen in figure 2.11.

CBW 20/40  HT Length Smoothing

HT Signnal Field (HT-SIG) Modulationand Coding

Scheme Not Sounding Reserved Aggregation STBC Short GIFEC coding Number of e.

s. s. CRC Tail Bits

HT-SIG1 HT-SIG2

Figure 2.11: The subfields of HT-SIG, which is the fourth field of the PLCPframing. The HT-SIG field carries information about the received signal,

such as the guard interval (GI) and aggregation [2].

Page 25: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

2.4 The 802.11n PHY layer 13

Name of HT-SIGsubfield Description

Modulation andCoding Scheme

A field of 7 bits, which indicates the index of the MCS table used by thetransmitter. The MCS table tells, among other things, how many spatial

streams that has been used [1].

CBW 20/40It is either 0 or 1. 0 indicates the use of 20 MHz bandwidth, whilst 1

indicates the use of 40 MHz bandwidth[1].

HT LengthIndicates the number of octets of data in the PSDU, so that the

receiver knows what length the PSDU has. This field is 16 bits long [1].

SmoothingThis field is set to either 0 or 1, 1 means channel estimate 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].

Aggregation

If this field is set to 1, it indicates that the packet has an aggregatedPSDU. Meaning several PSDUs are sent in the same packet [2]. If

the packet is not aggregated, this field is set to 0 [1].

STBC2 bits long and indicates the difference in the number of space-time

streams and the number of spatial streams [1].

FEC CodingIt is set to either 0 if BCC encoding is used or 1 if LDPC encoding is

used [1].

Short GI

This field is set to 1 if only a short guard interval is used after theHT training fields in the PLCP frame. If a long guard interval is

used this field is set to 0 [1].

Number ofextension

spatial streams

This field contains two bits. They are set to either 00, 01, 10 or 11depending on how many extension spatial streams are used (four

transmission modes can be used by the transmitter) [1].

CRC

This field is 8 bits long and contains CRC (cyclic redundancycheck) 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 receivedHT-SIG [2].

Tail BitsContains 6 bits which are all set to zero, needed for the convolutional

coder to work [1].Table 2.1: The purpose of each subfield of the PLCP framing field HT-SIG.

2.4.4 HT short training field

The HT short training field, HT-STF, is used for similar reasons as the L-STF. TheHT-STF is implemented in order to help out when it comes to detection at thereceiver end and the field consists of a repeating pattern (the ten short trainingsymbols that were described in section 2.4.1) [2]. The HT-STF has a duration of4 µ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. If20 MHz bandwidth is used, the sequence used to generate the HT-STF is identicalto the L-STF one. The 40 MHz bandwidth case is similar to the 20 MHz one. Itorigins from the 20 MHz version, but it is modulated in several ways [1]. Sincethe HT-STF is half as long as the L-STF, only five (instead of ten) training symbols

Page 26: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

14 2 Theory

fit into this field.

2.4.5 HT long training field

HT-LTF is the high throughput long training field. It has two parts. The first part,“HT-DLTF”, is used when retrieving the data from the data field when mixedmode or greenfield mode is used in the PLCP framing [1]. There are either one,two or four HT-DLTFs. This depends on the number of space-time streams thatare used [1]. The number of space-time streams that are used can be decodedfrom the HT-SIG field, which was described in section 2.4.3. The sum of the num-ber of spatial streams and the number from the STBC subfield tells the numberof space-time streams [1]. The number of spatial streams used can be found fromthe MCS part of the HT-SIG field [1]. In table 2.2 there is information about thenumber of HT-DLTFs depending on the number of space-time streams in a trans-mitted signal..

Number of space-time streams Number of HT-DLTFs1 12 23 44 4

Table 2.2: The number of high troughput data long training fields, HT-DLTFs, depending on how many space-time streams that are used. The num-ber of HT-DLTFs is the same as the number of space-time streams, except forwhen three space-time streams are used. Then four HT-DLTFs are needed[2].

The second part of the HT-LTF is optional, it is called “HT-ELTF”. The HT-ELTFpart is not used to synchronize the data field, but to sound the beamformingfunctionality [1]. Beamforming is a transmission technique which consists inshaping 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 isnot commonly implemented [2].

2.4.6 Data field

The last field of the PLCP framing is the data field. The data field contains thePSDU, “PHY service data unit”, and this is where the actual data can be found [1].In order to create the PSDU, the physical layer first needs to retrieve the MPDU,“MAC protocol data unit”, from the MAC layer (the different layers of the 802.11protocol were described briefly in section 2.3). The transmitter maps the MPDUinto a PSDU by doing modulations to it so that it is suitable for transmission [10].The PSDU is appended to the other fields of the PLCP framing (such as the pre-viously described L-STF and L-LTF, see figure 2.8) and together they make the

Page 27: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

2.4 The 802.11n PHY layer 15

whole packet to be transmitted [10].

The different modulations done before a signal is transmitted are described in thefollowing paragraphs. The PSDU is not always modulated the same way, thereare plenty of alternatives when mixed mode or greenfiled mode is used. Themodulations depend on different factors, such as what type of FEC encoder hasbeen chosen or how many space-time streams the transmitter will create [1]. Areceiver can find information about how a signal was modulated by decoding theHT 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].

Forward error correction encoding

The forward error correction encoding, or “FEC encoding”, is a way to compen-sate for the fact that the channel adds noise to the transmission [16]. The theo-retical capacity, C, of an AWGN channel is defined in Shannon’s limit [9]. Thedefinition of it can be seen in equation 2.1. The capacity of a channel is definedas the amount of information that can be sent, per second, without errors occur-ring [17]. The capacity depends on the signal-to-noise ratio, SNR. It also dependson the available channel bandwidth W. Shannon’s limit defines how high the ca-pacity of a channel can be, but actually reaching that capacity is not an easy task[9].

C = W · log2 (1 + SNR)..[bits/s] (2.1)

.By using FEC encoding, communication closer to the Shannon limit can be reached.The 802.11n standard supports two different types of FEC encoding, these twomethods are called “BCC encoding” and “LDPC encoding” [1].

BCC, binary convolutional codes, encoding is a method where the input data anddelayed versions of it are combined. Parity-check bits are created which leadsto 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.11protocol and an example of how a convolutional encoder can be structured isshown 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 algorithmthat 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 anoptional feature of the standard, but it generally works better than BCC since ithas a coding gain of 1.5 to 3 dB [13].

Page 28: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

16 2 Theory

+

Delay

+

Delay Delay Delay Delay DelayInput data

Output A

Output B

Figure 2.12: Example on how to, on binary level, structure a convolutionalencoder.

Stream parsing

When the data has been FEC encoded, by either using the BCC or the LDPCmethod, it is divided and put into spatial streams. In other words, the data tobe 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 thestream parsing function needs to be adapted to this [2].

Interleaving and mapping

Interleaving is done to change the order of the bits to be transmitted. This is per-formed to spread out the bit errors caused by a deep fading of the received signal.This makes it easier for the system to correct the errors. Adjacent bits are splitup in different OFDM subcarriers [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 ofthe HT-SIG field, as described in table 2.1. The different constellations supportedby IEEE 802.11n are BPSK, QPSK, 16-QAM, and 64-QAM [2].

Space-time block coding

Space-time block coding, “STBC”, is a transmission technique which improvesthe robustness of the communication [13]. This is done by putting multiplecopies of a data sequence across multiple antennas according to a specific pattern,determined by the so-called coding matrix. This makes it possible for a receiverthat misses out on information from one space-time stream (one transmissionpath) to retrieve it from another one [2]. If the STBC functionality is deactivated,each spatial stream will be mapped into a space-time stream. The number of

Page 29: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

2.4 The 802.11n PHY layer 17

space-time streams will be equal to the number of spatial streams. When STBCis 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 aremultiples 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 fourtransmitter 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 themost common way of doing spatial mapping. Direct mapping means each spatialstream 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 thatspace-time streams are retrieved from the STBC process and then spread acrossall the transmit chains [2].

Inverse discrete Fourier transform and cyclic shift

To go from frequency domain to time domain the inverse discrete Fourier trans-form is used and a cyclic shift is also added [1]. The IDFT can be found in equa-tion 2.3. To go back to the frequency domain when the signal has been received,the DFT can be found in equation 2.2. N is defined as the number of samples andx is the signal [18]. The equations are defined as follows:

X(n) =N−1∑k=0

x(k)e−j2πkn/N , (2.2)

x(k) =1N

N−1∑n=0

X(n)ej2πkn/N . (2.3)

.The cyclic shift is included as a prevention of the multi-path fading. The cyclicshift can be inserted either before (prefix) or after (suffix) the IDFT and there

Page 30: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

18 2 Theory

are three different types to choose from [1]. They are described further in theprotocol for 802.11n.

Guard insertion and windowing

Guard interval and windowing are two ways of improving signal quality [2]. Theguard interval is added to the beginning of the data field and consists of a repe-tition of the end of it. The windowing is an optional part of the standard and itis performed on the beginning of the data field. When appending different fieldsof a frame to be transmitted, time-domain discontinuities will occur at the edgesof fields. This causes problems when the Fourier transform is done. Window-ing is performed to make the transition from one symbol to another smooth, andthereby avoid this problem [1, 12].

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 anduniversities 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 GHzand bandwidths up to 56 MHz [5, 6].

Page 31: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

3Method

This chapter describes how the project was carried out. The relationship betweenthe different parts of the system is explained. The implementation of each partof the system is also described in detail.

3.1 Overview of the workflow of the receiver

The main approach when implementing the system was to work on decodingeach part of the preamble of an incoming packet one by one, until being able todecode the data field. As mentioned in chapter 2, there are three different types ofphysical layer framing supported in the standard. Since one of them, greenfieldmode, is optional and not commonly implemented, it has not been considered inthis project. The project mainly focuses on non-HT and mixed mode. The mixedmode frames were the most important ones to be able to decode. The reason forthat was the fact that the mixed mode frames are the ones that define the func-tionalities exclusive to the standard, whilst the non-HT ones are only used forlegacy purposes.

In figure 3.1 a flowchart that describes the system work flow of the final systemcan be seen. Decoding of non-HT mode frames was tested during implementa-tion but not integrated into the final system.

19

Page 32: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

20 3 Method

Detection ofincoming packet

Synchronization ofdetected packet

Channel estimation

Decoding of HT-SIG

Channel estimation

Information embedded inHT-SIG used in this

process

Decoding of mixedmode data field

Termination ofprocess

Decoding of HT-SIGsuccessful

Decoding of HT-SIGnot successful

Termination ofprocess

Packet detected

No packet detected

Figure 3.1: Flowchart providing an overview of the system work flow. Insection 3.2.10 a flowchart describing the last step (“decoding of mixed

mode data field”) can be seen.

3.2 System model in detail

Initially a complete 802.11n communication chain was designed using the MAT-LAB WLAN toolbox. This was done by following instructions from the WLANtoolbox getting started guide and relying on an example provided therein. Thecommunication chain worked without errors, but could not be used as a completereceiver. Important features, such as detection of an incoming signal and usingthe information from HT-SIG, were not implemented. WLAN toolbox functions

Page 33: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

3.2 System model in detail 21

were not to be used in the final implementation.

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 functionsto make them independent on WLAN toolbox. In the following subsections thesubsystems 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 lookedfor. Since the number of samples in each short training symbol depends onwhether 20 MHz or 40 MHz bandwidth has been used, the subsystem loops twice.

Initially, the detection algorithm looks for a pattern which repeats every 16thsample. 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 MHzbandwidth is considered detected. Provided that the incoming signal has beensampled 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 justestimates. The detected start of an incoming packet is an estimate and the resultcan therefore be a few samples away from the actual start.

3.2.2 Symbol timing

To get a more exact estimate of the start of an incoming packet, symbol timingis done after the detection. The symbol timing uses the L-LTF, and therefore re-quires that the correct sequence is known. The correct L-LTF sequence is used forreference when performing symbol timing.

The L-LTF sequence is provided with the system in a MAT file. The file containstwo vectors. The vectors contain the correct L-LTF sequences for the 20 MHz and40 MHz bandwidth case, respectively. Knowledge about whether 20 MHz or 40MHz bandwidth has been used is provided to the symbol timing subsystem fromthe detection algorithm described earlier.

3.2.3 Carrier frequency offset correction

To compensate for the induced frequency shift in the received signal, carrier fre-quency offset estimation and correction was integrated into the system.

A coarse frequency offset estimation is done by looking at the average frequency

Page 34: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

22 3 Method

offset of the subcarriers in the L-STF sequence. A fine offset estimation is doneby 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 informationto 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 carrierfrequency offset is too large, the fine estimation can not be used. The L-STF istherefore used beforehand to do a coarse estimation and compensation, therafterthe carrier frequency offset is within range for the fine estimation to be used.

3.2.4 Channel estimation using L-LTF

In the later stages of the system work flow, an estimation of the channel is neededto recover the information embedded in the L-SIG and HT-SIG fields. The chan-nel estimation is performed using the L-LTF sequence.

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 IEEE802.11n protocol, and a channel estimate is obtained by using the method ofleast 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 thecorrect one. “ChanEst” is the channel estimate, which is the unknown sequencethat the subsystem estimates. Equation 3.2 shows how the estimation is done.“./” is the MATLAB command for right array division. “mean” stands for meanvalue. The mean value is calculated along the second dimension, resulting ina column vector corresponding to the channel estimate. The matrix containingL-LTF sequences is a square matrix.

[ LLTF LLTF ... LLTF ] · ChanEst = RecLLTF (3.1)

mean(RecLLTF ./ [ LLTF LLTF ... LLTF ]) = ChanEst (3.2)

3.2.5 Noise variance estimation

The implemented square root of the noise variance was estimated as in equation3.3. Std stands for standard deviation. “RecLLTF” is the received and demodu-lated L-LTF sequence whilst “LLTF” is the correct one. “ChanEst” is the channelestimation done by using the L-LTF.

√NoiseVarEst = std(LLTF · ChanEst − RecLLTF) (3.3)

.The noise variance was estimated to be used in the recovery of L-SIG, HT-SIG andthe transmitted data sequence.

Page 35: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

3.2 System model in detail 23

3.2.6 Recovery of L-SIG

The recovery of the L-SIG field is crucial for receivers following prior standards.As described in section 2.4.2, it is a “dummy” field used by prior standards tocalculate the length of a transmission.

L-SIG recovery functionality was however implemented. The implemented sys-tem uses the channel estimation and noise variance estimation to recover theL-SIG field. By recovering the L-SIG field one can make sure that the rate is set to6 Mbps as specified in the standard.

3.2.7 Recovery of HT-SIG

By using the channel estimation and the noise variance estimation the bit se-quence which makes up the HT-SIG field is recovered. BPSK demapping alongwith BCC decoding is performed.

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 checkis done to make sure the information has been extracted correctly.

The number of space-time streams is needed by subsystems used later in thereceiver. The number of space-time streams could not be decoded straight awayfrom the recovered HT-SIG bit sequence. However it could be calculated by look-ing at the information about STBC and MCS.

3.2.8 Deciding the length of HT-LTF

As mentioned in section 2.4.5, the length of HT-LTF in a received packet is differ-ent depending on the number of space-time streams. The standard supports 1, 2,3 or 4 space-time streams.

The number of space-time streams was decided when extracting the informationembedded 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 MHzbandwidth is used compared to when 20 MHz bandwidth is used.

3.2.9 Channel estimation using HT-LTF

A second channel estimation was done at this point in the receiving process.Channel estimation by using the HT-LTF was done to recover the transmitteddata packet.

The channel estimation worked in similar manner as the one described in section3.2.4. The number of space-time streams was taken into account when doing the

Page 36: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

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. Ifthere were more than one space-time stream transmitted the number of trainingsymbols is increased.

3.2.10 Recovery of the transmitted data

The last process in the receiving chain is to decode the transmitted data sequence.If the MAC layer would have been implemented, the MPDU would be extractedat this stage. Since the MAC layer is not implemented, the receiver is extractinga randomly generated bit sequence that has been transmitted for testing.

The input parameters to the subsystem are the remaining samples of the receivedsignal, the channel estimation done by using HT-LTF, the noise variance estimateand the information from HT-SIG about how the data has been decoded.

The subsystem does OFDM demodulation to retrieve the original state of thesequence, 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 symbolsto 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 inthis subsystem, to finally retrieve it the transmitted bit sequence, in figure 3.2 aflowchart providing the subsystem work flow is given. When the subsystem hasworked its way, the data has finally been recovered.

OFDM demodulation Equalization using channelestimate Constellation demapping

Deinterleaving 

BCC or LDPC encoding

LDPC BCC or LDPC channeldecodingStream deparsing

BCC

Descrambling Data sequence retrieved

Figure 3.2: Data recovery chain, done by the subsystem being responsiblefor the data field.

3.3 Performed tests and simulations

The system was tested by transmission of packets generated in MATLAB from oneUSRP acting as transmitter to another USRP acting as receiver. The USRP receiver

Page 37: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

3.3 Performed tests and simulations 25

sent the packets to a computer running MATLAB to perform data decoding. Afterdecoding, the received bit sequence was compared to the transmitted one. Thearrangement can be seen below, in figure 3.3.

SDR transmitting

Computer

SDR receiving802.11n packets 802.11n packets

Figure 3.3: A SDR (USRP) transmitting 802.11n signals generated inMATLAB. The signals are captured by a SDR and then sent back to the

computer for decoding by the implemented system.

.The experimental tests were done using 20 MHz bandwidth, BCC encoding andsingle input single output (one antenna on both transmitter and receiver). 100packets were transmitted, received and decoded. The magnitude of the trans-mitted packets was adjusted during the tests to obtain different SNR. This wasrepeated 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 toobtain QPSK was 1, the index to obtain 16-QAM was 3 and the index to obtain64-QAM was 5.

Simulations were also done to evaluate the system. White gaussian noise wasadded to the signal during the simulation tests to mimic a channel. The noise wasincreased to decrease SNR, whilst the magnitude of the actual signal remainedconstant.

In the simulations, the lowest and highest SNR had a noise variance of 0.6360and 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, thesuccessful tests (where no distortions from nearby devices were detected) wereconsistent in terms of noise floor and noise variance.

Page 38: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used
Page 39: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

4Results

The results of the performed tests are presented in this chapter. These resultsinclude both experimental tests performed by using a pair of USRPs, and testsperformed solely in MATLAB with a simulated channel.

4.1 Test set-up

As previously mentioned, all tests (including both USRP tests and tests done inMATLAB using a simulated channel) were done with BCC encoded packets anda 20 MHz bandwidth. The sample rate used for the experimental tests was 40MHz, transmission in the 2.4 GHz frequency band. In the tests over computer-simulated channels solely white gaussian noise was added to the signal to simu-late a channel. All of the four supported constellations (BPSK, QPSK, 16-QAMand 64-QAM) were tested and for each constellation 100 packets, including 8192encoded bits each, were transmitted and received.

The transmitted bit sequences were semi-randomly generated from a seed. Theexact same sequences were used in the MATLAB tests as in the USRP tests.

4.2 Packets received on USRP

Due to the distortions in the air not being constant, the quality of the packets thathad been transmitted and received using the USRPs would vary a lot. Tests per-formed during late office hours, when the office was less crowded, would yieldin less distorted packets. In the following two plots the same sequence of pack-ets has been received at two different occasions. Figure 4.1 shows a receivedsequence distorted due to interference caused by an unidentified device nearby.

27

Page 40: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

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 tothem 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

Mag

nitu

de

Received packets, distorted

Figure 4.1: Sequence of received packets, clearly subject to interferencecaused by an unknown device using the same frequency band.

Time

Mag

nitu

de

Received packets, not distorted

Figure 4.2: Sequence of received packets, free of any interference.

Page 41: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

4.3 USRP tests 29

4.3 USRP tests

Packet error rate (PER) and bit error rate (BER) versus SNR from the USRP testsare presented in this section. Since only 100 packets were received, a PER equalto 10−2 means an error-free packet delivery. Figure 4.3 shows the PER versus theSNR. It can be observed that 64-QAM does not reach a SNR level that yields in aPER equal to 10−2. Increasing the SNR further would make the received signaloverdriven, causing a clip off at the peaks.

BPSK and QPSK requires the same signal power to work successfully. Apartfrom this exception, advanced modulations require higher SNR level to achievethe same PER. Advanced modulations requiring higher SNR is in line with thetheory.

In figure 4.4 the BER versus SNR can be seen. The same data was used in theBER plot as in the PER plot. However, one received packet would yield in a totalof 8192 received bits. Thereby there were more bits than packets available. Inthe BER plot, BPSK and QPSK still require the same SNR to work successfully.

0 5 10 15 20 25 30 35 40

SNR

10-2

10-1

100

PE

R

PER vs SNR, USRP

64-QAM16-QAMQPSKBPSK

Figure 4.3: Packet error rate versus signal-to-noise ratio, tests performedwith USRPs.

Page 42: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

30 4 Results

0 5 10 15 20 25 30

SNR

10-4

10-3

10-2

10-1

BE

R

BER vs SNR, USRP

64-QAM16-QAMQPSKBPSK

Figure 4.4: Bit error rate versus signal-to-noise ratio, tests performed withUSRPs.

4.4 Simulations

For validation and comparison, the system was also tested in simulations. Aspreviously mentioned, the filter simulating a channel consisted of white gaussiannoise. 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 simulationsone can clearly see that QPSK requires a higher SNR than BPSK. PER versus SNRfrom the simulations can be seen in figure 4.5.

4 6 8 10 12 14 16 18 20 22

SNR

10-2

10-1

100

PE

R

PER vs SNR, simulations

64-QAM16-QAMQPSKBPSK

Figure 4.5: Packet error rate versus signal-to-noise ratio, simulated tests. Incontrast to the USRP tests, 64-QAM achieved error-free communication inthis case. The fact that only white gaussian noise, and no other distortions,

was used to simulate the channel is probably one reason for this.

Page 43: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

4.5 Comparison of USRP tests and simulations 31

4.5 Comparison of USRP tests and simulations

In this section, a comparison between the results of the USRP tests and simula-tions are presented. In figure 4.6 the PER of both USRP tests and simulations areplotted. One can see that the tests follow the same pattern in terms of neededSNR, although the plots from the simulations are more reasonable. The expectedresult was that a more advanced constellation pattern requires a higher SNR. Thisis true for the simulations. However, BPSK requires as high SNR as QPSK in theUSRP tests.

0 5 10 15 20 25 30 35 40

SNR

10-2

10-1

100

PE

R

PER vs SNR, simulations and USRPs

64-QAM USRPs16-QAM USRPsQPSK USRPsBPSK USRPs64-QAM simulations16-QAM simulationsQPSK simulationsBPSK simulations

Figure 4.6: Packet error rate versus signal-to-noise ratio, simulated testsand USRP tests.

4.6 Reasons for unsuccessful packet decoding

When decoding signals, the system might fail the decoding for different reasons.At low SNR the system would not only have a hard time decoding the data field.There would also be a cyclic redundancy check failure occurring when decodingthe HT signal field. Problems detecting the signal at low SNR also occurred. Abar diagram showing the rate of different reasons for system failure can be seenin figure 4.7.

Page 44: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

32 4 Results

Reason for failure when decoding signals with SNR 3.5

0

5

10

15

20

25

30

35

40

45

50

%

Error when decoding data fieldError when detecting signalError when decoding HT-SIG field

Figure 4.7: Different reasons for system failure at low SNR.

Page 45: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

5Discussion

In this chapter the results that were presented in the previous chapter are dis-cussed. This is done along with comments on the method used for the project,which was described in chapter three. Ethical and society related aspects are alsotaken under consideration, in the section about further context.

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.

5.1.1 Tests done with simulated channel

In the tests done with a simulated channel, the resulting PER plot looked as ex-pected. Depending on the complexity of the constellation pattern, a higher SNRwas needed to decode the packets correctly. Even though only 100 packets wereused to decide packet error ratio, the tests supported the theory stating that con-stellation with fewer points can tolerate more distortion.

5.1.2 Tests done with USRPs

The results from the tests done with the USRPs did not come out as expected. Itis not likely that QPSK is as tolerant to errors as BPSK, since that tells againstthe theory part about constellation diagrams. The lines of the plots are also veryuneven, compared to the plots of the simulation tests. A possible reason for thisresult is the fact that the tests probably had quite a large margin of error.

33

Page 46: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

34 5 Discussion

As mentioned in the theory chapter, the MAC layer is in charge of making itpossible for a group of wireless systems to share the same space and frequencies.Since no MAC layer is implemented in the system, the lack of it is likely to causeproblems. The tests were preformed at the Swedish Defense Research Agencyand WLAN connection is not allowed there. However, the received signals wereclearly distorted by other devices operating on the same frequencies. These dis-tortions could, for instance, origin from the wireless computer mice used at theoffice or other devices nearby.

5.2 Method

The testing part of the project could have improved a lot. In general, the methodof developing the system design worked well though.

In terms of USRP testing, the main issue was probably the fact that only 100packets were received for each PER calculation. Since the environment was veryunreliable in terms of distortions, tests including more packets would probablyhave resulted in better plots.

If more time would have been assigned to the project, more transmit packetscould have been captured during the test phase. The USRP tests were automa-tised in some ways, but could have been even more automatised. This wouldhave made the USRP tests more time effective.

Changing environment could have been another solution to avoid distortions andthereby achieve better results. However, it is very hard to find an environmentfree from signals in the 2.4 GHz frequency band since it is widely used by techni-cal devices.

5.3 The project in further context

WLAN systems themselves are probably not an ethical dilemma. On the otherhand, the way a WLAN system is used could of course lead to ethical dilemmas.Sensitive information could, for instance, get widely spread using a WLAN sys-tem.

For whom different frequency bands should be available is also a society linkedissue 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.

Page 47: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

6Conclusion

In this chapter the purpose of the project, together with the problem statementsare discussed. A section about future work is also included, which describesfurther developments that can be done.

6.1 Purpose

The purpose of the project was to implement a system which decodes IEEE 802.11nsignals. A MATLAB design has been proposed. This MATLAB design can be com-piled into C code using MATLAB Coder. For the implemented system, C codeis preferred by the Swedish Defense Research Agency and the possibility to useMATLAB 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 lookas expected, packets transmitted through the air were possible to decode. Thisincludes all of the four supported constellation patterns.

6.2 Problem statements

The defined problem statements were the following:

• What are the main characteristics of IEEE 802.11n?

• Can a USRP together with MATLAB be used to effectively implement thephysical layer of an IEEE 802.11n receiver?

To summarize, the main characteristics of IEEE 802.11n are the possibility ofusing either 2.4 GHz or 5 GHz frequency bands, legacy compatibility and also

35

Page 48: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

36 6 Conclusion

modern features that are not compatible with prior versions of the standard. Thisincludes 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.

6.3 Future work

This project itself could be worked on further, by performing more tests and re-ceiving signals with multiple antennas (multiple output) since that is one of thefeatures supported by the standard. Other features suitable for further tests areLDPC encoding, extension spatial streams and utilizing the 5 GHz frequencyband. Another future task is to compile the MATLAB code that the project re-sulted in into C code, using MATLAB Coder.

Developments that could be done to the proposed design is to advance the systemby 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. Forinstance, the possibility of sounding the beamforming functionality supportedby IEEE 802.11n.

A further development could also be to add features related to IEEE 802.11ac,that are not included in IEEE 802.11n. Since IEEE 802.11ac can be considered adevelopment of the 802.11n protocol, it is a possible way to evolve the proposeddesign.

Page 49: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

Bibliography

[1] I. C. Society, “802.11n-2009 - IEEE standard for information technology–local and metropolitan area networks– specific requirements– part 11: Wire-less LAN medium access control (MAC)and physical layer (PHY) specifi-cations amendment 5: Enhancements for higher throughput,” IEEE Std802.11-2009, Oct 2009.

[2] M. S. Gast., 802.11n: A Survival Guide. O’Rielly Media, 2012.

[3] M. S. Gast, 802.11ac: A Survival Guide. O’Rielly Media, 2013.

[4] I. C. Society, “802.11ac-2013 - IEEE standard for information technology–telecommunications and information exchange between systems—local andmetropolitan area networks–specific requirements–part 11: Wireless LANmedium access control (MAC) and physical layer (PHY) specifications–amendment 4: Enhancements for very high throughput for operation inbands below 6 GHz,” IEEE Std 802.11-2013, Dec 2013.

[5] Ettus Research, USRP B200/B210 Bus Series, 2019.

[6] Ettus Research, USRP B200mini Series, 2019.

[7] L. A. J. Zander and B. Slimane, Principles of Wireless Communications. Stu-dentlitteratur, 2018.

[8] M. Olofsson and E. Björnsson, Introduction to Digital Communication.Linköpings universitet, 2018.

[9] J. Heiskala and J. Terry, OFDM Wireless LANs: A Theoretical and PracticalGuide. Sams, 2002.

[10] B. W. S. Mangold and L. Berlemann, IEEE 802 Wireless Systems: Protocols,Multi-hop Mesh/Relaying, Performance and Spectrum Coexistence. JohnWiley & Sons, 2006.

[11] J. Geier, Wireless LANs: Implementing high performance IEEE 802.11 net-works. Sams, 2002.

37

Page 50: Software-Defined Radio Receiver for IEEE 8021477401/... · 2020. 10. 19. · Release year 1999 1999 2003 2009 2013 Table 1.1: IEEE 802.11 release years [3, 4]. A device often used

38 Bibliography

[12] I. C. Society, “IEEE standard for information technology–telecommunications and information exchange between systems-localand metropolitan area networks—-specific requirements–part 11: WirelessLAN medium access control (MAC) and physical layer (PHY) specifications,”IEEE Std 802.11™-2016, Dec 2016.

[13] E. Perahia and R. Stacey, Next generation wireless LANs. Cambridge Univer-sity Press, 2008.

[14] S. Kay, Fundamentals of Statistical Signal Processing, Volume II: DetectionTheory. Prentice-Hall PTR, 1998.

[15] D. Tse, Fundamentals of Wireless Communication. Cambridge UniversityPress, 2005.

[16] D. W. Bliss, Adaptive Wireless Communications: MIMO Channels and Net-works. Cambridge University Press, 2013.

[17] E. G. Larsson, Signals, Information and Communications. LiU-Press, 2017.

[18] F. G. L. Ljung and M. Millnert, Signal Processing. Studentlitteratur, 2010.

[19] M. Yildirim, “OFDM based communication system using USRP,” TwelveInternational Conference on Electronics Computer and Computation(ICECCO), 2015.

[20] S. Kay, Fundamentals of Statistical Signal Processing, Volume I: EstimationTheory. Prentice-Hall PTR, 1993.