Understanding of LoRa

Tapadyuti Baral
5 min readOct 7, 2023

--

Lora is a proprietary physical layer protocol developed by Semtec Corporation. It is based on spread spectrum modulation, where modulated signal bandwidth is much larger than the base band signal bandwidth i.e. spread spectrum is a wide band scheme. A special code (pseudo noise) is used for spectrum spreading and the same code is to be used to de-spread the signal at the receiver. The code spreads the radio signal over a much wider bandwidth. In fact, so wide that the power may well be dispersed so that the total signal falls down into the background radio noise — and becomes invisible. Recovery is therefore a matter of i) knowing the original radio frequency ii) the pseudo random code and iii) and the PR code bit rate. Knowing these details means that synchronising receivers is not as difficult as may at first appear. The signal will just ‘pop up’ out of the noise when the correct values are achieved. (‘Processing Gain’).

Under the type of spread Spectrum Modulation, Lora protocol has used chirp spread spectrum modulation technique. It is also call Frequency Shift Chirp Modulation — a specialise type of FSK modulation.

Image: Generic Types of Modulation Technique

LoRa is based on Chirp Spread Spectrum (CSS) technology, where Chirp stands for ‘Compressed High Intensity Radar Pulse’. It is a signal which frequency either increase or decrease with time. Chirp also known as symbols are the carrier of data, which enables it to achieve excellent receiver sensitivity and resistance to interference. It is designed to provide very long-range communication without less interference from the noise. Two types of chirp are available — Up chirp (increase in freq) & Down chirp (decrease in freq).

Image: UP Chirp & Down Chirp

CSS (chirp spread spectrum) techniques helps to transmit signals for very large distances.
1. Bandwidth, time product is always greater than one (B*T > 1).
2. Chirp spread spectrum is resistive to Doppler shift.
3. It is used for low power and low data rates.

LoRa uses three different bandwidth: 125kHz, 250kHz and 500kHz

Here one of the important parameter is Spreading Factor (SF) — It helps to decide how many types of symbols will transfer. If the SF = 7, then total no of different symbols are 128–1. Here its an example of SF = 2, it supports total 4 types of symbols.

Image: Different Types of Chirp in SF2 Lora TX

Lora uses between SF7 to SF12 spreading factors.

Image: Spectrogram captured of Lora Symbols in different SF

How to determine Symbols in Lora ??

It has an exponential function so it is a complex function base band. Here, K is incremented in every symbol/chirp. Each value of S generates different waveform

Next the receiver’s job is to understand symbols & de-chirping it. Mathematically correlation is an important factor here for de-chirping the received signal. Basically it checks the similarity of each symbol and does the maximum correlation coefficient.

Image: Symbol Synchronisation using Correlation Factor

It can be computationally burdensome for a receiver to first successfully receive the symbol & check the similarity. Here mathematical tricks simplify the computational burden a lot. Another good part of use correlation, it can demodulate signals which can be below the noise floor.

Correlation Factor

Image: Simplified Correlation Formula

For the misalignment of the signal framing, it adjusts its window, misalignment is proportional to the de-modulated data symbol.

Image: Correlation Factor used in Rx sie of LoRa

Bandwidth is fixed (100k-500KHz) as per standard & the sweep rate depends on the SF. As an example — Data rate 27 kbps with spreading factor 7 and 500 kHz bandwidth channel

Lora Message Format

LoRa physical layer includes 8 preamble symbols, 2 synchronisation symbols, physical payload and optional CRC.

SF8 takes exact twice the time of SF7 and SF9 takes exact twice time of SF8.
- Symbol Rate(Rs), Bandwidth(BW) and Spreading Factor(SF) relation:
Rs = BW / (2^SF)
Higher the Spreading Factor -> Higher the over-the-air time.
Lower the Spreading Factor -> Higher the Data Rate.

Image: LoRa Message Stack format

First 8 up-chirp symbols are preamble symbols used to detect LoRa chirps, next 2 down-chirp symbols are synchronization symbols used for timing synchronization followed by the 5 modulated symbols (payload). The jump in the frequency represents the modulated symbol.

Case Study :

By using similar bandwidth, code rate & fixed AWGN (Additive White Gaussian Noise), i have generated lora phy layer communication in the Matlab code with the SF value of 7. Here it is showing the SNR of the transmitted symbols.

Image: Matlab Code generated spectrum using SF7

On the other hand, with predefined values with SF12 i have generated lora transmission using Matlab simulation to check the SNR.

Image: Matlab Code generated spectrum using SF12

Here, it is concluded from the Matlab simulation plot. Using Higher Spreading Factor (SF) in the Transmitted Symbol is less affected from the outside Noise compared with Lower SF.

The LoRa physical layer modulation technology operates in the MHz frequency range. The specific frequencies within these bands may vary to comply with local regulations. For example, in Europe, the frequency range is typically from 863 MHz to 870 MHz, and in North America, it is commonly from 902 MHz to 928 MHz. In India, it is 865 MHz to 867 MHz.

Image: Standardized LoRa Modulation Freq Range

In the India, the spectrum range between 865MHz to 867MHz all channels are in uplink as well as downlink mode.

Image: Frequency Plan in India

Using Spectrum Analyzer or SDR with specific Antenna anyone can track the spectrum with the recommended channel. Here we are using Hack-RF, its dipole antenna with the AirSPY software tool to analyze the surrounding LoRa modulation spectrum.

Image: Lora Spectrum Analysis using a SDR

--

--

Tapadyuti Baral

Embedded/ IoT Engineer, Hardware Design, Experience on Hardware & Radio Exploitation, Reverse Engineering