0% found this document useful (0 votes)
30 views11 pages

Towards An SDR Implementation of LoRa Reverse-Engineering

Uploaded by

rania
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views11 pages

Towards An SDR Implementation of LoRa Reverse-Engineering

Uploaded by

rania
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Computer Communications 153 (2020) 595–605

Contents lists available at ScienceDirect

Computer Communications
journal homepage: www.elsevier.com/locate/comcom

Towards an SDR implementation of LoRa: Reverse-engineering,


demodulation strategies and assessment over Rayleigh channel
Alexandre Marquet ∗, Nicolas Montavont, Georgios Z. Papadopoulos
IMT Atlantique, IRISA, F-35576 Cesson Sévigné, France

ARTICLE INFO ABSTRACT


Keywords: LoRa is a popular low-rate, Low-Power Wide Area Network (LPWAN) technology providing long range wireless
LoRa access over unlicensed sub-GHz frequency bands to the Internet of Things (IoT). It has been used in many
Internet of Things (IoT) applications ranging from smart building to smart agriculture. LoRa is a patented modulation. However
Chirp Spread Spectrum (CSS)
preliminary reverse-engineering efforts documented parts of it. In this article, we detail the different stages
Reverse engineering
of LoRa transceivers: channel (de)coding, (de)whitening, (de)interleaving and (de)modulation with reverse-
Low-Power Wide Area Networks (LPWAN)
Soft-value decoding
engineering in mind. Closed-form expressions for each of these stages are given, and different demodulation
Rayleigh channel and decoding strategies are presented. This allows for a complete modeling of LoRa, which enables Software
Software Defined Radio (SDR) Defined Radio (SDR) implementations, as well as performance assessment under various channel conditions.
Cognitive radio These simulations show that LoRa systems have good properties for time and/or frequency selective channels
(especially for the latter), thanks to the robustness of its underlying Chirp-Spread Spectrum (CSS) modulation.

1. Introduction technologies. It has the advantage of operating within non-licensed


bands, which facilitates its deployment.
The Internet of Things (IoT) is a general concept of connecting LoRa is a long range, low data rate and low power technology
‘‘things’’ to a global network using standardized protocols and following designed for constrained devices, based on a new modulation which
the principles of the Internet. A thing, or an object, is usually a sensor is referred as Chirp Spread Spectrum (CSS) [1]. On top of this physical
and/or an actuator that can gather specific data or control a system. layer, the LoRaWAN protocol was developed to provide access to the
There a many applications in which connected objects are used, ranging medium. In LoRaWAN, the network is organized in a star topology,
from entertainment to home automation and industrial applications. with a gateway at the center. The gateway is then connected to a
For example, for smart buildings, objects can be used to perform core network via traditional Internet links. The medium access is based
metering (water, electricity, etc.), or light and temperature automatic on the ALOHA protocol, where devices directly transmit their traffic
control. In the Industry 4.0, the IoT can be used in closed-loop systems, to gateways, without spectrum sensing nor dedicated time/frequency
in order to monitor and possibly control production chains. slots.
While each application has specific requirements, we can still enu- LoRa is however a closed physical layer, which prevents study-
merate constraints that are common to most scenarii, such as low ing the technology, and developing various optimizations likely to be
energy consumption, low processing capabilities and low memory us- proposed by the community. Disposing of a proper description of the
age. Thus, objects use wireless communication standards dedicated to modulation chain could enable the research and development of better
IoT. They usually are lossy by design, low data rate, and consume receivers to achieve better range or higher data rate. Furthermore the
less energy compared to standards of the classical Internet. Several ISM band, used by many consumer devices ranging from WiFi-enabled
options are available, and the choice is not straightforward. On the products to wireless doorbell and LoRa IoT devices, is an overcrowded
one side, there are technologies for short range radios, that allows for physical resource. In this kind of environment, cognitive radio (i.e.,
communications within a limited area, such as a few tens of meters. On smart radios, able to cooperatively share the spectrum, and minimize
the other side, there are technologies for long range transmissions, able energy consumption) is a promising technology. Now, cognitive radios
to cover several kilometers of distance. These long range technologies need to be able to (i) sense their environment (spectrum, mainly),
are especially well fitted for smart-city applications, where a whole (ii) take decisions and (iii) reconfigure their physical layer [2]. While
city can be covered using only a few antennas. LoRa is one of these taking decisions relies entirely on software, environment sensing and

∗ Corresponding author.
E-mail addresses: [email protected] (A. Marquet), [email protected] (N. Montavont),
[email protected] (G.Z. Papadopoulos).

https://doi.org/10.1016/j.comcom.2020.02.034
Received 18 October 2019; Received in revised form 30 January 2020; Accepted 11 February 2020
Available online 14 February 2020
0140-3664/© 2020 Elsevier B.V. All rights reserved.
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

