0
1
00:00:01,290 --> 00:00:04,050
The bitrate of a transmission is an easy calculation.
1

2
00:00:04,830 --> 00:00:07,590
As its name mentioned, it's the number of bits per seconds.
2

3
00:00:08,190 --> 00:00:13,650
So when we calculate the bitrate, we simply divide the number of bits by the transmission time.
3

4
00:00:14,460 --> 00:00:16,530
That's exactly what we've done so far.
4

5
00:00:17,550 --> 00:00:23,430
But when we use a protocol, there is usually only a little part of the frame which is useful for the user.
5

6
00:00:24,240 --> 00:00:25,990
Let's take an example of a LoRa packet
6

7
00:00:26,910 --> 00:00:33,840
We assume that a user wants to transmit one byte for let's say a temperature. We won't send right away the byte
7

8
00:00:33,840 --> 00:00:34,350
in the air.
8

9
00:00:34,710 --> 00:00:38,430
We need to use a specific format in respect to the LoRa specification.
9

10
00:00:39,090 --> 00:00:42,060
So let's see how a complete LoRa frame looks like.
10

11
00:00:43,140 --> 00:00:50,130
In a LoRa frame, there is a Preamble and a Header following by the Payload,
11

12
00:00:50,130 --> 00:00:51,310
here our temperature.
12

13
00:00:51,930 --> 00:00:54,720
And finally, a CRC for error detection.
13

14
00:00:55,740 --> 00:01:00,990
The previous bitrate was calculated using the Payload size and the time to transmit this Payload.
14

15
00:01:01,590 --> 00:01:06,660
But the real bitrate should be the Payload size divided by the overall Frame Time.
15

16
00:01:06,660 --> 00:01:10,860
And a Frame Time is what we call the Time On Air.
16

17
00:01:12,000 --> 00:01:18,030
If we make an analogy, we can imagine a car journey between two cities 100 kilometers apart.
17

18
00:01:18,630 --> 00:01:23,580
You can say that if you drive at 100 kilometers per hour, you will take one hour to get there.
18

19
00:01:24,000 --> 00:01:27,180
This is what your car dealer told you, and everyone believes it.
19

20
00:01:27,570 --> 00:01:31,470
But this is never true because you will have to get out of the city,
20

21
00:01:31,830 --> 00:01:33,120
you will have few stops,
21

22
00:01:33,120 --> 00:01:37,830
and again, you will never be able to drive at 100 kilometers until the final destination.
22

23
00:01:38,700 --> 00:01:43,920
So, we must make the difference between the car speed capacity and the average speed.
23

24
00:01:44,310 --> 00:01:50,370
And the average speed is in that case, the number of kilometers divided by the real duration of your
24

25
00:01:50,370 --> 00:01:50,850
journey.
25

26
00:01:51,780 --> 00:01:57,180
This is exactly the same thing here, and it is why we need to know the overall Time On Air.
26

27
00:01:57,660 --> 00:02:03,300
In the book provided with these courses, there is a formula that you can use but here will use a simulator
27

28
00:02:03,300 --> 00:02:04,740
called LoRa Calculator.
28

29
00:02:05,190 --> 00:02:12,240
This simulator depends on the transceiver used and the one used for this video is the SX1261 transceiver.
29

30
00:02:12,900 --> 00:02:16,800
I attached this little software with this video so you can download and try it.
30

31
00:02:17,970 --> 00:02:23,640
So we're going to set the same configuration corresponding to our two cases and check the result in the
31

32
00:02:23,640 --> 00:02:31,650
Time On Air field. The settings for the first case were SF7, 125 kHz bandwidth with a
32

33
00:02:31,650 --> 00:02:33,390
coding rate of 4/5.
33

34
00:02:34,380 --> 00:02:37,170
And we have several choices for the packet configuration.
34

35
00:02:37,860 --> 00:02:40,830
We could use anyone for a point to point LoRa transmission.
35

36
00:02:41,100 --> 00:02:47,700
Of course, as long as the transmitter and the receiver has the same configuration. But we're going
36

37
00:02:47,700 --> 00:02:48,180
to prepare
37

38
00:02:48,180 --> 00:02:50,880
the next step where we'll use only LoRaWAN.
38

39
00:02:51,660 --> 00:02:58,500
So we are not building a LoRaWAN frame here, but the LoRaWAN protocol will need these specific settings later.
39

40
00:02:58,980 --> 00:03:02,160
So that's why we apply these ones instead of choosing other ones.
40

41
00:03:03,240 --> 00:03:09,390
There is a Preamble length of eight symbols, Header mode enable and CRC enable.
41

42
00:03:11,580 --> 00:03:17,940
Finally, the Payload length is our simulated temperature of one byte, which gives a calculated Time
42

43
00:03:17,940 --> 00:03:21,330
On Air of 25.85 milliseconds.
43

44
00:03:22,560 --> 00:03:31,950
And we can do the same thing for the second case with a SF  of 12, which gives a Time On Air of 827.39 milliseconds.
44

45
00:03:33,150 --> 00:03:38,010
So we can use these two durations to calculate the real bitrate of our LoRa transmission.
45

46
00:03:39,240 --> 00:03:45,660
Once again, the bitrate is the number of bid divided by the time, 8 bits divided by the Time On Air.
46

47
00:03:45,660 --> 00:03:53,910
In the first case, which was 25.85 milliseconds, that gives a result of 309.3 bits per
47

48
00:03:53,910 --> 00:03:54,090
second.
48

49
00:03:55,320 --> 00:03:56,520
When we use a SF of 12,
49

50
00:03:56,610 --> 00:04:03,300
we still have 8 bits, but this time it's divided by 827.39 milliseconds.
50

51
00:04:03,930 --> 00:04:07,590
That gives a result of 9.6 bits per second.
51

52
00:04:08,700 --> 00:04:15,000
You can see that we now reached a very low bitrate, far from the one given in the documentation.
52

53
00:04:15,810 --> 00:04:21,360
And unfortunately, we're not going to stop here since there is still two other things to take into
53

54
00:04:21,360 --> 00:04:21,810
account.
54

55
00:04:22,260 --> 00:04:24,120
This is what we will see in the next video.
