<<

ACCEPTED FOR PUBLICATION IN IEEE INTERNET OF THINGS JOURNAL 1

On the LoRa for IoT: Properties and Spectral Analysis Marco Chiani, Fellow, IEEE, and Ahmed Elzanaty, Member, IEEE

Abstract—An important modulation technique for Internet of [17]–[19]. On the other hand, the spectral characteristics of Things (IoT) is the one proposed by the LoRa allianceTM. In this LoRa have not been addressed in the literature. paper we analyze the M-ary LoRa modulation in the time and In this paper we provide a complete characterization of the domains. First, we provide the description in the time domain, and show that LoRa is a memoryless continuous LoRa modulated signal. In particular, we start by developing modulation. The cross-correlation between the transmitted a mathematical model for the modulated signal in the time is determined, proving that LoRa can be considered domain. The waveforms of this M-ary modulation technique approximately an orthogonal modulation only for large M. Then, are not orthogonal, and the loss in performance with respect to we investigate the spectral characteristics of the signal modulated an orthogonal modulation is quantified by studying their cross- by random data, obtaining a closed-form expression of the spectrum in terms of Fresnel functions. Quite surprisingly, we correlation. The characterization in the frequency domain found that LoRa has both continuous and discrete spectra, with is given in terms of the power spectrum, where both the the discrete spectrum containing exactly a fraction 1/M of the continuous and discrete parts are derived. The found analytical total signal power. expressions are compared with the spectrum of LoRa obtained Index Terms—LoRa Modulation; Power , Dig- by experimental data. ital Modulation, Internet of Things The main contributions of this paper can be summarized as follows: I.INTRODUCTION • we provide the analytical expression of the signal for the The most typical IoT scenario involves devices with limited M-ary LoRa chirp modulation in the time domain (both energy, that need to be connected to the Internet via wire- continuous-time and discrete-time); less links. In this regard, Low Power Wide Area Networks • we derive the cross-correlation between the LoRa wave- (LPWANs) aim to offer low data rate communication capa- forms, and prove that the modulation is non-orthogonal; bilities over ranges of several kilometers [1]–[4]. Among the • we prove that the waveforms are asymptotically orthog- current communication systems, that proposed by the LoRa onal for increasingly large M; alliance (Low power long Range) [5] is one of the most • we derive explicit closed-form expressions of the contin- promising, with an increasing number of IoT applications, uous and discrete spectra of the LoRa signal in terms of including smart metering, smart grid, and data collection from the Fresnel functions; wireless sensor networks for environmental monitoring [6]– • we prove that the power of the discrete spectrum is [11]. Several works discuss the suitability of the LoRa com- exactly a fraction 1/M of the overall signal power; munication system when the number of IoT devices increases • we compare the analytical expression of the spectrum [12]–[15]. with experimental data from commercial LoRa devices; The modulation used by LoRa, related to Chirp Spread • we show how the analytical expressions of the spectrum Spectrum, has been originally defined by its instantaneous can be used to investigate the compliance of the LoRa arXiv:1906.04256v1 [cs.NI] 10 Jun 2019 frequency [16]. Few recent papers attempted to provide a modulation with the spectral masks regulating the out- description of the LoRa modulation in the time domain, but, as of-band emissions and the power spectral density. will be detailed below, they are not complaint with the original The provided time and spectral characterization of the LoRa LoRa signal model. The LoRa performance has been analyzed signal is an analytical tool for the system design, as it allows by simulation or by considering it as an orthogonal modulation suitable selection of the modulation parameters in order to ful- M. Chiani is with the Department of Electrical, Electronic and Information fill the given requirements. For example, our analysis clarifies Engineering “G. Marconi” (DEI), University of Bologna, Via dell’Universita` how the spreading factor, maximum frequency deviation, and 50, Cesena, Italy (e-mail: [email protected]). transmitted power determine the occupied bandwidth, shape A. Elzanaty was with the Department of Electrical, Electronic and Informa- tion Engineering, University of Bologna, 40136 Bologna, Italy. He is now with of the power spectrum and its compliance with spectrum the Computer, Electrical and Mathematical Science and Engineering Division, regulations, system spectral efficiency, total discrete spectrum King Abdullah University of Science and Technology, Thuwal 23955, Saudi power, maximum cross-correlation, and SNR penalty with Arabia (e-mail: [email protected]). This work was supported in part by MIUR under the program “Dipartimenti respect to orthogonal . di Eccellenza (2018-2022),” and in part by the EU project eCircular (EIT Throughout the manuscript, we define the indicator function Climate-KIC). gT (t) = 1 for 0 ≤ t < T and gT (t) = 0 elsewhere, and indicate Copyright (c) 2019 IEEE. Personal use of this material is permitted. However, permission to use this material for any other purposes must be as u(t) the unit step function. The Dirac’s delta is indicated obtained from the IEEE by sending a request to [email protected]. as δ(x), and its discrete version as δm, with δ0 = 1, δm = ACCEPTED FOR PUBLICATION IN IEEE INTERNET OF THINGS JOURNAL 2

∫ x 0 m , 0. We also indicate with C(x) , cos t2π/2 dt 0 f(t; a1) ∀ ∫ x 2 ( ) /  f(t; a ) and S x , 0 sin t π 2 dt the Fresnel functions [20]. 2

II.LORA SIGNAL MODEL B The LoRa frequency shift chirp modulation has been originally described in terms of the instantaneous B ) a2

a M ;

frequency reported in [16, Figure 7]. It is an M-ary digital t ( modulation, where the M possible waveforms at the output f of the modulator are chirp modulated over the fre- quency interval ( f0 − B/2, f0 + B/2) with M different initial . The data modulated signal is usually preceded by B synchronization waveforms, not considered here. For the data, a1 M the instantaneous frequency is linearly increased, and then wrapped to f0 − B/2 when it reaches the maximum frequency 0 f0 + B/2, an operation that mathematically can be seen as 0 τ2 τ1 Ts a reduction modulo B. Having the instantaneous frequency t sweeping over B does not imply that the signal bandwidth is Fig. 1: Example of the instantaneous frequency f (t; a) as a B, as will be discussed in Section III. function of time for two different modulating symbols a , a ∈ SF 1 2 For LoRa the parameters are chosen such that M = 2 with {0,..., M − 1}. SF integer, and BTs = M, where Ts is the symbol interval. The bit-rate of the modulation is 1 SF SF Assuming the modulation starts at t = 0, from (1) the phase R = log M = = B b 2 SF φ(t a) t ∈ [ , T [ Ts Ts 2 ; for 0 s is given by ¹ t The ratio between the -rate Rc = M/Ts = B and the bit- φ(t; a) 2π f (τ, a) dτ 1 , rate is therefore 0   SF B B 2 Rc B 2 = 2 π a t + t − B (t − τa) u(t − τa) . (3) η = = = . M 2 Ts Rb Rb SF Also, with the LoRa parameters we see from (2) that the Its reciprocal 1/η can be seen as the modulation spectral product Bτ = M−a is an integer, and can therefore be omitted efficiency in bit/s/Hz. Some values of the spectral efficiency a in the phase. are reported in Table I for M ranging from 23 to 212. Note that a factor 1/2 for the quadratic term is missing in the phase definitions reported in [17]–[19], making the A. Continuous-time description instantaneous frequency of the signal not complaint with that of LoRa. That difference also propagated in the discrete-time To describe mathematically the signal in the time domain, let version of the signals used in [18], [19], so that even the time- us start for clarity by assuming that the frequency interval over discrete analysis made there is not applicable to the LoRa which to linearly sweep the frequency is [0, B] as depicted signal. in Fig. 1. For the time interval t ∈ [0, Ts[ and a symbol a ∈ {0, 1,..., M −1} the instantaneous frequency in LoRa can thus Property 1. The LoRa modulation is a memoryless continuous be written as with φ(0; a) = φ(Ts; a). B B f (t; a) = a + t (mod B) Proof. The initial phase is φ(0; a) = 0. The phase at the end M Ts of the symbol interval is B B = a + t − B u (t − τ ) 0 ≤ t < T (1)  B B  M T a s φ(T ; a) = 2 π a T + T − B (T − τ ) u(T − τ ) s s M s 2 s s a s a where a B/M is the initial frequency which depends on the  M  = 2 π a + − M u(T − τ ) = 0 (mod 2π) modulating symbol, and 2 s a  a  τa = Ts 1 − (2) where the last equality is due to that a + M/2 − Mu(Ts − τa) is M always an integer. In other words, the initial and final phases is the time instant where, after a linear increase, the instan- are coincident, irrespectively on the symbol a.  taneous frequency reaches the maximum; for the remaining part of the symbol interval the instantaneous frequency is still From this property we see that the LoRa modulation can linearly increasing, but reduced modulo B by subtracting B. be interpreted as a continuous phase memoryless modulation, where the transmitted waveform in each symbol interval de- 1In spread-spectrum literature this is what is usually called spreading factor. pends only on the symbol in that interval, and not on previous However, in the LoRa terminology SF is called the spreading factor. or successive symbols. This can be visualized through the ACCEPTED FOR PUBLICATION IN IEEE INTERNET OF THINGS JOURNAL 3

Property 2. The cross-correlation between the continuous time waveforms x(t; `) and x(t; m) with ` , m is ¹ Ts 1 ∗ C`,m = x(t; `)x (t; m)dt = Ts 0 ej2π`(m−`)/M − ej2πm(m−`)/M = M (7) j2π(M − |m − `|)|m − `|

and C`,` = 1. It follows that the waveforms x(t; `) and x(t; m) (p+SF)/2 are orthogonal (i.e, C`,m = 0) only for |m −`| = 2 with p ≥ 0 an odd (even) integer for odd (even) SF. Moreover, since  2π`(m−`)   2πm(m−`)  sin M − sin M < C = M (8) `,m 2π(M − |m − `|)|m − `| Fig. 2: The phase diagram as a function of time over two we have that the waveforms < x(t; `)ej2π f0t and consecutive LoRa modulated symbols, indicated in blue and  j2π f t  < x(t; m)e 0 are orthogonal (i.e, < C`,m = 0) only orange. when (m − `)2/M is an integer, or when (m2 − `2)/M − 1/2 is an integer. 2 TABLE I: Spectral efficiency, maximum cross-correlation, Also, the maximum cross-correlation can be upper bounded 99%-power bandwidth, total discrete spectrum power, and as maximum SNR penalty.  1 max < C`,m ≤ max C`,m ≤ √ . (9) ` m ` m SF  , , 2 M − 1 M = 2 1/η max < C`, m B99 Pd ∆max `,m Hence, the waveforms are asymptotically orthogonal for in- [bps/Hz] [dB] creasing M: 3 2 0.375 0.212 1.500 B 12.5% 1.04  5 lim C`,m = δ`−m . (10) 2 0.156 0.091 1.185 B 3.125% 0.41 M→∞ 27 0.055 0.045 1.045 B 0.781% 0.20 Proof. The crosscorrelation between the continuous time 210 0.0098 0.015 0.990 B 0.098% 0.07 waveforms x(t; `) and x(t; m) with ` , m and ` > m can 12 2 0.00293 0.0075 0.986 B 0.024% 0.03 be written as T ¹ s B 1 j2π (`−m) t−B t [u(t−τ` )−u(t−τm)] C`,m = e M dt phase diagram which tracks the evolution of the phase over Ts 0 ¹ Ts ¹ τm time. In Fig. 2, the phase diagram for two consecutive LoRa 1 j2π B (`−m)t 1 j2π B (`−m)t = e M dt − e M dt modulated symbols is shown as a function of time. It can be Ts 0 Ts τ` noted that each waveform starts and ends with the same phase. | {z } 0 ¹ τm 1 j2 π B ( ` − m ) t−B t The complex envelope of the modulated signal is + e [ M ] dt Ts τ` x(t; a) = γ exp { j φ(t; a)} , 0 ≤ t < T (4) 1 h i s = ej2π(M−`)(`−m)/M − ej2π(M−m)(`−m)/M √ j2π(` − m) where γ = 2 Ps accounts for the passband signal power Ps. 1 h j2π (`−M)(M+m−`) j2π (m−M)(M+m−`)i In the following we will assume γ = 1 unless otherwise stated. + e M − e M j2π(M + m− `) By introducing a frequency shift −B/2, the complex envelope centered at frequency zero for the interval [0, Ts[ is Noting the periodicity of the complex exponential function, we have     a 1 Bt M − a 1 h i x(t; a) = exp j2πBt − + −u t − . (5) C = ej2π`(m−`)/M − ej2πm(m−`)/M M 2 2M B `,m j2π(` − m) Due to the memoryless nature of the modulation, the complex 1 h i + ej2π`(m−`)/M − ej2πm(m−`)/M envelope of the LoRa signal can be written as j2π(M + m − `) j2π` m−` j2πm m−` Õ e M − e M  1 1  i(t) = x(t − nTs; an)gTs (t − nTs) (6) = + . (11) n j2π M + m − ` ` − m Similarly, for m > ` we have where an is the symbol transmitted in the time interval [ ( ) [ j2π` m−` j2πm m−` nTs, n + 1 Ts . We remark that, as this is a frequency mod- e M − e M  1 1  |i(t)| C`,m = + . (12) ulated signal, we have = 1 and the power of the signal j2π M + ` − m m − ` i(t) is one. The passband modulated signal centered at f0 is  j2π f t then s(t) = < i(t)e 0 . 2We assume f  B so that the passband waveforms are orthogonal when  0 < C`, m = 0. ACCEPTED FOR PUBLICATION IN IEEE INTERNET OF THINGS JOURNAL 4

Putting together (11) and (12), the complex crosscorrelation, B. Discrete-time description C`,m, can be derived as in (7). The correlation in (7) can be For a simple receiver implementation it has been proposed zero only if the two exponentials are equal, that requires `(m− to sample the received signal at chip rate, i.e., every Tc = `)/M = m(m − `)/M − k, with k an integer. Thus, it must be √ Ts/M = 1/B seconds [16]. In this case we have in the interval |m − `| = kM. Since this must be an integer, and M = 2SF, [0, Ts[ the samples k p p ≥ it follows that = 2 with 0 an odd (even) integer for   odd (even) SF. kTs a 1 BkTs x(kTc; a) = exp j2πB − + The real cross-correlation (8) follows directly, and the M M 2 2M2   conditions for its zeros are straightforward observing that Ts M − a −u k − sin α = sin β for α = β + k2π or α = π − β + k2π. M B In order to find the asymptotic behavior of the complex   a 1 k  T M − a  = exp j2πk − + − u k s − cross-correlation, we start by upper bounding its absolute value M 2 2 M M B for ` , m. From (7) we have   a 1 k  = exp j2πk − + , k = 0, 1,..., M − 1 −jπ(m−`)2/M jπ(m−`)2/M 2 2 e − e M 2 2 M C = Mej2π(m −` )/M `,m j2π(M − |m − `|)|m − `| (13) where the last equality is due to the fact that 2πk u(·) is always and therefore an integer multiple of 2π. This observation allows to avoid 2  sin π(m − `) /M the modulus operation in the discrete-time description. Then, C`,m = M . π(M − |m − `|)|m − `| from (13) we have immediately the following property about the orthogonality of the discrete-time waveforms. The first maximum for C`,m is in the interval j k Property 3. The discrete-time signals x(kT ; a) are orthogo- 1 ≤ |m − `| ≤ pM/2 . This is due to the following c nal in the sense that reasons: M−1 1 Õ • C`,m is symmetric around M/2; x(kT ; `)x∗(kT ; m) = δ (14) M c c `−m • the denominator is monotonically increasing for k=0 1 ≤ |m − `| ≤ M/2; Proof. From (13) we have • the numerator is monotonically increasing for 1 ≤ |m − jp k jp k M−1 M−1 `| ≤ M/2 , and starts to decrease after M/2 . 1 Õ ∗ 1 Õ j2πk `−m x(kT ; `)x (kT ; m) = e ( M ) M c c M Hence, we have k=0 k=0 2  = δ`−m sin π(m − `) /M max C`,m = max M ` m j√ k , 1≤ |m−` | ≤ M/2 π(M − |m − `|)|m − `| 

|m − `| As observed in [16], [18], once we have x(kTc; a) we can ≤ max j√ k compute the twisted (dechirped) vector x˜ with elements 1≤ |m−` | ≤ M/2 M − |m − `| 2 −j2π k +jπk 1 x˜ = x˜(kT ; a) = x(kT ; a)e 2 M . (15) ≤ √ k c c 2 M − 1 Now, substituting (13) in (15), we see that where for the first inequality sin(x) ≤ x for 0 ≤ x ≤ π/2 is j2πk a x˜k = e M , k ∈ {0, 1,..., M − 1} (16) used. For the second inequality, it is noticed that the function is increasing in |m−`|, so its maximum value is obtained with which can be interpreted as a discrete-time complex sinusoid j k |m − `| = pM/2 ≤ pM/2. Finally, taking the limit when at frequency a. It follows that its Discrete Fourier Transform M → ∞ gives (10).  gives the vector X = DFT(x˜) with elements M−1 M−1 Õ −j2πkq/M Õ −j2πk(q−a)/M The correlation among the waveforms of the LoRa modu- Xq = x˜(kTc; a)e = e lation has an impact on the error performance for the opti- k=0 k=0 mum coherent receiver over AWGN channels [21], [22]. In = Mδq−a, q ∈ {0, 1,..., M − 1} . (17) particular, for the pairwise error probability between the `-  Therefore, the DFT of the twisted signal (15) has only one th and m-th waveforms there is a factor 1 − < C`,m in the SNR with respect to orthogonal modulation schemes (see, e.g., non-zero element in the position of the modulating symbol a. equations (4.31) and (4.49) in [21]). In Table I we report This means that a possible way to implement a demodulator is to compute the dechirped vector (15), and decide based on the maximum penalty on the SNR, ∆max, corresponding to the maximum cross-correlation, to be paid with respect to its DFT. orthogonal modulation schemes. For example, with M = 27 we Remark 1. One could think now that working in the discrete-  have max`,m < C`,m = 0.045 and the maximum penalty is time domain we can achieve the performance of orthogonal ∆max = 0.2 dB. modulations. However, this is not exactly the case, since, as ACCEPTED FOR PUBLICATION IN IEEE INTERNET OF THINGS JOURNAL 5 will be shown in the next section, the bandwidth of the signal The spectrum can be derived analytically by expressing the in (6) is larger than B. Therefore, filtering over a bandwidth B Fourier transforms X( f ; `) in terms of Fresnel functions. More will distort the signal, and the resulting samples will not be like precisely, we have in (13). As a consequence, they will not obey the orthogonality T τ h 2 i ¹ s ¹ ` j2π Bt( ` −1 )+ B t2 condition in (14). To avoid distortion, in general a bandwidth X( f ; `)= x(t; `)e−j2π f t dt = e M 2 2M e−j2π f t dt larger than B should be kept before sampling. In the presence 0 0 T h 2 i ¹ s j2π Bt( ` − 3 )+ B t2 of AWGN, this will produce an increase in the noise power + e M 2 2 M e−j2π f t dt. (22) and correlation between noise samples with respect to an τ` orthogonal modulation. However, for large M the bandwidth Let us define the function of the signal stays approximately into a bandwidth B (see next ¹ t2   2 section and Table I), and therefore it is possible to implement a W(a; b; t1; t2) = exp j2π a t + b t dt (23) receiver based on sampling at rate B, dechirping, and looking t1 for the maximum of the DFT. This is consistent with the that can be expressed in terms of the Fresnel functions as 2 √ observation that for large M the modulation is approximately 1 −j2π a h   a  W(a; b; t1; t2) = √ e 4 b K 2 b t2 + − orthogonal (see Property 2). 2 b 2 b  √  a i K 2 b t + (24) 1 2 b III.SPECTRAL ANALYSIS OF THE LORA MODULATION where K(x) , C(x) + j S(x). Then, the Fourier transform of In this section, the power spectrum of the LoRa modulation the waveforms can be written analytically as is analytically derived in closed form in terms of Fresnel   ` 1  B2 M − `  functions, or through the discrete Fourier transform. Then, it X( f ; `) = W B − − f ; ; 0; + M M B is shown that the modulated signal has a discrete spectrum 2 2   ` 3  B2 M − ` M  containing a fraction 1/M of the overall signal power. W B − − f ; ; ; (25) M 2 2 M B B that used in (20) and (21) gives the signal spectrum. A. Power Spectrum of LoRa Modulated Signals An alternative to the use of the Fresnel functions consists Let us consider a source that emits a sequence of indepen- in the standard Discrete Fourier Transform approach, where dent, identically distributed discrete random variables An with we take N samples of x(t; `) over the time interval [0, Ts[ in a probability vector x(`) = {x(0; `), x(∆t ; `), ··· , x((N − 1)∆t ; `)}, with step ∆t = Ts/N. Then, the vector X(`) = ∆t DFT(x(`)) gives the 1 P{A = `} = , ` ∈ {0, 1, ··· , M − 1}. samples with frequency step ∆f = 1/Ts = B/M of the periodic n M Í ∀ repetition k X( f − kF; `), where F = N/Ts = NB/M. For From (6) the modulator output can be represented by the sufficiently large N the effect of aliasing is negligible, so that stochastic process the elements of X(`) are essentially the samples of X( f ; `) with step ∆ . For the discrete spectrum this frequency step Õ f I(t) = x(t − nTs; An)gTs (t − nTs) (18) is exactly what is needed in (21). If a finer resolution in n frequency is needed (for the continuous spectrum in (20)) we have to zero-pad the vector x(`) before taking the DFT. For where the random signal x(t; ·) can take values in the set example, if we add (k − 1)N zeros to x(`) the frequency step {x(t; `)}M−1 of finite energy deterministic waveforms. The `=0 is ∆ = 1/kT = B/kM. power spectral density of the random process I(t) can be f s written as the sum of a continuous and a discrete parts B. Total Power of the Discrete spectrum c d GI ( f ) = GI ( f ) + GI ( f ) . (19) Lines in the spectrum indicates the presence of a non-zero mean value of the signal, which does not carry information. The expressions of the continuous and discrete spectra in The following property quantifies the power of this mean value (19) can be found by using for the random process (18) the with respect to the overall signal power. frequency domain analysis of randomly modulated signals (see e.g. [21], [22]), obtaining Property 4. The total power of the discrete spectrum for the LoRa modulation 2 2 M−1 M−1  ∞ ∞ M−1 c 1  Õ 2 1 Õ  ¹ 1  B  G ( f ) = |X( f ; `)| − X( f ; `) (20) d Õ Õ I   Pd = GI ( f ) df = X n ; ` Ts M  M  2 2 M  `=0 `=0  −∞ Ts M n=−∞ `=0   ∞ M−1 2 / 1 Õ Õ  B   B  is exactly a fraction 1 M of the overall signal power. Gd( f ) = X n ; ` δ f − n (21) I 2 2 M M Proof. The discrete spectrum in (21) is due to the mean value Ts M n=−∞ `=0 of the signal where {X( f ; `)}M−1 are the Fourier transforms of the wave- Õ `=0 E {I(t)} = E {x(t − nT ; A )} g (t − nT ) . forms {x(t; `)}M−1 given in (5). s n Ts s `=0 n ACCEPTED FOR PUBLICATION IN IEEE INTERNET OF THINGS JOURNAL 6

This mean value is not zero, implying that there are lines in 10 SF = 3 the spectrum [21], [22]. More precisely, since the modulation SF = 7 is memoryless, we have for 0 ≤ t < T SF = 10 s 0 SF = 12 M−1 M−1 M−1 1 Õ 1 Õ Õ E {x(t; A0)} = x(t; `) = x(t; `) M M 10

`=0 `=0 k=0 ) − B

M−1 M−1 ) f

1 Õ Õ ( × g (t − k T ) = g (t − k T ) x(t; `) c I Tc c Tc c G 20 M − k=0 `=0 ( M−1 M−1 M−1 ) 1 Õ Õ Õ 10 log ( = g (t) x(t; `) + g (t − k T ) x(t; `) 30 M Tc Tc c − `=0 k=1 `=0 where Tc = 1/B is the chip rate. From (5) we have 40 − ( M−1 1 j2π B t2 Õ j2π B ` t E {x(t; A )} = e 2Ts g (t) e M + 0 M Tc 50 `=0 − 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 M−1 "M−k−1 M−1 #) f/B Õ Õ j2π B ` t Õ j2π B ` t −j2πBt g (t − k T ) e M + e M e Tc c (a) The continuous part of the spectrum k=1 `=0 `=M−k ( M−1 j2πBt SF = 3 1 j2π B t2 1 − e Õ = e 2Ts g (t) + g (t − k T ) 20 SF = 7 Tc j2πBt/M Tc c − M − e SF = 10 1 k=1 SF = 12 −j2πBt  j2πB(M−k)t/M e − 1 40 ×e . − 1 − ej2πBt/M

After some manipulation we get 60 − 1 j π Bt (Bt−1) sin (πBt) E {x(t; A0)} = e M M sin (πBt/M) 80 M−1 − Õ −j2πBkt/M × gTc (t − k Tc) e .

Discrete power spectrum (dB) 100 k=0 − The absolute value of the mean is therefore 120 1 sin (πBt) − |E {x(t; A0)} | = , 0 ≤ t < Ts . M sin (πBt/M) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Now, recalling the following integral for m integer [23, p. 396] f/B 2 ¹ π/2  sin mx  π (b) The discrete spectrum dx = 0 sin x 2 Fig. 3: The continuous and discrete spectrum of the com- we get the power of the discrete spectrum as plex envelope for LoRa modulation, M = 2SF, with SF ∈

¹ Ts {3, 7, 10, 12}. 1 2 1 Pd = |E {x(t; A0)} | dt = . (26) Ts 0 M Therefore, there are lines in the spectrum of the LoRa mod- SF = 3 we have M = 8 and thus 1/M = 12.5% of the signal ulation, and the power of this discrete spectrum is a fraction power is contained in the discrete spectrum. We can see that 1/M of the overall power.  the power spectrum becomes more compact for increasing M, so that most of the power for the complex envelope is IV. NUMERICAL RESULTS contained between −B/2 and B/2, or, in other words, that the We first show in Fig. 3 the two-sided power spectrum of the modulated signal bandwidth is close to B for large M. complex envelope for LoRa modulated signals as a function To better quantify this effect, we report in Table I the on the normalized frequency f /B, with various spreading bandwidth B99 centered on f0 containing 99% of the power factors, i.e., SF ∈ {3, 7, 10, 12}. Since GI (− f ) = GI ( f ) we for different spreading factors. It can be seen that, while for 7 just show GI ( f ) for f ≥ 0. In the figure we report both the M ≥ 2 almost all of the signal is contained in a bandwidth B, c normalized power spectral density, 10 log10 GI ( f ) B, and the considering just a bandwidth B for smaller spreading factors discrete part of the spectrum. For the latter we report the power will leave out a part of the signal, therefore distorting the ÍM−1 2 2 2 `=0 X (nB/M; `) /Ts M at frequency nB/M, as given in signal. Moreover, as noted in Section II and Section III, the (21). The sum of the power of all lines in the discrete spectrum spectral efficiency, the maximum real cross-correlation, and is equal to 1/M, as proved in Property 4. For example, with the power of the discrete spectrum decrease for increasing M. ACCEPTED FOR PUBLICATION IN IEEE INTERNET OF THINGS JOURNAL 7

10 0 Analytical Analytical Experimental Mask

0 10 −

10 20 − −

20 30 − −

Power Spectrum (dB) 40 30 − − Power Spectrum (dBm/1 kHz)

50 40 − −

60 50 − 867.6 867.8 868 868.2 868.4 868.6 868.8 869 − 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 f (MHz) f/B (a) SF = 7 (a) One channel, B = 250 kHz.

10 0 Analytical Analytical Experimental Mask 10 − 0

) 20 f − 10 − 30 −

20 − 40 − Power Spectrum (dBm/∆ Power Spectrum (dBm/1 kHz)

30 50 − −

60 − 40 867.6 867.8 868 868.2 868.4 868.6 868.8 869 − 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 f (MHz) f/B (b) Three channels, B = 125 kHz. (b) SF = 10 Fig. 5: The one-sided power spectrum for LoRa modulated Fig. 4: The power spectrum of the complex envelope for passband signals using the analytical expressions, compared LoRa modulation using the analytical expressions and the with the mask from the ETSI regulation in the G1 sub-band, SF ∈ { } experimental data, for M = 2 , SF 7, 10 , B = 125 kHz, for M = 27, ∆ f = 1 kHz, and P = 14 dBm. ∆ / s f = B 256, and Ps = 27 dBm. a) One channel with center frequency 868.3 MHz for B = 250 kHz. b) Three channels with center frequencies 868.1 MHz, 868.3 MHz, and 868.5 MHz for B = 125 kHz. In Fig. 4, we compare the derived analytical power spectrum with that obtained from the IQ samples of a commercially available LoRa transceiver [24]. More precisely, IQ samples samples have been taken at fs = 4 B, not large enough to are provided for LoRa modulated waveforms, which have been completely eliminate frequency aliasing. created with a randomly generated payload of 16 bytes. The Finally, we investigate the LoRa spectrum along with the waveforms are obtained for B = 125 kHz with sample rate f = s ETSI regulations for out-of-band emissions [26, 7.7.1]. Since 4 B [24]. The frequency range of interest is divided into several LoRa is a chirp spread spectrum technique, it is governed bins with width ∆ f = B/256, and the power within each bin by the regulations for ISM bands that support wideband is computed either analytically via (20) and (21), or through modulation [26, Table 5]. For example, we consider the G1 spectral estimation by implementing the Welch’s method on sub-band spanning from 868 MHz to 868.6 MHz [26, Fig. 7]. the experimental data [25]. It is noticed that the estimated There are two possibilities for using LoRa in this sub-band: spectrum agrees well with the analytical expression. We can also observe that the tail of the estimated spectrum is slightly • using a single channel with center frequency 868.3 MHz higher than the analytical; this is because the experimental for B = 250 kHz; ACCEPTED FOR PUBLICATION IN IEEE INTERNET OF THINGS JOURNAL 8

• using three channels with center frequencies 868.1, 868.3, [7] W. Zhao, S. Lin, J. Han, R. Xu, and L. Hou, “Design and implemen- and 868.5 MHz for B = 125 kHz. tation of smart irrigation system based on LoRa,” in IEEE Globecom Workshop, Singapore, Singapore, Dec 2017, pp. 1–6. In Fig. 5 we report, for the two cases above, the one-sided [8] H. Lee and K. Ke, “Monitoring of large-area IoT sensors using a LoRa power spectrum calculated analytically with bin width (i.e., wireless mesh network system: Design and evaluation,” IEEE Trans. Instrum. Meas., vol. 67, no. 9, pp. 2177–2187, Sept 2018. resolution bandwidth) ∆ f = 1 kHz, and Ps = 14 dBm, i.e., [9] L. Feltrin, C. Buratti, E. Vinciarelli, R. D. Bonis, and R. Verdone, the maximum allowed transmission power. The spectrum is “LoRaWAN: Evaluation of link- and system-level performance,” IEEE compared with the spectral mask for the G1 sub-band. It can Internet Things J., vol. 5, no. 3, pp. 2249–2258, June 2018. [10] G. Pasolini, C. Buratti, L. Feltrin, F. Zabini, C. De Castro, R. Ver- be noticed that the spectrum meets the regulations of the done, and O. Andrisano, “Smart city pilot projects using LoRa and maximum power limits for adjacent band emissions at the IEEE802.15.4 technologies,” Sensors, vol. 18, no. 4, p. 1118, 2018. G1 sub-band. The same method can be used to examine the [11] M. Alahi, N. Pereira-Ishak, S. Mukhopadhyay, and L. Burkitt, “An Internet-of-Things enabled smart sensing system for Nitrate monitoring,” LoRa compliance for various ISM bands, spreading factors, IEEE Internet Things J., pp. 1–1, 2018. and bandwidths, according to other regional regulations. [12] O. Georgiou and U. Raza, “Low power wide area network analysis: Can LoRa scale?” IEEE Wireless Commun. Lett., vol. 6, no. 2, pp. 162–165, April 2017. V. CONCLUSIONS [13] F. V. den Abeele, J. Haxhibeqiri, I. Moerman, and J. Hoebeke, “Scalabil- ity analysis of large-scale LoRaWAN networks in Ns-3,” IEEE Internet In this paper we investigated the spectral characteristics of Things J., vol. 4, no. 6, pp. 2186–2198, Dec 2017. [14] J. Lim and Y. Han, “Spreading factor allocation for massive connectivity the LoRa M-ary modulation, deriving the analytical expression in LoRa systems,” IEEE Commun. Lett., vol. 22, no. 4, pp. 800–803, of the spectrum, and comparing it with experimental data and April 2018. with the spectral limit masks for the ISM bands. We found that [15] D. Croce, M. Gucciardo, S. Mangione, G. Santaromita, and I. Tinnirello, / “Impact of LoRa imperfect orthogonality: Analysis of link-level perfor- there are lines in the spectrum, containing a fraction 1 M of mance,” IEEE Commun. Lett., vol. 22, no. 4, pp. 796–799, April 2018. the overall power, and that the occupied bandwidth is in gen- [16] F. Sforza, “Communications system,” 2013, US Patent 8,406,275. eral larger than the deviation B. We also derived the waveform [17] B. Reynders and S. Pollin, “Chirp spread spectrum as a modulation technique for long range communication,” in Proc. Symposium on cross-correlation function, proving that the LoRa waveforms Communications and Vehicular Technologies (SCVT), Mons, Belgium, can be considered orthogonal only for asymptotically large M. Nov 2016, pp. 1–5. [18] L. Vangelista, “Frequency shift chirp modulation: The LoRa modula- tion,” IEEE Signal Process. Lett., vol. 24, no. 12, pp. 1818–1821, Dec 2017. REFERENCES [19] T. Elshabrawy and J. Robert, “Closed form approximation of LoRa modulation BER performance,” IEEE Commun. Lett., pp. 1–5, June [1] M. Centenaro, L. Vangelista, A. Zanella, and M. Zorzi, “Long-range 2018. communications in unlicensed bands: the rising stars in the IoT and [20] M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions smart city scenarios,” IEEE Wireless Commun., vol. 23, no. 5, pp. 60– wih Formulas, Graphs, and Mathematical Tables. New York, NY, 67, Oct. 2016. United States: Dover Publications, 1974, vol. 55. [2] U. Raza, P. Kulkarni, and M. Sooriyabandara, “Low power wide area [21] S. Benedetto and E. Biglieri, Principles of digital transmission: with networks: An overview,” IEEE Commun. Surveys Tuts., vol. 19, no. 2, wireless applications. Berlin/Heidelberg, Germany: Springer Science pp. 855–873, Jan. 2017. & Business Media, 1999. [3] F. Adelantado, X. Vilajosana, P. Tuset-Peiro, B. Martinez, J. Melia- [22] J. G. Proakis, Digital communications. New York City, United States: Segui, and T. Watteyne, “Understanding the limits of LoRaWAN,” IEEE McGraw-Hill, 1995. Commun. Mag., vol. 55, no. 9, pp. 34–40, Sept. 2017. [23] I. S. Gradshteyn and I. M. Ryzhik, Tables of Integrals, Series, and Products, 7th ed. San Diego, CA: Academic Press, Inc., 2007. [4] E. Morin, M. Maman, R. Guizzetti, and A. Duda, “Comparison of the [24] Semtech LoRa, “LoRa IQ waveform library,” 2018. [Online]. Available: device lifetime in wireless networks for the Internet of things,” IEEE https://semtech.force.com/lora Access, vol. 5, pp. 7097–7114, 2017. [25] P. Welch, “The use of fast Fourier transform for the estimation of [5] “A technical overview of LoRa and LoRaWAN,” LoRa Alliance Tech- power spectra: A method based on time averaging over short, modified nical Marketing Workgroup, Tech. Rep., 2015. periodograms,” IEEE Trans. Audio Electroacoust., vol. 15, no. 2, pp. [6] H. Sherazi, G. Piro, L. Grieco, and G. Boggia, “When renewable energy 70–73, June 1967. meets LoRa: A feasibility analysis on cable-less deployments,” IEEE [26] “ETSI EN 300 220-1 V2.4.1,” European Telecommunications Standards Internet Things J., pp. 1–12, May 2018. Institute, Tech. Rep., 2012.