physical layer reconfiguration typically involve both software and hard- compare demodulation strategies, as well as to assess CSS and LoRa per-
ware (the radio). This drives a need for very flexible radios, that can formance over AWGN, time selective, frequency selective and Rayleigh
be provided with Software Defined Radios (SDR). Indeed, the SDR fading channels.
paradigm aims to perform as much signal processing as possible in
software. As a result, within the frequency band reachable by the 2. Related work
analog front-end of an SDR, transmitting, receiving and sensing any
signal is only a matter of processing power and software, which are very Most of the literature related to LoRa is actually focused on upper
flexible. As a result, a proper SDR implementation of a LoRa transceiver layers (e.g., LoRaWAN), applications and security [8,9]. A fair amount
would help research and development of smart radios in the ISM band of the research effort is also directed towards the CSS modulations
(either to sense LoRa transmissions, or to communicate using it). (receiver improvements, new modulations based on it, etc.). However,
The LoRa physical layer is not described in a standard, and is most likely due to the lack of publicly available hardware, only a few
not published anywhere outside the Semtech patent, that only covers studies have been conducted to describe and analyze, from a theoretical
CSS modulation, interleaving (which is close, but not identical to the point of view, the LoRa transmission chain. Indeed, between CSS (as
one actually used in LoRa), and preamble synchronization [1]. To the underlying modulation), and LoRaWAN, as the preferred Media
the best of our knowledge, the most significant progress towards a Access Control (MAC) protocol, LoRa includes a number of physical
complete characterization of the LoRa physical layer was published by layer techniques, namely: channel coding, whitening, and interleaving,
Knight et al. [3] and Robyns et al. [4]. Both provided open-source SDR that have a strong impact on LoRa system performance. It is worth
implementations of LoRa receivers. However, the demodulator adopted analyzing and discussing the algorithms used in LoRa, in order to know
in [4] requires high Signal-to-Noise Ratios (SNR), while the implemen- its actual performance and behavior in details, as well as to propose
tation of [3] does not work in LoRa implicit mode (no header), and is evolutions or contenders to the technology.
not maintained since 2017. In both cases, the articles are really focused Knight et al. [3] and Robyns et al. [10] wrote the only two reports,
on implementation. Thus, they do not provide any radio-agnostic evalu- to the best of our knowledge, which document a reverse engineering
ation, using either simulations or theoretical development. We believe work on LoRa and provide open source implementations. However,
that only a rigorous modeling will allow research efforts to identify Robyns et al. [10] provided a sub-optimal CSS demodulator which
adequate use cases, strong and weak points of the LoRa modulation. requires high SNR. The implementation of Knight et al. [3] uses an
Such a modeling will also pave the way for integration of CSS im- optimal demodulator. However, as pointed out by [10] (based on
provements proposed in the literature (e.g., collision mitigation [5,6], their experiments), Knight et al. wrongly assumed that dewhitening
spectral efficiency improvement [7]) into later revisions of LoRa, or should be performed prior to deinterleaving. Note that this does not
into competitor systems. prevent them to actually receive and decode LoRa message, thanks to
In this article, we propose an analysis of the LoRa physical layer the linearity of whitening and interleaving operations used in LoRa.
and a proper decomposition of the modulation and demodulation steps, It does, however, make the retro-engineering process more difficult
each described using closed-form input–output relationships. To the (for instance, in Knight et al. implementation, different whitening
best of our knowledge, this is the first time that such a detailed sequences are needed depending on the spreading factor, which is not
description of LoRa transceivers architecture is presented opening, thus, necessary when deinterleaving is done prior to dewhitening). Other
possibilities for independent simulations and implementations, as well implementations exist, but are not properly documented and hard to
as propositions and evaluation of potential improvements (e.g., better set up (e.g., [11]).
channel coding, joint modulation and coding, etc.). We demonstrate the Regarding the CSS modulation, Goursaud et al. gave a continuous-
potential of such modeling, through the proposition of several possible time expression of CSS signals in [12]. Vangelista et al. [13] derived
demodulation chains for LoRa, and comparison of performance when the optimal receiver over Additive White Gaussian Noise (AWGN), and
𝑀-FSK is used instead of CSS. Furthermore, our description of the Elshabrawy et al. [14] found out that CSS modulation is an instance of
discrete-time complex baseband equivalent of CSS signals and, more orthogonal signaling, and used this result to give closed-form formulas
generally, discrete time descriptions of every algorithm of this article of bit-error probability over AWGN and Rayleigh fading channels. More
makes it a reference for digital implementations using, for instance: recently Ghanaatian et al. [15] studied the impact of Carrier Frequency
SDR, Digital Signal Processor (DSP) or Field Programmable Gate Array Offset (CFO) and Sampling Frequency Offset (SFO) on CSS signals, us-
(FPGA). In more details, the main contributions of this article are: ing analytical models and simulations over AWGN. They also described
methods for estimating CFO and SFO based on the LoRa preamble, as
• A detailed analysis of the LoRa physical layer, formally describing
well as compensation techniques to cancel these impairments. Several
all the algorithms involved in LoRa transmission chains.
improvements and variations of CSS have been proposed, mostly fo-
• Methods to reverse-engineer the key-parameters of every algo-
cused on spectral efficiency improvements. Bomfin et al. [16] proposed
rithms used for LoRa communications.
to encode information in the phase of CSS symbols, which is similar to
• Assessment of different receiver chains for LoRa, under various
coplanar 𝑀-FSK proposed by Roth et al. [17]. Kim et al. [18] proposed
channel conditions (time selective, frequency selective, Rayleigh).
to use both up- and down-chirps to encode more information. Vange-
• Comparison of CSS and 𝑀-FSK (𝑀-arry Frequency Shift Keying)
lista et al. [7] proposed a technique to double the spectral efficiency of
with various channels.
CSS, at the price of a 3 dB penalty in SNR.
Performance assessment shows that CSS (and thus, LoRa) is especially
good, compared to 𝑀-FSK, when faced with frequency-selective chan- 3. System architecture and reverse-engineering
nels without mobility. In every other scenarii (AWGN, time-selective,
Rayleigh channel), it retains the performance of 𝑀-FSK. This section details all the algorithms involved when transmitting
The remainder of this article is organized as follows. In Section 2, we and receiving data over LoRa, as originally described in [10] (see
first summarize the recent works regarding LoRa reverse-engineering, Fig. 1). We also provide instructions on how to reverse-engineer key
performance assessment and SDR implementations. Section 3 formally parameters for these algorithms.
details the LoRa architecture, gives methods to reverse-engineer indi- The message consists in 𝐿 bits, and is modeled as a binary vector of
vidual components of the transceiver, to implement them, and then independent and identically distributed bits: 𝐛 ∈ {0; 1}𝐿 .
derives a discrete-time complex baseband equivalent of CSS modulated Channel code is introduced to improve reliability to noise. This step
signals. Then, Section 4 gives closed-form expressions for various CSS introduces redundancy, and yields a (longer) binary sequence denoted
demodulation strategies. Finally, simulations in Section 5 allow to 𝐛c ∈ {0; 1}𝐿∕𝜂 , with 0 < 𝜂 < 1 the coding efficiency.

596
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

in Section 3.3. The input–output relationships for interleaving and


deinterleaving are also formally given, using equations. Similarly to
the dewhitening process, the deinterleaving process, in the receiver,
is slightly different depending on the use of hard or soft bit values
(which, ultimately, define the kind of decoding strategy used). Finally,
continuous-time and discrete-time signal models for CSS are given in
Section 3.4. Different demodulation strategies will be presented later,
in Section 4.

3.1. Channel coding and decoding

The goal of any channel code is to make transmissions more robust


Fig. 1. Architecture of a LoRa transceiver. to noise, introduced by communication channels, using redundancy.
In LoRa, the amount of redundancy is controlled by the ‘‘coding rate’’
parameter [20], denoted as CR ∈ [1; 4] in the following. In [3] and [10],
Channel coding introduces correlation between bits, which is usu- authors have determined that LoRa uses systematic block codes. It
ally unwanted for designing the receiver. Reducing this correlation is produces codewords of (4 + CR) bits, using input blocks of 4 bits, giving
the goal of the whitening algorithm, which computes an exclusive- a code efficiency 𝜂 = 4∕(CR + 4).
OR of 𝐛c with a whitening sequence 𝐰 ∈ {0; 1}𝐿∕𝜂 , which possesses This subsection is divided into four parts. First, we describe the
good statistical properties. This results in a sequence of whitened bits coding process. Then, we give a method to reverse-engineer the key-
𝐛w ∈ {0; 1}𝐿∕𝜂 . parameter of the code: its generator matrix. The last two parts describe
Then, the interleaver scatters the coded sequence in time, in order hard-value and soft-value decoding strategies, with the former being
to reduce the impact of impulsive noise [19, Chap. 14.6]. The output less performant, but also less computationally demanding than the
of the interleaver is a deterministic shuffle of the bits in 𝐛w , which is latter.
denoted as 𝐛i ∈ {0; 1}𝐿∕𝜂 .
Next, groups of SF bits are made in order to produce symbols taking 3.1.1. Coding
their values in  = [0; 2SF − 1] ⊂ N, yielding a sequence of symbols Let us denote 𝐛𝐤 the 𝑘th block of 4 bits in 𝐛, and 𝐛c𝐤 the associated
𝐜 ∈ 𝐿∕(SF.𝜂) . Note that, in the context of CSS systems, SF is referred codeword, containing CR + 4 bits. Then, the coding process can be
as the Spreading Factor: the higher the SF, the higher the dispersion described by the following equation:
of the information carried by each symbol in the time–frequency plane
(hence, at fixed bandwidth, a higher SF means a longer time on air). 𝐛c𝐤 = 𝐆𝐛𝐤 , (3)
The correspondence between groups of SF bits and values in  follows
where 𝐆 is the binary generator matrix. Note that (3) and following
a Gray mapping, so that adjacent symbol values encode binary values
equations in this part use arithmetics over GF(2), which means that
that only differ by one bit.
additions use exclusive-OR and multiplications use logical AND. Given
The transmission chain ends with the CSS modulator, that translates
that the code is systematic, we have:
𝐜 into a physical signal 𝑠(𝑡), which is observed as a corrupted signal 𝑟(𝑡). ( )
The receiver basically revert every steps done in the transmitter. 𝐏
𝐆= , (4)
Individual components of the receiver either produce estimates, de- 𝐈4
noted with a hat (for example, 𝑏̂c is an estimate of 𝑏c ), or bitwise where 𝐈4 is the (4 × 4) identity matrix, and 𝐏 is a (CR × 4) binary matrix
Log-Likelihood Ratios (LLR), denoted with an 𝐿 (for example, 𝐿(𝑏c ) is to be found.
the LLR of 𝑏c ). Let 𝑏 ∈ {0; 1} be a bit, then its LLR 𝐿 (𝑏) is defined as:

𝐿 (𝑏) = ln (P {𝑏 = 0}) − ln (P {𝑏 = 1}) , (1) 3.1.2. Reverse-engineering


Given the small size of 𝐏, its value can be easily brute-forced by
where ln(𝑥) stands for the natural logarithm of 𝑥 ∈ R+ , and P {𝐴 = 𝑎} ∈ testing every possible matrix 𝐏 against a received sequence 𝐛̂c . Note
[0; 1] denotes the probability that a random variable 𝐴 takes the value that this strategy needs working implementations of the dewhitening
𝑎. Note that the LLR of 𝑏 can be converted back to bit-probability using: and the deinterleaving, and assumes an error-free transmission.

