Practical Python Use Cases

This video discusses Practical Python Use Cases in order to understand how to create basic 5G interactive tools.

The idea about these Python sessions is to start from the basics and beginner level and discuss how we can use Python to perform various calculations, simulations and automations related to Telecom technologies like 4G, LTE, VoLTE and 5G.

This is the first session of the series and it starts with a basic Python code that takes input from the user. Then it explains how multiple different operations can be performed on this input. Thus, the audience will be able to create interactive applications or programs based on this session.

Practical Python Use Cases (Session 1): How To Create Basic 5G Interactive Tools

One of the most popular question is that what will be my speed on 5G?

So, this video also shows our 5G Throughput Calculation Tool (5GTCal) as well in order to provide a feel of the 5G throughput and its relation with different factors.

The simplest way to estimate 5G Throughput is to calculate the maximum data rate carried by a single Resource Block into one slot.

For instance, on the right, we have a 30KHz example. In this case:

Number of Subcarriers = 12

Number of Symbols = 14

Symbols for Data = 11 (2 for DMRS and 1 for PDCCH)

Total Data Resource Elements = 12 x 11 = 132

Maximum Bits per Symbol = 7.4063 (256QAM)

Data carried in this Resource Block over one slot = 132 x 7.4063 = 977 Bits in 0.5ms

Now, lets say that the 5G Bandwidth is 100MHz

Number of Resource Blocks in 100MHz = 100,000KHz / 360KHz = 277 (273 are used, 4 RBs are used as guard)

Total Number of Slots available in one second = 1000 ms / 0.5ms = 2000 slots

Downlink Slots = 1600 (if DL/UL Ratio is 4:1) or 1500 (if DL/UL Ratio is 3:1)

Maximum Number of MIMO layers = 4

5G Throughput = 977 bits x 273 RBs x 1600 slots x 4 layers /1024/1024 = 1627 Mbps

A slight overhead is introduced in special slots where the Downlink changes to Uplink i.e. Slot-4 shown below

The Slot-4 has some symbols used for Guard Period which is used by both transmitter and receiver sides to shift from Tx to Rx and vice versa

It also has some symbols for uplink control channels like Sounding Reference Signals or SRS

Hence, the Slot-4 has 7 symbols used for data in this example and if we incorporate that overhead in our calculation then the throughput will be slightly lower as shown by the 5G Throughput Calculator Tool

5G NR Throughput Estimation

Note: These special slots can have different configurations and thus, different ratio between DL/UL/GP symbols is possible

As a reference, I am putting the 5G frequency and time domain structure details as well. Like LTE, the 5G frequency domain structure is made up of Resource Elements (REs). 12 Res in frequency domain constitute a Resource Block (RB). However, in LTE the RB is 12 sub-carriers x 7 symbols while in NR the RB is 12 sub-carriers but there is no time limit. Secondly, as LTE SCS is 15kHz so LTE RB is always 180kHz in frequency domain (12×15) but the NR SCS is flexible so the NR RB bandwidth can also vary accordingly e.g. in case of 30kHz SCS, the NR RB will be 360kHz (30×12). This also means that in case of a 20MHz channel, the LTE will have 100 RBs but the NR will only have 50 RBs.

Python (Session 2): Practical 5G Throughput Simulation with Python

In the above video, we developed a basic 5G Interactive Throughput Calculator that takes some inputs from the user and generates the peak throughput for the given configuration. However, this approach cannot be used for general purposes as most of the users will be in different radio conditions and hence, they will get different throughput levels.

So, in this session, we convert that basic 5G Tool into a more practical version which will be able to provide throughput for 5G Users in various radio conditions. This means that we will add more input parameters including MCS (Modulation and Coding Scheme), CQI (Channel Quality Indicator) and BLER (Block Error Rate). Meanwhile, we will also increase our knowledge of Python as we will introduce the concept of Python Lists, improving the interaction by creating choice and learning about IF and IF-ELSE statements. So, do have a look as I have tried to cover both 5G and Python simultaneously!

The MCS and CQI tables discussed in the session are given below. You can copy them from here and use them in your own test code!
0.2344, 0.3770, 0.6016, 0.8770, 1.1758, 1.4766, 1.6953, 1.9141, 2.1602, 2.4063, 2.5703, 2.7305, 3.0293, 3.3223, 3.6094, 3.9023, 4.2129, 4.5234, 4.8164, 5.1152, 5.3320, 5.5547, 5.8906, 6.2266, 6.5703, 6.9141, 7.1602, 7.4063

0.1523 0.1523, 0.3770, 0.8770, 1.4766, 1.9141, 2.4063, 2.7305, 3.3223, 3.9023, 4.5234, 5.1152, 5.5547, 6.2266, 6.9141, 7.4063

In case you have any queries or want to connect with Ali Khalid, please feel free to drop a comment or follow him on LinkedIn. Also, if this has been helpful, then please subscribe to our Youtube channel – Our Technology Planet for more exciting stuff and videos.

The following two tabs change content below.

Ali Khalid

5G NR | VoLTE | LTE-A | Massive MIMO | NB-IoT | NDO Network Specialist at Ericsson, Australia
Ali Khalid is a Senior LTE/VoLTE RNPO, NB-IoT and 5G Solution Architect who has successfully led and delivered a number of projects in different regions across the globe including Pakistan, Bahrain, UAE, Qatar, Oman, KSA, Nigeria, Turkey, Poland and Japan. He is currently working in Strategic Competence Unit (SCU), a highly experienced global team at Ericsson, Australia. In case of any questions or feedback, please feel free to drop a comment below or connect with him on LinkedIn.

13 thoughts on “Practical Python Use Cases (Sessions 1 & 2): How To Create Basic 5G Interactive Tools”

  1. I thoroughly enjoyed reading this blog. The content is very well-written and informative. It is clear that the author put a lot of thought into creating this resource.

  2. Hi, Khalid,
    Could I know when different subcarriers spacing is used, how can it affect the throughput? Is the TB size become different? How can i know the Symbols for Data = 11 (2 for DMRS and 1 for PDCCH)? Is the symbols for data is related with DCI format?

Leave a Reply

Your email address will not be published. Required fields are marked *