Baud rate is the number of symbols per second.
You have 36 bits, each bit is made up of 3 symbols (011 or 001), so there are 108 symbols.
One packet takes 44.7ms, so the symbol rate is \$\frac{108}{0.0447}\$ = 2416.1 symbols per second.
As each bit is 3 symbols you also know that it equates to \$\frac{2416.1}{3}\$ = 805.4 bits per second. You can confirm that as \$\frac{36}{0.0447} = 805.4\$ bits per second.
LoRa is a chirp-based spread-spectrum modulation. A symbol is a chirp.
To generate symbols/chirps, the modem modulates the phase of an oscillator. The number of times per second that the modem adjusts the phase is called the chip rate and defines the modulation bandwidth. Chip rate is a direct subdivision of the quartz frequency (32 MHz).
Example for 125 kHz LoRa:
125 kHz modulation bandwidth
= 125000 chips per second
= 8 µs per chip
modulation bandwidth < occupied spectral bandwidth < channel spacing (typ 200 kHz)
Basic chirps are simply a ramp from fmin to fmax (up-chirp) or fmax to fmin (down-chirp). Data-carrying chirps are chirps that are cyclically-shifted, and this cyclical shift carries the information.
The spreading factor defines two fundamental values:
- the number of chips contained in each symbol is \$ 2^{SF} \$
- the number of raw bits that can be encoded by that symbol is SF
The reason is that a symbol, with a length of N chips, can be cyclically shifted from 0 to N-1 positions. The "reference" position is given by the un-shifted symbols at the beginning of the LoRa frame. So this cyclical shift can carry log2(N) bits of information. If N is a power of two, the math works nicely.
Example for SF 7
A SF 7 symbol is 128 chips long
= 1.024 ms @125kHz modulation bandwidth
= 512 µs @250kHz modulation bandwidth
= 256 µs @500kHz modulation bandwidth
A 128-chip long symbol can by cyclically shifted from 0 to 127 positions, and that shift
carries 7 bits of raw information:
~ 6.8 kbps raw @125kHz modulation bandwidth
~ 13.7 kbps raw @250kHz modulation bandwidth
~ 27.3 kbps raw @500kHz modulation bandwidth
Due to noise, this modulation/demodulation process introduces errors, and that's why an error correction code is added.
For a typical payload, 25% (CR1) or 50% (CR2) of redundancy is added before modulating chirps. In practice, the data sent by the user is also mixed to get better error correction properties.
Raw data-rate and error correction define the nominal data-rate. To get the effective maximum data-rate a device can transmit at, you have to take into account:
- legal duty-cycle limit, if applicable, of the band you emit in
- overhead of the LoRa preamble, header and CRC for each frame sent (significant influence when short frames are sent)
- overhead of your protocol for each frame (also very important for short frames)
Edit:
I have added (in red) the boundaries of chirps so that the effect of cyclical-shifts is easier to understand. Except for a few special symbols at the end of the preamble signaling a start of frame, all chirps in a LoRa frame are the exact same length. Frequency seems to "jump around" quite a bit, but there is no discontinuity in phase that would lead to copious amounts of unwanted harmonics all around the band.
Best Answer
Easy way
The easiest way to calculate the data rate is to use the official LoRa calculator that you can download from this link.
Spreading factor is displayed differently compared to the site that the picture is from.
In the program, the spreading factor should be recognized as the exponent of two, as \$2^{12}\$ is 4096 which is the same thing, as in
Bw125Cr48Sf4096
.You enter your values on the left, and modifying the values in the green rectangle are changing the equivalent bitrate part on the right, although changing values under
Packet Configuration
changes the other relevant values for timing, but doesn't affect the bitrate.Manual way
If you want to calculate the bitrate manually, the documentation recommends the following method on the bottom of page 3 of the LoRa FAQ.
\$DR = SF \cdot \cfrac{BW}{2^{SF}} \cdot CR\$
DR = Data rate
SF = Spreading factor
BW = Bandwidth
CR = Coding rate
If we substitute the above mentioned example values, we get the following:
\$DR = 12 \cdot \cfrac{125\ kHz}{2^{12}} \cdot \cfrac{4}{8}\$
\$DR = 183.1055\ bps\$.
This is the exact same value what we got in the calculator software.
Sources
LoRa Design Guide
LoRa FAQ