𝑒−𝑥𝐿(𝑏) 3.1.3. Hard decoding


P {𝑏 = 𝑥} = ( ), ∀𝑥 ∈ {0; 1}. (2)
1 + 𝑒−𝐿(𝑏) With 𝐆 completely determined, hard-value maximum likelihood
In the following subsections, more information on how each step ac- decoding can be efficiently achieved using a syndrome decoder [19,
tually works is given, along with the methods used to reverse-engineer Chap. 7.5].
their parameters (if needed). Section 3.1 covers channel coding and
decoding, and explains how the codes used in LoRa can be retrieved. 3.1.4. Soft decoding
Two methods of decoding are proposed: hard-value and soft-value It is well known that soft-decision decoding (that is, taking into
decoding, with the later being able to correct more errors, at the account confidence about bit values) can give substantial processing
price of a higher computational complexity. Next, Section 3.2 gives gain, up to 2 dB [19, Chap. 5.2].
input–output relationships for the whitening block, whose goal is to As the LoRa block code acts on blocks of only 4 bits (16 pos-
transform the output binary sequence of the encoder into a sequence sible codewords), extensive search can be implemented to achieve
whose values are less correlated. On the receiver side, dewhitening maximum-likelihood decoding:
algorithms for hard and soft-values are given, to accommodate the { }
two possible decoding strategies. Here also, a method to discover the 𝐛̂𝐤 = argmax P 𝐛̂c𝐤 = 𝐆̄𝐛 . (5)
̄𝐛∈{0;1}4
whitening sequences used in the LoRa modulation is presented. Just
before modulation, the whitened bit-sequence is interleaved in order Assuming that elements of 𝐛̂c are independent, we get:
to reduce the impact of impulsive noise and fadings. The interleaving { [ ]}
𝐛̂𝐤 = argmax 𝛱 3+CR P 𝑏̂c (4+CR)𝑘+𝑙 = 𝐆̄𝐛 ,
𝑙=0 𝑙
(6)
process, previously described in a graphical way by [10], is given ̄𝐛∈{0;1}4

597
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

where [𝐆𝐛]𝑙 denote the 𝑙th element of vector 𝐆𝐛. Using formula (2) to
convert LLRs to probabilities, discarding the denominator as a constant
with respect to ̄𝐛, and translating into logarithmic domain, Eq. (6)
reduces to:
∑ [ ] (
3+CR )
𝐛̂𝐤 = argmin 𝐆̄𝐛 𝑙 𝐿 𝑏c(4+CR)𝑘+𝑙 . (7)
̄𝐛∈{0;1}4 𝑙=0

Note that implementation of (7) is computationally more involved


compared to a syndrome decoder, as operations with floating-point
numbers require either more time or more energy than operations over
binary values.

3.2. Whitening and dewhitening

By design, a channel encoder adds redundancy bits, which intro-


duces correlation between bits of the coded sequence. This correlation
may cause issues with other algorithms in the transmission chain, as
they may assume Independent and Identically Distributed (IID) input
sequences. Thus, the goal of the whitening operation is to transform Fig. 2. Decomposition of the interleaving process. Example with SF = 7 and CR = 4.
the coded sequence, such that individual bits in the whitened sequence
are weakly correlated.
This subsection is arranged into four parts. The first one describes
the whitening algorithm. Then we provide a method to 3.3. Interleaving and deinterleaving
reverse-engineer the whitening sequences used in the LoRa modulation.
Finally, the last two parts describe hard-value (acting on bits) and LoRa is an instance of Bit-Interleaved Coded Modulations (BICM),
soft-value (acting on LLR) dewhitening. The latter being required if known to be able to provide robust performance under both fading and
soft-value decoding is used (see Section 3.1). AWGN channels. With this kind of modulation, interleaving is used to
scatter the individual bits of each codeword in time, providing better
3.2.1. Whitening immunity to noise bursts (or, equivalently, fadings) [19, Chap. 14.6].
The whitening operation adds (in 𝐺𝐹 (2)) a known pseudo-random The LoRa interleaver belongs to the family of diagonal interleavers.
sequence to the output of the channel encoder (coded bits 𝐛c ). The Such interleavers act on blocks of data represented as a matrix. The
input–output relationship is thus given by: name comes from the principle of operations: values present on a line
𝐛w = 𝐰 + 𝐛c . (8) of the input matrix end up being scattered on a diagonal of the output
matrix.
If the whitening sequence 𝐰 is carefully chosen, very correlated input This subsection is divided into three parts. The interleaving algo-
sequences (such as the all-one sequence) will result in a pseudo-ransom rithm is given in the first one. Then deinterleaving, which basically
sequence. The worst case scenario happens when 𝐛c = 𝐰. In order consists in re-arranging the received bits back to their initial posi-
to reduce the probability of this scenario, long whitening sequences
tions, is described for hard (bits) and soft-values (LLR). Similar to
should be used.
dewhitening, a soft-deinterleaver is necessary to enable soft decoding
3.2.2. Reverse-engineering (see Section 3.1).
The whitening sequence can be easily recovered by exploiting the
linearity of the channel code. Indeed, according to (3), the codeword 3.3.1. Interleaving
associated to the all-zeros block is the all-zeros codeword. So, when The interleaver used in LoRa have successfully been
sending 𝐛 = 𝟎𝐿×1 , the whitened sequence reduces to the whitening retro-engineered in [10], and is described below. It acts on a block of
sequence: 𝐛w = 𝐰. In this case, assuming that we have a working SF whitened codewords (with size CR + 4 bits), and outputs a block of
implementation of the deinterleaver, and an error-free transmission, the (CR + 4) × SF interleaved bits, ready to be mapped to CR + 4 symbols.
whitening sequence can be retrieved as 𝐰 = 𝐛̂w . We denote 𝐁 the 𝑘th block of SF whitened codewords, defined as:
Note that having error-free transmissions is hard to obtain, which
⎛ 𝑏w … 𝑏w ⎞
explains why open-source implementations found different whitening ⎜ 𝑘 𝑘+(CR+4)−1 ⎟
sequences [3,10,11]. 𝐁=⎜ ⋮ ⋯ ⋮ ⎟, (9)
⎜𝑏w … 𝑏w ⎟
⎝ 𝑘+(SF−1)(CR+4) 𝑘+SF(CR+4)−1 ⎠
3.2.3. Hard dewhitening
Thanks to the property that 𝑎 + 𝑎 = 0 ∀𝑎 ∈ 𝐺𝐹 (2), whitening and with 𝑏w𝑘
the 𝑘th element of 𝐛w . From there, denoting [𝐁]𝑖,𝑗 the element
dewhitening are similar operations. The only difference being that the of 𝐁 at line index 𝑖 and column index 𝑗, the 𝑘th block of interleaved
later takes a whitened sequence (estimates of the whitened sequence bits 𝐈𝐁 is defined element-wise by:
𝐛̂w , in the case of LoRa) and outputs the original sequence (estimates
[𝐈𝐁]𝑖,𝑗 = [𝐁]SF−1−((𝑗−𝑖)
of the coded sequence 𝐛̂c , here). mod SF), (CR+4)−1−𝑖

∀𝑖 ∈ [0; (CR + 4) − 1], 𝑗 ∈ [0; SF − 1]. (10)


3.2.4. Soft dewhitening
By definition of (1), one can notice that the sign of an LLR refers Finally, each line of 𝐈𝐁 contains SF interleaved bits to be mapped to
to the value of the estimated bit, while its absolute value refers to symbols later on:
the confidence level of that estimation. This means that dewhitening is ( )
𝑏i𝑘+𝑙.SF … 𝑏i𝑘+(𝑙+1).SF−1 = 𝜹𝑙 .𝐈𝐁
performed by reversing the sign of LLR at indexes where the bit values
of the whitening sequence equals to one. ∀𝑙 ∈ [0; (CR + 4) − 1], (11)
In practice, on many hardware platform, reversing the sign of a
floating-point number is done by flipping the first bit of its binary where 𝜹𝑙 is a line vector of size (CR + 4) whose 𝑙th entry has value 1,
representation, which means that implementing soft dewhitening has a and every other entry has value 0. This process can be decomposed in
limited impact compared to hard dewhitening, in terms of complexity. several elementary operations, as explained in Fig. 2.

