5G NR Channel coding architecture: LDPC and Polar
The introduction of the fifth generation of mobile networks (5G NR) required a fundamental revision of physical data transmission technologies. One of the key innovations was the transition from the universal Turbo coding used in LTE to a hybrid architecture combining LDPC codes for user data and Polar codes for control information.
Channel coding ensures reliable digital communication by protecting transmitted data from errors caused by noise and interference. In the LTE standard, this task was solved using Turbo codes. However, the requirements of 5G — gigabit speeds (eMBB), ultra-low latency (URLLC), and mass device connectivity (mMTC) — revealed the limitations of Turbo codes: their high computational complexity and iterative nature became a bottleneck for bandwidth.
Standardization of 3GPP has led to the creation of a hybrid system: LDPC (Low-Density Parity-Check) codes for processing high-speed user data due to high parallelizability of decoding, and Polar codes for reliable delivery of short control messages, theoretically reaching channel capacity for small blocks.
This article provides a practical analysis of two functional models implemented in the Engee environment.:
-
DataChannel_LDPC_EncodingChain: encoding chain for user data (PDSCH/PUSCH channels)
-
ControlChannel_Polar_EncodingChain: encoding chain for control information (channels PDCCH/PUCCH, PBCH)
These models represent two complementary parts of the 5G NR architecture, demonstrating in practice a hybrid approach to channel coding. The research focuses on analyzing the architectural differences, processing parameters, and data flow characteristics of each technology. The following table summarizes the key differences between the studied chains, illustrating the logic of the hybrid approach in 5G NR:
| Parameter | LDPC chain | Polar chain |
|---|---|---|
| Code type | LDPC (Low-Density Parity-Check) | Polar codes |
| Purpose | User Data (eMBB) | Control Information (URLLC) |
| Block Size | Large (100+ bits) | Short (<200 bits) |
| Code rates | Wide range | Optimized for reliability |
| 5G channels NR | PDSCH, PUSCH | PDCCH, PUCCH, PBCH |
function run_model(name_model)
Path = (@__DIR__) * "/" * name_model * ".engee"
if name_model in [m.name for m in engee.get_all_models()]
model_output = engee.run((engee.open(name_model)), verbose=true)
else
model_output = engee.run((engee.load(Path, force=true)), verbose=true)
engee.close(name_model, force=true)
end
sleep(0.1)
return model_output
end
Model #1: DataChannel_LDPC_EncodingChain — High-speed data processing
Chain DataChannel_LDPC_EncodingChain It is designed for efficient processing of large amounts of user data (eMBB traffic) and is optimized to work with variable-size transport blocks.
Architecture and data processing:
The CRC block adds a checksum to the transport block to detect errors. The main parameter targetcoderate affects the size of the CRC. The block outputs the CRC data (CRCEn) and defines the index of the base LDPC graph (BGN=1 or 2), which is passed down the chain.
The CB-CRC block performs data segmentation into code blocks, since the LDPC encoder has a limit on the maximum size of the input block. Each code block gets its own CRC. The size and number of code blocks depend on the received BGN. A sequence of segmented blocks is formed at the output (SEG).
The LDPC Encoder block implements LDPC encoding using a sparse generating matrix corresponding to the selected base graph. Parameter targetcoderate defines the initial code rate. The key advantage is the possibility of highly parallel decoding.
The Rate Matching block adapts the encoded data to the available physical resources (Resource Elements). The methods of puncturing, repetition, or shortening are used. The block is configured with resource planning parameters (ncellid, nsizegrid, modulation), and targetcoderate sets the final target speed.
Output: Architecture DataChannel_LDPC_EncodingChain It is a pipeline focused on maximizing spectral efficiency and throughput when processing large amounts of data through segmentation, noise-tolerant encoding, and dynamic resource adaptation.
run_model("DataChannel_LDPC_EncodingChain") # Launching the model.
CRC_BGN = collect(simout["DataChannel_LDPC_EncodingChain/CRC.BGN"]).value[end]
CRC_CRCEn = collect(simout["DataChannel_LDPC_EncodingChain/CRC.CRCEn"]).value[end]
CB_CRC_GI = collect(simout["DataChannel_LDPC_EncodingChain/CB-CRC.GI"]).value[end]
LDPC_1 = collect(simout["DataChannel_LDPC_EncodingChain/LDPC.1"]).value[end]
CB_CRC_SEG = collect(simout["DataChannel_LDPC_EncodingChain/CB-CRC.SEG"]).value[end]
Rate_Matching_1 = collect(simout["DataChannel_LDPC_EncodingChain/Rate Matching.1"]).value[end]
Constant_1 = collect(simout["DataChannel_LDPC_EncodingChain/Constant.1"]).value[end];
The code below performs a comprehensive LDPC analysis of the 5G NR encoding chain. The methodology includes determining the basic LDPC graph, calculating the data dimension at each stage of processing, calculating segmentation parameters (number and size of code blocks), estimating the final code rate, and analyzing the density of units in the output signal.
To visualize the data transformation, a graph of the size evolution is constructed, which sequentially displays the change in the amount of information: from the initial input data through CRC encoding, segmentation, LDPC encoding to the final stage of Rate Matching.
This approach makes it possible to quantify data conversion in accordance with the 5G NR standard, analyze the effectiveness of each processing stage, and verify the correctness of the encoding chain implementation.
println("1. Basic LDPC Graph (BGN): $CRC_BGN")
println("2. Dimensions of the data:")
println(" Input data (Constant.1): $(length(Constant_1)) bit")
println(" After CRC encoding: $(size(CRC_CRCEn))")
println(" After segmentation (CB-CRC.SEG): $(size(CB_CRC_SEG))")
println(" After LDPC encoding: $(size(LDPC_1))")
println(" After Rate Matching: $(length(Rate_Matching_1)) bit")
println("3. Calculation of LDPC parameters:")
if ndims(CB_CRC_SEG) == 2
num_codeblocks = size(CB_CRC_SEG, 1)
cb_size = size(CB_CRC_SEG, 2)
println(" Number of code blocks: $num_codeblocks")
println(" Code block size: $cb_size bit")
println(" Total size after segmentation: $(num_codeblocks * cb_size) bits")
end
if ndims(LDPC_1) == 2
ldpc_rows = size(LDPC_1, 1)
ldpc_cols = size(LDPC_1, 2)
println(" LDPC output: $ldpc_rows rows × $ldpc_cols columns")
println(" Total LDPC size: $(ldpc_rows * ldpc_cols) bits")
end
ldpc_final_rate = length(Constant_1) / length(Rate_Matching_1)
println(" Final code rate: $(round(ldpc_final_rate, digits=3))")
if typeof(Rate_Matching_1) <: AbstractVector{Int8}
rm1_int = Int64.(Rate_Matching_1)
ldpc_ones_density = sum(rm1_int) / length(Rate_Matching_1) * 100
println(" Unit density: $(round(ldpc_ones_density, digits=1))%")
end
ldpc_sizes = [
length(Constant_1),
size(CRC_CRCEn, 2),
size(CB_CRC_SEG, 1) * size(CB_CRC_SEG, 2),
size(LDPC_1, 1) * size(LDPC_1, 2),
length(Rate_Matching_1)
]
ldpc_stages = ["Input data", "After \nCRC", "After \psegmentation", "After \nLDPC", "After \nRate\nMatching"]
p1 = plot(ldpc_sizes,
marker=:circle,
linewidth=2,
label="LDPC chain",
xlabel="Processing stage",
ylabel="Number of bits",
title="The Evolution of Data Size (LDPC)",
xticks=(1:length(ldpc_stages), ldpc_stages),
legend=:topleft,
grid=true,
size=(800, 400))
Model #2: ControlChannel_Polar_EncodingChain — Delivery of critical commands
Chain ControlChannel_Polar_EncodingChain It is designed for ultra-reliable delivery of short control messages critical for the operation of a communication session (for example, grants for resource allocation, ACK/NACK receipts).
Architecture and data processing:
The CRC block adds a checksum to the control message (DCI). As in the LDPC chain, the size of the CRC may vary depending on the specific implementation.
The Polar Encoder block implements Arikan coding based on the concept of "polarization" of channels. During the encoding process, some of the channels become highly reliable, while the other part becomes completely noisy. The information bits along with the CRC are placed in the most reliable positions. Parameter output_length specifies the length of the polar code after encoding (N). A vector of encoded bits is generated at the output (ENC) and the parameter ML, which probably contains information about the length of the original message (K) or a pattern of reliable channels for subsequent processing.
The Rate Matching Polar block adapts the encoded data to the available physical resources (CORESET), taking into account the features of the polar code structure. As in the case of LDPC, methods of puncturing, repeating, or shortening are used, but with additional limitations to preserve the reliability of the code. Parameter output_length determines the final block size after approval.
Output: Architecture ControlChannel_Polar_EncodingChain It is focused on providing extreme reliability (Ultra-Reliable) with minimal latency for short control units. The lack of segmentation simplifies the chain structure, but the mathematical basis of Polar coding is more complex and aims to achieve the theoretical limit of noise immunity, which is critical for control messages in 5G NR networks.
run_model("ControlChannel_Polar_EncodingChain") # Launching the model.
Rate_Matching_Polar_1 = collect(simout["ControlChannel_Polar_EncodingChain/Rate Matching Polar.1"]).value[end]
CRC_CRCEn_control = collect(simout["ControlChannel_Polar_EncodingChain/CRC.CRCEn"]).value[end]
Polar_Encoding_ML = collect(simout["ControlChannel_Polar_EncodingChain/Polar Encoding.ML"]).value[end]
Constant_1_control = collect(simout["ControlChannel_Polar_EncodingChain/Constant.1"]).value[end]
Polar_Encoding_ENC = collect(simout["ControlChannel_Polar_EncodingChain/Polar Encoding.ENC"]).value[end];
The code below performs a comprehensive analysis of the Polar encoding chain of 5G NR. The technique includes determining the ML parameter and the length of the ENC vector, analyzing the dimension of the data at various stages of processing — from the initial input through CRC encoding and Polar encoding to the final Rate Matching. The final code rate and unit density in the output signal are calculated.
To visualize the transformation of data, a graph of the size evolution is constructed, which consistently displays the change in the amount of information through all stages of Polar coding processing. This approach makes it possible to quantify the efficiency of processing short control messages and verify that the implementation meets the requirements of the 5G NR standard.
println("1. Polar Encoding Parameters:")
println(" ML parameter: $Polar_Encoding_ML")
println(" Length of the ENC vector: $(length(Polar_Encoding_ENC))")
println("2. Dimensions of the data:")
println(" Input data: $(length(Constant_1_control)) bit")
println(" After CRC encoding: $(size(CRC_CRCEn_control))")
println(" After Polar encoding: $(length(Polar_Encoding_ENC)) bit")
println(" After Rate Matching: $(length(Rate_Matching_Polar_1)) bit")
polar_final_rate = length(Constant_1_control) / length(Rate_Matching_Polar_1)
println("3. Calculation of Polar parameters:")
println(" Final code rate: $(round(polar_final_rate, digits=3))")
if typeof(Rate_Matching_Polar_1) <: AbstractVector{Int64}
polar_ones_density = sum(Rate_Matching_Polar_1) / length(Rate_Matching_Polar_1) * 100
println(" Unit density: $(round(polar_ones_density, digits=1))%")
end
polar_sizes = [
length(Constant_1_control),
size(CRC_CRCEn_control, 2),
length(Polar_Encoding_ENC),
length(Rate_Matching_Polar_1)
]
polar_stages = ["Input data", "After \nCRC", "After \nPolar", "After \nRate\nMatching"]
p2 = plot(polar_sizes,
marker=:square,
linewidth=2,
label="Polar chain",
xlabel="Processing stage",
ylabel="Number of bits",
title="The Evolution of Data Size (Polar)",
xticks=(1:length(polar_stages), polar_stages),
legend=:topleft,
grid=true,
color=:red,
size=(800, 400))
display(p2)
The presented code performs a comparative analysis of LDPC and Polar coding chains of 5G NR. The methodology includes the calculation of key metrics: redundancy, unit density, and code rates for both technologies. The results are structured into a comparison table using the DataFrames library, which presents comparable chain parameters, including input and output data sizes, encoding characteristics, and key conclusions.
To visually visualize the differences, two comparative graphs are constructed: a histogram of code rates, demonstrating data transfer efficiency strategies, and a redundancy histogram, showing the degree of error protection for each technology.
This approach makes it possible to comprehensively analyze the specialization of LDPC and Polar codes within the framework of the 5G NR hybrid architecture, evaluate their complementary characteristics and confirm the validity of the separation of functions between user data and control information in modern communication networks.
using DataFrames
ldpc_redundancy = (length(Rate_Matching_1) - length(Constant_1)) / length(Constant_1) * 100
polar_redundancy = (length(Rate_Matching_Polar_1) - length(Constant_1_control)) / length(Constant_1_control) * 100
ldpc_ones_density = typeof(Rate_Matching_1) <: AbstractVector{Int8} ? round(sum(Int64.(Rate_Matching_1))/length(Rate_Matching_1)*100, digits=1) : 0
polar_ones_density = typeof(Rate_Matching_Polar_1) <: AbstractVector{Int64} ? round(sum(Rate_Matching_Polar_1)/length(Rate_Matching_Polar_1)*100, digits=1) : 0
comparison_df = DataFrame(
Параметр = ["The size of the input data",
"Size of the output data",
"Code rate",
"Redundancy",
"Unit density",
"Basic graph/ML"],
LDPC = ["$(length(Constant_1)) bit",
"$(length(Rate_Matching_1)) bit",
"$(round(ldpc_final_rate, digits=3))",
"$(round(ldpc_redundancy, digits=1))%",
"$ldpc_ones_density%",
"BGN=$(CRC_BGN)"],
Polar = ["$(length(Constant_1_control)) bit",
"$(length(Rate_Matching_Polar_1)) bit",
"$(round(polar_final_rate, digits=3))",
"$(round(polar_redundancy, digits=1))%",
"$polar_ones_density%",
"ML=$(Polar_Encoding_ML)"],
Вывод = ["LDPC for big data",
"Scaling",
"Different strategies",
"LDPC is more redundant",
"Balancing the power",
"Different encoding parameters"]
)
show(comparison_df, allrows=true, allcols=true)
p3 = bar(["LDPC", "Polar"],
[ldpc_final_rate, polar_final_rate],
label="",
ylabel="Code rate",
title="Code rate comparison",
color=[:blue :red],
alpha=0.7,
legend=false,
grid=true,
size=(600, 400))
hline!([1/2], linestyle=:dash, color=:gray, label="Target 1/2")
p4 = bar(["LDPC", "Polar"],
[ldpc_redundancy, polar_redundancy],
label="",
ylabel="Redundancy (%)",
title="Coding Redundancy Comparison",
color=[:blue :red],
alpha=0.7,
legend=false,
grid=true,
size=(600, 400))
display(plot(p3, p4, layout=(1, 2), size=(1200, 400)))
Coding Chain Analysis DataChannel_LDPC_EncodingChain and ControlChannel_Polar_EncodingChain confirms the specialization of technologies in the hybrid architecture of 5G NR.
LDPC chain processes 176 bits using base graph 2 (for small blocks), providing high redundancy (772.7%) and low code rate (0.115), which is focused on noise immunity of user data.
Polar chain processes 122 bits with moderate redundancy (109.8%) and higher code rate (0.477), providing a balance of efficiency and reliability for control messages.
Conclusions:
-
LDPC codes with data segmentation are optimal for user traffic (PDSCH/PUSCH)
-
Polar codes with efficient coding are designed for control information (PDCCH/PUCCH)
-
Different redundancy and code rate strategies meet different eMBB and URLLC scenario requirements
The results demonstrate the practical implementation of a hybrid approach, where each technology solves specific tasks, ensuring the overall efficiency of the 5G NR communication system.
Conclusion
The analysis of channel coding chains in the Engee environment confirmed the effectiveness of the hybrid approach adopted in the 5G standard NR. LDPC codes, demonstrating high redundancy and optimized segmentation, proved their suitability for processing user data with an emphasis on noise immunity and spectral efficiency. Polar codes, in turn, have shown a balanced combination of code speed and reliability, making them the optimal solution for delivering mission-critical control information.
Practical implementation of models DataChannel_LDPC_EncodingChain and ControlChannel_Polar_EncodingChain It allowed not only to verify the compliance of theoretical principles with engineering solutions, but also to quantify the key parameters of both technologies. The results obtained — various redundancy strategies, code rates, and data processing methods — clearly illustrate the logic of separating functions between user traffic and control messages in modern communication networks.
The study confirms that the hybrid architecture of 5G NR channel coding is a technically sound compromise that ensures simultaneous fulfillment of heterogeneous requirements for speed, reliability and latency in modern wireless systems.