598
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

3.3.2. Hard deinterleaving


The deinterleaving process is formally described as follows. The 𝑘th
̂ is constructed as follows:
matrix of estimated interleaved bits 𝐈𝐁
⎛ 𝑏̂i 𝑘 … 𝑏̂i 𝑘+SF−1 ⎞
̂ ⎜ ⎟
𝐈𝐁 = ⎜ ⋮ ⋯ ⋮ ⎟. (12)
⎜𝑏̂i … 𝑏̂i 𝑘+(CR+4)SF−1 ⎟⎠
⎝ 𝑘+(CR+4−1)SF
̂ is defined
From there, the 𝑘th block of SF whitened codewords 𝐁
element-wise by:
[ ] [ ]
𝐁̂ = 𝐈𝐁̂
𝑖,𝑗 (CR+4)−1−𝑗, [SF−1−𝑖+(CR+4)−1−𝑗] mod SF

∀𝑖 ∈ [0; SF − 1], 𝑗 ∈ [0; (CR + 4) − 1]. (13)

Where each line of 𝐁 ̂ is an estimated whitened codeword:


( )
̂
𝑏̂w 𝑘+𝑙.(CR+4) … 𝑏̂w 𝑘+(𝑙+1).(CR+4)−1 = 𝜹𝑙 .𝐁
∀𝑙 ∈ [0; SF − 1]. (14)

This deinterleaving process corresponds to the same steps as in Fig. 2,


but in reverse.

3.3.3. Soft deinterleaving


Soft deinterleaving is done exactly as hard deinterleaving, the only
( ) Fig. 3. Transmission of one chirp corresponding to symbol 𝑐 = 50, with M = 128. {⋅}
difference being that 𝐈𝐁 ̂ is constructed using LLR 𝐿 𝑏i instead of
and {⋅} denote the real part, and the imaginary part, respectively.
estimated bits 𝑏̂i .
Soft deinterleaving can be done with the same complexity as hard
deinterleaving, as long as they use copy-free implementations.
To obtain a discrete-time expression for 𝑠(𝑡), we sample at the
3.4. Chirp spread spectrum modulation Shannon–Nyquist rate: 𝐹𝑒 = 1∕𝑇𝑒 = 𝐵. Consequently, using the relation
𝐵.𝑇 = 𝑀, we also have 𝑇 = 𝑀.𝑇𝑒 and 𝑇𝑒 ∕𝑇 = 1∕𝑀. This gives the
CSS uses linear chirps (see Fig. 3) to spread information carried by following discrete-time expression for 𝑠(𝑡):
each symbol in the time–frequency plane. This allows good resilience ∑
𝐿∕(SF.𝜂)
to time (as implied, for instance, by Doppler shifts) and frequency 𝑠[𝑘] = 𝑠(𝑘𝑇𝑒 ) = 𝑔𝐜𝑛 (𝑘𝑇𝑒 − 𝑛𝑇 ) (18)
selective channels (as implied, for example, by multipath signal prop- 𝑛=0

agation) [21]. It is an index-based modulation, which uses the initial ∑


𝐿∕(SF.𝜂)
( )
= 𝑔𝐜𝑛 (𝑘 − 𝑛𝑀)𝑇𝑒 (19)
frequency shift of the chirp carrying a symbol to encode its value (see
𝑛=0
Fig. 3) [12].

𝐿∕(SF.𝜂)
Let us denote 𝐵 the bandwidth of the signal, and 𝑇 the time to = 𝑔𝐜𝑛 [𝑘 − 𝑛𝑀], ∀𝑘 ∈ Z. (20)
transmit a symbol, then log2 (𝐵.𝑇 ) = SF is the spreading factor. As for 𝑛=0
Direct Sequence Spread Spectrum (DSSS) systems, SF characterizes the Let us now derive the discrete-time expression of a modulated chirp:
increase in bandwidth occupation for a fixed value of 𝑇 . As seen in the
𝐵 𝑐
previous subsections, in the case of the LoRa modulation, SF also gives 𝑔𝑐 [𝑘] = 𝑔𝑐 (𝑘𝑇𝑒 ) = 𝛱𝑇 (𝑘𝑇𝑒 ).𝑒𝑗2𝜋( 2𝑇 𝑘𝑇𝑒 + 𝑇 )𝑘𝑇𝑒 .𝑒−𝑗2𝜋𝑙𝐵𝑘𝑇𝑒
the number of bits carried by a single symbol, meaning that a symbol [ ]
𝐵 𝑐 𝐵 𝐵
∀𝑘, 𝑙 ∈ Z s.t. 𝑘𝑇𝑒 + ∈ 𝑙𝐵 − ; 𝑙𝐵 + . (21)
can take 𝑀 = 𝐵.𝑇 = 2SF values. 𝑇 𝑇 2 2
Using these notations, we define the expression of the complex where 𝛱𝑇 (𝑘𝑇𝑒 ) = 𝛱 𝑇 (𝑘) = 𝛱𝑀 (𝑘) = 𝛱𝑀 [𝑘], and 𝑒−𝑗2𝜋𝑙𝐵𝑘𝑇𝑒 = 𝑒−𝑗2𝜋𝑙𝑘 =
baseband equivalent of the base chirp, that is the chirp that encodes 𝑇𝑒
1 ∀𝑙, 𝑘 ∈ Z. Thus, the expression of 𝑔𝑐 (𝑡) is simpler in the discrete-time
the symbol 0. This base chirp 𝑔0 (𝑡) has a frequency that linearly grows
domain:
from −𝐵∕2 at 𝑡 = −𝑇 ∕2 to 𝐵∕2 at 𝑡 = 𝑇 ∕2 (as to span the whole available 𝐵 𝑐
bandwidth 𝐵 during the time of a symbol 𝑇 ): 𝑔𝑐 [𝑘] = 𝛱𝑀 [𝑘].𝑒𝑗2𝜋( 2𝑇 𝑘𝑇𝑒 + 𝑇 )𝑘𝑇𝑒 (22)
𝑇 𝐵𝑇
𝐵 2 𝑗2𝜋 𝑇𝑒 ( 2 𝑒 𝑘+𝑐)𝑘
𝑔0 (𝑡) = 𝑒𝑗𝜋 𝑇
𝑡
𝛱𝑇 (𝑡), ∀𝑡 ∈ R, (15) = 𝛱𝑀 [𝑘].𝑒 (23)
1 1
𝑗2𝜋 𝑀 ( 2 𝑘+𝑐)𝑘
where 𝛱𝑇 (𝑡) is the rectangular window of size 𝑇 : 𝛱𝑇 (𝑡) = 1 for all 𝑡 ∈ = 𝛱𝑀 [𝑘].𝑒 (24)
[−𝑇 ∕2; 𝑇 ∕2[, and 𝛱𝑇 (𝑡) = 0 otherwise. In order to modulate a symbol 𝑘2 𝑐

𝑐 ∈ , the initial frequency of 𝑔0 (𝑡) is shifted by 𝑐.𝐵∕𝑀 = 𝑐∕𝑇 Hz, and = 𝛱𝑀 [𝑘].𝑒𝑗𝜋 𝑀 𝑒 𝑗2𝜋 𝑀 𝑘
, ∀𝑘 ∈ Z, 𝑐 ∈ . (25)
extra steps are taken to make sure that the chirp is wrapped between Now, incorporating (25) in (20), we obtain:
[−𝐵∕2; 𝐵∕2] as illustrated in Fig. 3:

𝐿∕(SF.𝜂)
(𝑘−𝑛𝑀)2
𝐵 𝑐
𝑔𝑐 (𝑡) = 𝛱𝑇 (𝑡).𝑒𝑗2𝜋( 2𝑇 𝑡+ 𝑇 )𝑡 .𝑒−𝑗2𝜋𝑙𝐵𝑡 , 𝑠[𝑘] = 𝛱𝑀 [𝑘 − 𝑛𝑀].𝑒𝑗𝜋 𝑀 (26)
[ ] 𝑛=0
𝐵 𝑐 𝐵 𝐵 𝐜𝑛
∀𝑡 ∈ R, 𝑙 ∈ Z s.t. 𝑡 + ∈ 𝑙𝐵 − ; 𝑙𝐵 + . (16) (𝑘−𝑛𝑀)
𝑇 𝑇 2 2 .𝑒𝑗2𝜋 𝑀

Finally, the modulated signal consists in multiple symbols sent sequen- 𝑘2 ∑


𝐿∕(SF.𝜂)
𝐜𝑛
tially, with a time spacing of 𝑇 seconds: = 𝑒𝑗𝜋 𝑀 𝛱𝑀 [𝑘 − 𝑛𝑀].𝑒𝑗2𝜋 𝑀 𝑘 , ∀𝑘 ∈ Z. (27)
⏟⏟⏟ 𝑛=0
Chirp ⏟⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏟⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏞⏟

𝐿∕(SF.𝜂)
𝑠(𝑡) = 𝑔𝐜𝑛 (𝑡 − 𝑛𝑇 ), ∀𝑡 ∈ R, (17) 𝑀-FSK
𝑛=0 This shows that CSS signals are basically chirped versions of 𝑀-arry
where 𝐜𝑛 ∈  denotes the 𝑛th element of 𝐜. Frequency Shift Keying (𝑀-FSK) signals.

599
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

the phase of the received signal. After quadrature detection, the signal
is analogous to an 𝑀-ASK modulated signal:

2𝜋 ∑
𝐿∕(SF.𝜂)
{𝑟𝑑 [𝑘]} = 𝛱𝑀 [𝑘 − 𝑛𝑀]𝐜𝑛 + 𝑧′ [𝑘], ∀𝑘 ∈ Z, (31)
𝑀 𝑛=0

but corrupted by a noise 𝑧′ [𝑘] that has no guarantee to be Gaussian nor


white.
Nevertheless, symbols 𝐜 can be demodulated with matched filtering:
1 ( )
𝐜̂𝑛 = 𝛱𝑀 ∗ 𝑟𝑑 [𝑛] (32)
2𝜋
∑ ∑
𝐿∕(SF.𝜂) +∞
= 𝛱𝑀 [𝑘 − 𝑛𝑀]𝛱𝑀 [𝑘 − 𝑛′ 𝑀]𝐜𝑛′ (33)
𝑛′ =0 𝑘=−∞
+ (𝛱𝑀 ∗ 𝑧′ )[𝑛]
= 𝑀.𝐜𝑛 + (𝛱𝑀 ∗ 𝑧′ )[𝑛], (34)
where 𝛱𝑀 [𝑘] is the matched filter of itself as it is real and symmetrical.
Fig. 4. Comparison of coherent, non-coherent, and quadrature receivers over AWGN Hard decisions can be taken from 𝐜̂𝑛 , by comparing its amplitude to
with SF = 9. 𝑀 − 1 thresholds.
This technique is suboptimal due to the fact that (i) quadrature
detection is not an optimal frequency detector in presence of AWGN,
4. Chirp spread spectrum demodulation and (ii) ASK demodulation is performed using matched filtering (which
is a maximum likelihood detector in presence of AWGN) even though
The aim of this section is to rigorously define three demodulations the noise 𝑧′ [𝑘] is not AWGN [19, Chap. 4.4]. However, transposing the
strategies for CSS-modulated signals: quadrature (as used in [7]), coher- demodulation problem from 𝑀-FSK to 𝑀-ASK allows for the use of
ent and non-coherent receivers. An analysis of their expected behaviors standard and well studied techniques for various channel impairments,
such as clock drift, CFO and channel selectivity.
over AWGN, from a theoretical standpoint, will also be given. Also,
because the previous section highlighted the potential gains of soft
4.2. Coherent receiver
information decoding, techniques for computing bit LLR from coherent
and non-coherent demodulators will be given. These strategies will be
Coherent receivers are used when the channel induces no phase
assessed later on, in Section 5. impairments, or when such phase impairments are considered perfectly
In order to do that, this section will be divided in four subsections. estimated and corrected. Over perfect AWGN channels, it allows for
The first three sections will cover quadrature demodulation (4.1), maximum likelihood detection. Its use is mandatory for demodulating
coherent demodulation (4.2), and non-coherent demodulation (4.3). derivative of CSS that use the phase to encode symbols (see, e.g, [16]).
Then, Section 4.4 will detail how to extract soft information from A maximum likelihood demodulation strategy for 𝑀-FSK in pres-
coherent and non-coherent demodulators. ence of AWGN is to find the symbol 𝑐 ∈  whose associated signal
𝑐
In order to present the three demodulation strategies of this part, 𝑒2𝜋 𝑀 𝑘 correlates the best with the observed signal 𝑟𝑑 [𝑘] [19, Chap. 4.4].
we consider an AWGN channel: This is expressed as follows:
{ +∞ }
𝑟[𝑘] = 𝑠[𝑘] + 𝑧[𝑘], ∀𝑘 ∈ Z, (28) ∑ 𝑐
−2𝜋 𝑀 𝑘
𝐜̂𝑛 = argmax  𝛱𝑀 [𝑘]𝑒 𝑟𝑑 [𝑘 + 𝑛𝑀] . (35)
𝑐∈
where 𝑧[𝑘] is a zero-mean, complex-circular white Gaussian noise. 𝑘=−∞

The three following demodulators use the same dechirping opera- One can observe that the term in the real part is actually the 𝑀 point
tion, described as: Discrete Fourier Transform (DFT), denoted as 𝑀 {⋅}[⋅], of the received
𝑘2
signal:
𝑟𝑑 [𝑘] = 𝑟[𝑘]𝑒−𝑗𝜋 𝑀 , ∀𝑘 ∈ Z, (29) { }
𝐜̂𝑛 = argmax  𝑀 {𝑟𝑑 [𝑘 + 𝑛𝑀]}[𝑐] , (36)
where 𝑟𝑑 [𝑘] is the dechirped observed signal. This operation does not 𝑐∈

change the statistical properties of the noise, thus this system model, which can be efficiently implemented using the Fast Fourier Transform
involving 𝑟𝑑 [𝑘] instead of 𝑟[𝑘] is equivalent to 𝑀-FSK over AWGN. (FFT) algorithm [22].
Expanding the correlation term in (36) allows to understand why
4.1. Quadrature demodulation 𝑀-FSK modulations are effective in low SNR conditions, especially as
𝑀 grows bigger:
Quadrature demodulation is a technique that is usually applied to 𝑀 {𝑟𝑑 [𝑘 − 𝑛𝑀]}[𝑐 ′ ] (37)
analog Frequency Modulated (FM) signals in order to extract frequency
= 𝑀 {𝑠[𝑘 − 𝑛𝑀]}[𝑐 ′ ] + 𝑀 {𝑧[𝑘]}[𝑐 ′ ]
variations. It was retained by Robyns et al. [10] in their SDR implemen-
tation, because of its low-complexity. Its use in 𝑀-FSK demodulation ∑
𝐿∕(SF.𝜂)
𝐜𝑛
= 𝑀 {𝛱𝑀 [𝑘 − (𝑛 − 𝑛′ )𝑀].𝑒𝑗2𝜋 𝑀 𝑘 }[𝑐 ′ ] (38)
comes from the fact that these modulations can be seen as frequency 𝑛′ =0
modulated 𝑀-arry Amplitude Shift Keying (ASK) modulations. Thus, it
+ 𝑀 {𝑧[𝑘]}[𝑐 ′ ]
is actually a two-stage demodulation process. The first stage performs
quadrature detection of the frequency variation in 𝑟𝑑 [𝑘], and the second = 𝑀.𝛿𝑛−𝑛′ 𝛿𝐜𝑛 −𝑐𝑛′ + 𝑀 {𝑧[𝑘]}[𝑐 ′ ], (39)
performs 𝑀-ASK demodulation on this frequency variation. where 𝛿𝑛 = 1 if 𝑛 = 0 and zero otherwise. As we can see, the correlator
Quadrature detection reads as follows: output corresponding to the symbol that was sent has its amplitude
{ } augmented by 𝑀, as opposed to the other correlators. This means that
{𝑟𝑑 [𝑘]} = arg 𝑟𝑑 [𝑘]𝑟∗𝑑 [𝑘 − 1] , ∀𝑘 ∈ Z, (30)
this modulation, along with coherent demodulation gets more robust to
where (⋅)∗ denotes the complex conjugation. As frequency is the deriva- noise as 𝑀 increases. However, as 𝐵.𝑇 = 𝑀, this comes at the expense
tive of the phase, this detector corresponds to the digital derivative of of either an increased bandwidth or a decreased symbol rate.

600
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

4.3. Non-coherent receiver Most of the simulations presented here present performance as-
sessed with respect to the per-bit SNR of the transmission, denoted as
While effective, the coherent receiver is very sensitive to channel 𝐸𝑏 ∕𝑁0 . SNR and per-bit SNR are related by the spectral efficiency 𝛼 (in
impairments other than white noise. In particular, due to the real part bits/s/Hz) of the modulation:
in (36), any channel impairment that translates to a phase shift in (37),
SNR = 𝛼𝐸𝑏 ∕𝑁0 . (45)
results in a loss of reliability.
Non-coherent detection is a computationally efficient way to tackle In the case of CSS and 𝑀-FSK, spectral efficiency is given by 𝛼 = SF∕𝑀.
this issue, as it only replaces the real part operator by the magnitude In the case of LoRa, spectral efficiency is given by 𝛼 = 𝜂SF∕𝑀 =
operator in (36): 4.SF∕(𝑀.(CR + 4)). On the one hand, using 𝐸𝑏 ∕𝑁0 allows for fair
comparison of different modulations, and demodulation methods, as it
𝐜̂𝑛 = argmax ||𝑀 {𝑟𝑑 [𝑘 + 𝑛𝑀]}[𝑐]|| . (40) considers the amount of energy dedicated to the transmission of each
𝑐∈
bit [19, Chap. 4.2.9]. On the other hand, SNR is more meaningful when
However, this comes at the expense of a reduced noise immunity. one wants to evaluate the performance (the range, in particular) of
actual systems, as typical transmitters are limited in terms of signal
4.4. Soft-decisions for coherent and non-coherent receivers power (not in terms of per-bit energy).

In order to leverage the potential gains of soft-decision decoding 5.1. Demodulation methods
(see Section 3.1), the demodulator must be altered, as to compute LLR
for each bit of a codeword: We first compare the three demodulation techniques presented in
{ }
( i) P 𝑏i𝑛 = 0|𝑟𝑑 (𝑡) Section 4 on Fig. 4. As expected, quadrature demodulation has the
𝐿 𝑏𝑛 = ln { }. (41) worst performance, which can however be improved by oversampling
P 𝑏i𝑛 = 1|𝑟𝑑 (𝑡)
the received signal. However, even with an oversampling factor of 2,
Under the assumption that transmitted symbols are IID, assuming that quadrature demodulation suffers from an 𝐸𝑏 ∕𝑁0 difference as high as
𝑏i𝑛 is carried by the 𝑙th bit of the 𝑛th symbol, and using Bayes rule, we 23 dB for a BER of 10−4 with respect to coherent demodulation.
get: The difference between coherent and non-coherent demodulation is
∑ { } much less, in the order of magnitude of 1 dB.
( i) 𝑐∈ s.t. 𝑏𝑙 (𝑐)=0 P 𝑟𝑑 (𝑡)|𝑐𝑛 = 𝑐
𝐿 𝑏𝑛 = ln ∑ { }, (42)
𝑐∈ s.t. 𝑏𝑙 (𝑐)=1 P 𝑟𝑑 (𝑡)|𝑐𝑛 = 𝑐 5.2. Performance over AWGN channel
where 𝑏𝑙 (𝑐) denotes the value of the { 𝑙th bit mapped
} to symbol 𝑐.
AWGN channel is an idealized channel where propagation would
On an AWGN channel, likelihoods P 𝑟𝑑 (𝑡)|𝑐𝑛 = 𝑐 are proportional to
2 be perfect, and only additive noise (mainly thermal noise in the re-
𝑒{𝑀 {𝑟𝑑 [𝑘+𝑛𝑀]}[𝑐]}∕𝜎 , where 𝜎 2 denotes noise power [17]. Thus, LLR ceiver electronics) would affect the emitted signal. It is nevertheless a
for coherent detection are finally expressed as: commonly used base for comparison of different modulations.
( ) { } As CSS and 𝑀-FSK belong to the same modulation family (orthogo-
𝐿 𝑏i𝑛 = max∗  𝑀 {𝑟𝑑 [𝑘 + 𝑛𝑀]}[𝑐] ∕𝜎 2 (43)
𝑐∈ s.t. 𝑏𝑙 (𝑐)=0 nal modulations), they should perform exactly the same over an AWGN
{ }
− max∗  𝑀 {𝑟𝑑 [𝑘 + 𝑛𝑀]}[𝑐] ∕𝜎 2 , channel, which is confirmed by Fig. 5.
𝑐∈ s.t. 𝑏𝑙 (𝑐)=1
Fig. 5b shows that coherent demodulation and soft-decoding allow
(∑ )
where max∗ , defined as max∗ 𝑐∈ 𝑐 = ln 𝑐
𝑐∈ 𝑒 , has several efficient
for processing gain of approximately 1 dB and 1.5 dB, respectively. This
implementations, and can be approximated as max∗ ≈ max, in which means 2.5 dB of difference between the most complex and less complex
case 𝜎 2 can be omitted from (43) [23]. implementation of the receiver.
Similar to Section 4.3, the real part in (43) results in a loss of Comparing Figs. 5a and 5b we notice that the extra processing
reliability for any channel impairment that translated to a phase shift steps introduced by LoRa, with respect to CSS and 𝑀-FSK, does not
in (37). This can be efficiently circumvented using the magnitude significantly improve the efficiency of the transmission, at least for
operator instead of the real part: SF = 9 and CR = 4, on an AWGN channel.
( )
𝐿 𝑏i𝑛 = max∗ |𝑀 {𝑟𝑑 [𝑘 + 𝑛𝑀]}[𝑐]| ∕𝜎 2 (44) 5.3. Performance over frequency-selective channels
𝑐∈ s.t. 𝑏 (𝑐)=0
| |
𝑙

− max∗ |𝑀 {𝑟𝑑 [𝑘 + 𝑛𝑀]}[𝑐]| ∕𝜎 2 ,


𝑐∈ s.t. 𝑏𝑙 (𝑐)=1
| | Frequency-selective channels are representative of multipath propa-
gation, where the propagation paths does not vary with time, or when
which also comes at the expense of a reduced noise immunity. this variation is negligible during the time of the transmission. Rural
Computing LLR from quadrature detection would also be possible. scenarii where both the transmitter and the receiver are not mobile are
Although the non-gaussianity of the noise at the output of the matched well modeled with frequency-selective channels.
filter (32) would make the computation of exact LLR difficult, it would In this subsection, we consider the Proakis B [19, chap. 9.4] static,
still be possible to get an approximation using standard techniques used frequency-selective channel with impulse response ℎ[𝑘] = 0.407𝛿𝑘−1 +
for 𝑀-ASK over AWGN. However, given the very poor performance of 0.815𝛿𝑘 + 0.407𝛿𝑘+1 , (with 𝛿𝑘 = 1 if 𝑘 = 0 and 𝛿𝑘 = 0 otherwise). The
quadrature detection compared to coherent and non-coherent demodu- received signal is given by:
lation of CSS signals (see Fig. 4), we chose not to study its performance


in the context of LoRa demodulation chains. 𝑟[𝑘] = ℎ[𝑙]𝑠[𝑘 − 𝑙] + 𝑧[𝑘]. (46)
𝑙=−∞
5. System simulations This channels is non-invertible, which means that part of the infor-
mation carried by 𝑠[𝑘] is lost during the transmission (see Fig. 7).
In the following, we assess the performance of CSS, 𝑀-FSK, LoRa
and FSK-LoRa over four channels: AWGN, frequency selective, time se- As we can see on Fig. 6 CSS performs much better than 𝑀-FSK on
lective and Rayleigh. FSK-LoRa designates a LoRa system (as described this channel, due to its better spreading of the information in frequency.
in Fig. 1) in which the CSS modulator/demodulator blocks are replaced Comparing Figs. 6a and 6b, we observe that the LoRa processing
by 𝑀-FSK ones. chain allows for a steeper slope of the BER curve. This allows LoRa
We implemented channel coding, whitening and interleaving as to outperform CSS at 𝐸𝑏 ∕𝑁0 = 5 dB with soft decoding (coherent
described in previous sections using GNURadio. The associated source demodulation, 6 dB for non-coherent) and 𝐸𝑏 ∕𝑁0 = 8 dB with hard
code is available in [24]. decoding (for both coherent and non-coherent demodulation).

601
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

Fig. 5. Simulations over an AWGN channel, with SF = 9. CSS and 𝑀-FSK are exactly equivalent in this scenario.

Fig. 6. Simulations over a Proakis B frequency-selective channel, with SF = 9. Here, CSS performs much better than 𝑀-FSK, thanks to the symbol-level frequency diversity induced
by the chirp.

Fig. 7. Frequency-domain response of the Proakis B channel [19, chap. 9.4]. Signal is Fig. 8. Time-domain response of the time-selective channel used in this article. The
completely lost at the center of the occupied bandwidth, and suffers from important central portion of each symbol suffers from very high attenuation, while signal at the
attenuation around it. exact center of it is completely lost.

5.4. Performance over time-selective channels This is a very unlikely situation, and we study this channel mainly to
assess the limits of LoRa and CSS when faced with mobility.
Here, we consider a cosined-shaped time-selective channel:
Time-selective channels are representative of propagation suffering [ ]
𝑟[𝑘] = (cos(2𝜋𝑘∕𝑀) + 1) ∕1.5 𝑠[𝑘] + 𝑧[𝑘]. (47)
from Doppler only. That is, situation where the emitter and receiver
are mobile, but there are no obstacle leading to multipath propagation. This channels is also non-invertible (see Fig. 8).

602
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

Fig. 9. Simulations over a time selective channel, with SF = 9. Here, 𝑀-FSK and CSS performs equally. One can notice that the processing gain due to coherent receiving vanishes
as 𝐸𝑏 ∕𝑁0 goes higher.

Fig. 10. Simulations over an ITU indoor to outdoor and pedestrian Rayleigh channel, with SF = 9. Here also, CSS and 𝑀-FSK have similar performances.

Fig. 9 shows that CSS (LoRa) and 𝑀-FSK (FSK-LoRa) are equivalent computed as 𝑓𝑑 = 𝑓0 .𝜈∕(𝑐.𝐵), with 𝑐 ≈ 3.108 m∕s the speed of light in a
in this scenario. Interestingly, we notice on Fig. 9a that coherent and vacuum. The received signal is expressed as:
non-coherent demodulation tend to be equivalent as 𝐸𝑏 ∕𝑁0 increases. ∑

We notice the same behavior on Fig. 9b, but it happens at higher values 𝑟[𝑘] = ℎ𝑘 [𝑙]𝑠[𝑘 − 𝑙] + 𝑧[𝑘], (48)
of 𝐸𝑏 ∕𝑁0 . 𝑙=−∞

Comparing Figs. 6a and 6b, we observe that the LoRa processing where ℎ𝑘 [𝑙] is the time-varying impulse response of the channel, given
chain allows for a steeper slope of the BER curve. This allows LoRa by:
to outperform CSS at 𝐸𝑏 ∕𝑁0 = 6 dB with soft decoding (coherent 𝑁taps −1

demodulation, 8 dB for non-coherent) and 𝐸𝑏 ∕𝑁0 = 9 dB with hard ℎ𝑘 [𝑙] = 𝐴[𝑛]𝛼𝑘 [𝑛]sinc(𝜏𝑁 [𝑛] − 𝑙), (49)
decoding (coherent demodulation, 10 dB for non-coherent). 𝑛=0
with 𝑁taps the number of path in the Rayleigh channel model, 𝜏𝑁 [𝑛]
5.5. Performance over Rayleigh channels ∀𝑛 ∈ [0; 𝑁taps − 1] is the relative normalized delay of path 𝑛, and
𝐴[𝑛] ∀𝑛 ∈ [0; 𝑁taps − 1] is the average power of path 𝑛. 𝛼𝑘 [𝑛] is
the time-varying complex gain, and is computed using the sum-of-
Rayleigh channels are representative of propagation suffering from
sinusoids technique (with 8 sinusoids) described in [26]. In our sim-
multipath and mobility, inducing random fadings in the received signal.
ulations, these computations are handled by the GNURadio block se-
Here, we use the ITU outdoor to indoor and pedestrian A channel, taken
lective_fading_model.
from [25, Table 4] (see Table 1). It models communication between Note that, for coherent demodulation to be effective in this scenario,
a device located outdoor (a gateway, typically) and a device located an estimator of the phase shift introduced by the channel is necessary.
indoor or in a street (a smart sensor, for instance). As this article does not cover such an estimator, we computed this
To fit this description, we configured a maximum Doppler shift cor- phase-shift with knowledge of the simulated channel (more precisely,
responding to a typical walking speed: 𝜈 = 3 km/h (𝜈 ≈ 0.83 m∕s). The we compare the phase of the signal before and after passing through
other parameters are chosen to match a LoRa transmission in the 868 the Rayleigh channel, before adding AWGN).
MHz band, that is, a bandwidth 𝐵 = 125 kHz, and a carrier frequency Fig. 10 shows that CSS (LoRa) and 𝑀-FSK (FSK-LoRa) are also
𝑓0 = 868.1 MHz. The normalized maximum Doppler frequency is then equivalent in this scenario. On Fig. 10b, one can observe that the

603
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

Fig. 11. LoRa simulations over an ITU indoor to outdoor and pedestrian Rayleigh channel, with various SF and CR = 4.

Fig. 12. LoRa simulations over an ITU indoor to outdoor and pedestrian Rayleigh channel, with various CR and SF = 9.

Table 1 of a reduced spectral efficiency and, thus, reduced bitrate, for a fixed
ITU outdoor to indoor and pedestrian A channel tapped-delay-line parameters
bandwidth).
(from [25, Table 4]). Normalized delays 𝜏𝑁 are computed from delays 𝜏 as 𝜏𝑁 =
𝜏∕𝑇𝑒 = 𝜏.𝐵, with 𝐵 = 125 kHz.
Tap Relative delay Relative normalized Average power
6. Conclusion
𝑛 (𝜏[𝑛], ns) delay (𝜏𝑁 [𝑛]) (𝐴[𝑛], dB)
0 0 0 0
In this article, we presented the LoRa modulation architecture. We
1 110 0.01375 −9.7 discussed channel coding, whitening and interleaving with reverse-
2 190 0.02375 −19.2 engineering in mind. In particular, we identified the challenges for
3 410 0.05125 −22.8 determining correct whitening sequences, and gave closed-form expres-
sion for interleaving and deinterleaving. We derivated the discrete-time
expression of the CSS modulated signal, and used it as a basis to express
processing gains allowed by coherent demodulation and soft-decoding and study several demodulation strategies. By means of simulation,
are up to 5 dB. Here LoRa outperforms CSS at 𝐸𝑏 ∕𝑁0 = 21 dB with we showed that quadrature demodulation of CSS modulated signal is
soft decoding (same as non-coherent) and 𝐸𝑏 ∕𝑁0 = 27 dB with hard outperformed by coherent and non-coherent receivers. We confirmed
decoding (same as non-coherent). that CSS modulation has good properties for transmissions over time
Figs. 11 and 12 show the impact of the spreading factor and the and frequency selective channels (especially for the latter).
coding rate, respectively, on the transmission robustness. Notice how Finally, we observed that the three extra stages used in LoRa can
increasing the spreading factor by one results in an SNR gain of only give tangible benefits if coherent demodulation and soft decoding
approximately 5 dB (3 dB in terms of 𝐸𝑏 ∕𝑁0 ). Similarly, consecutive are used. These are computationally more expensive, and may not be
CR introduces a gain of around 2 dB of SNR (1 dB in terms of 𝐸𝑏 ∕𝑁0 ). implemented in the most energy constrained devices. They are however
Hence, in terms of BER performance, varying the spreading factor leads very likely to be implemented in base stations.
to the most significant gains. However, increasing SF by one doubles All simulations have been implemented in GNURadio, which is an
the time on air. Thus, when considering other constraints such as the SDR framework [24]. However, this implementation is not able to
time on air, and the duty cycle, as enforced in the ISM bands, varying reliably demodulate real LoRa signal yet. Indeed, LoRa demodulation
the coding rate can be a better option, depending on the application. still presents open challenges. In particular, there is no dedicated
This shows how an increase in spreading factor and/or coding rate literature covering algorithms for time and frequency shift tracking
CR can help cover longer ranges. However, this comes at the price for the CSS modulation. Without such algorithms, reliable decoding

604
A. Marquet, N. Montavont and G.Z. Papadopoulos Computer Communications 153 (2020) 595–605

of LoRa transmissions, especially with average quality radios (such as [9] The things network, 2019, URL https://www.thethingsnetwork.org/docs/
the ones commonly used in SDR) and long packets, cannot be made lorawan/academic.html.
[10] P. Robyns, P. Quax, W. Lamotte, W. Thenaers, A multi-channel software decoder
reliably, even at high SNR.
for the lora modulation scheme, in: Proceedings of the 3rd International Confer-
ence on Internet of Things, Big Data and Security - Volume 1: IoTBDS, INSTICC,
Declaration of competing interest SciTePress, 2018, pp. 41–51, http://dx.doi.org/10.5220/0006668400410051.
[11] R.F. Myriad, Myriad RF an SDR lora implementation for R & D, commit 52ec64d,
No author associated with this paper has disclosed any potential or 2018, URL https://github.com/myriadrf/LoRa-SDR/.
[12] C. Goursaud, J.-M. Gorce, Dedicated networks for IoT : PHY / MAC state
pertinent conflicts which may be perceived to have impending conflict of the art and challenges, EAI endorsed transactions on Internet of Things
with this work. For full disclosure statements refer to https://doi.org/ http://dx.doi.org/10.4108/eai.26-10-2015.150597.
10.1016/j.comcom.2020.02.034. [13] L. Vangelista, Frequency shift chirp modulation: The lora modulation, IEEE Signal
Process. Lett. 24 (12) (2017) 1818–1821, http://dx.doi.org/10.1109/LSP.2017.
2762960.
CRediT authorship contribution statement
[14] T. Elshabrawy, J. Robert, Closed-form approximation of lora modulation BER
performance, IEEE Commun. Lett. 22 (9) (2018) 1778–1781, http://dx.doi.org/
Alexandre Marquet: Conceptualization, Methodology, Software, 10.1109/LCOMM.2018.2849718.
Formal analysis, Investigation, Data curation, Writing - original draft, [15] R. Ghanaatian, O. Afisiadis, M. Cotting, A. Burg, Lora digital receiver analysis
Writing - review & editing, Visualization. Nicolas Montavont: Writ- and implementation, in: ICASSP 2019-2019 IEEE International Conference on
Acoustics, Speech and Signal Processing (ICASSP), 2019, pp. 1498–1502, http:
ing - original draft, Writing - review & editing, Supervision, Project //dx.doi.org/10.1109/ICASSP.2019.8683504.
administration, Funding acquisition. Georgios Z. Papadopoulos: Writ- [16] R. Bomfin, M. Chafii, G. Fettweis, A novel modulation for iot: Psk-lora, in: 2019
ing - original draft, Writing - review & editing, Supervision, Funding IEEE 89th Vehicular Technology Conference (VTC2019-Spring), 2019, pp. 1–5,
acquisition. http://dx.doi.org/10.1109/VTCSpring.2019.8746470.
[17] Y. Roth, J.-B. Doré, L. Ros, V. Berg, Contender waveforms for low-power wide-
area networks in a scheduled 4g OFDM framework, EURASIP J. Adv. Signal
References Process. 2018 (2018) 43, http://dx.doi.org/10.1186/s13634-018-0566-4.
[18] K. Kim, S. Lee, Y. Shin, Spectral efficiency improvement of chirp spread spectrum
[1] O. Seller, N. Sornin, Low power long range transmitter, 2014. systems, in: 2019 International Conference on Information and Communication
[2] C. Moy, High-level design approach for the specification of cognitive radio Technology Convergence (ICTC), 2019, pp. 1085–1087, http://dx.doi.org/10.
equipments management apis, J. Netw. Syst. Manage. 18 (1) (2010) 64–96, 1109/ICTC46691.2019.8939967.
http://dx.doi.org/10.1007/s10922-009-9151-3. [19] J. Proakis, M. Salehi, Digital Communications, McGraw-Hill International Edition,
[3] M. Knight, B. Seeber, Decoding LoRa: Realizing a Modern LPWAN with SDR, in: McGraw-Hill, 2008.
Proceedings of the GNU Radio Conference, Vol. 1 (1). [20] Semtech, sx1276/77/78/79 datasheet, rev. 5 edition, 2016.
[4] P. Robyns, P. Quax, W. Lamotte, W. Thenaers, Gr-lora: An efficient lora decoder [21] Semtech, an1200.22 lora modulation basics, rev. 2 edition, 2015.
for GNU radio, 2017, http://dx.doi.org/10.5281/zenodo.892174. [22] R. Singleton, A short bibliography on the fast fourier transform, IEEE Trans.
[5] R. Eletreby, D. Zhang, S. Kumar, O. Yaundefinedan, Empowering low-power wide Audio Electroacoust. 17 (2) (1969) 166–169, http://dx.doi.org/10.1109/TAU.
area networks in urban settings, in: Proceedings of the Conference of the ACM 1969.1162040.
Special Interest Group on Data Communication, SIGCOMM ’17, Association for [23] P. Robertson, P. Hoeher, E. Villebrun, Optimal and sub-optimal maximum a
Computing Machinery, New York, NY, USA, 2017, pp. 309–321, http://dx.doi. posteriori algorithms suitable for turbo decoding, Eur. Trans. Telecommun. 8
org/10.1145/3098822.3098845. (2) (1997) 119–125, http://dx.doi.org/10.1002/ett.4460080202.
[6] U. Noreen, L. Clavier, A. Bounceur, Lora-like css-based phy layer, capture effect [24] A. Marquet, Gnuradio implementation of a lora transceiver, 2019, http://dx.doi.
and serial interference cancellation, in: European Wireless 2018; 24th European org/10.5281/zenodo.3630182.
Wireless Conference, 2018, pp. 1–6. [25] International Telecommunication Union Radiocommunication Sector, Guide-
[7] L. Vangelista, A. Cattapan, A new lora-compatible modulation improving the lines for evaluation of radio transmission technologies for IMT-2000,
lorawan network level performance, in: 2019 IEEE Latin-American Conference Recommendation, ITU-R, 1997.
on Communications (LATINCOM), 2019, pp. 1–6, http://dx.doi.org/10.1109/ [26] M. Patzold, C. Wang, B.O. Hogstad, Two new sum-of-sinusoids-based methods
LATINCOM48065.2019.8937880. for the efficient generation of multiple uncorrelated rayleigh fading waveforms,
[8] J.P.S. Sundaram, W. Du, Z. Zhao, A survey on lora networking: Research IEEE Trans. Wireless Commun. 8 (6) (2009) 3122–3131, http://dx.doi.org/10.
problems, current solutions and open issues, IEEE Commun. Surv. Tutor. (2019) 1109/TWC.2009.080769.
1, http://dx.doi.org/10.1109/COMST.2019.2949598.

605

You might also like