当前位置:网站首页>UCI and data multiplexing are transmitted on Pusch (Part VI) -- LDPC coding
UCI and data multiplexing are transmitted on Pusch (Part VI) -- LDPC coding
2022-07-03 09:40:00 【Communication pawn】
ldpc The coding is for the coding of uplink and downlink data , It's also 5G The most important kind of coding .
1 TB Block add CRC
This is and UCI POLAR One difference ,UCI Yes for each. cb Block add crc.
% Get transport block size after CRC attachment according to 38.212
% 6.2.1 and 7.2.1, and assign CRC polynomial to CRC field of output
% structure info
if A > 3824
L = 24;
info.CRC = '24A';
else
L = 16;
info.CRC = '16';
end
** This will be true of TB Block on crc The addition of , Add crc The process has been in the last article
《UCI And data reuse in pusch Up transfer ( The fifth part )---polar code 》 Shared ,
There is no retelling here .**
2 graph choice

% LDPC base graph selection
if A <= 292 || (A <= 3824 && R <= 0.67) || R <= 0.25
bgn = 2;
else
bgn = 1;
end
3 cb Block segmentation and cb Block add crc






Add crc The process has been in the last article
《UCI And data reuse in pusch Up transfer ( The fifth part )—polar code 》 Shared ,
There is no retelling here .
% Get the maximum code block size
if bgn == 1
Kcb = 8448;
else
Kcb = 3840;
end
% Get number of code blocks and length of CB-CRC coded block
if B <= Kcb
L = 0;
C = 1;
Bd = B;
else
L = 24; % Length of the CRC bits attached to each code block
C = ceil(B/(Kcb-L));
Bd = B+C*L;
end
% Obtain the number of bits per code block (excluding CB-CRC bits)
cbz = ceil(B/C);
% Get number of bits in each code block (excluding filler bits)
Kd = ceil(Bd/C);
% Find the minimum value of Z in all sets of lifting sizes in 38.212
% Table 5.3.2-1, denoted as Zc, such that Kb*Zc>=Kd
if bgn == 1
Kb = 22;
else
if B > 640
Kb = 10;
elseif B > 560
Kb = 9;
elseif B > 192
Kb = 8;
else
Kb = 6;
end
end
Zlist = [2:16 18:2:32 36:4:64 72:8:128 144:16:256 288:32:384];
Zc = min(Zlist(Kb*Zlist >= Kd));
% Get number of bits (including <NULL> filler bits) to be input to the LDPC
% encoder
if bgn == 1
K = 22*Zc; % Why must this be Zc Multiple , This is a problem ?
else
K = 10*Zc;
end
4 UL_SCH Channel code of ( This is the most difficult part of coding, which needs to be further clarified )





% Get lifting set number
ZSets = {
[2 4 8 16 32 64 128 256],... % Set 1
[3 6 12 24 48 96 192 384],... % Set 2
[5 10 20 40 80 160 320],... % Set 3
[7 14 28 56 112 224],... % Set 4
[9 18 36 72 144 288],... % Set 5
[11 22 44 88 176 352],... % Set 6
[13 26 52 104 208],... % Set 7
[15 30 60 120 240]}; % Set 8
for setIdx = 1:8 % LDPC lifting size set index
if any(Zc==ZSets{
setIdx})
break;
end
end
% Pre-stored H types for each BGN and setIdx pair
% How did this come from? I don't know , Need to take a further look
Htype = {
3, 3, 3, 3, 3, 3, 2, 3;
4, 4, 4, 1, 4, 4, 4, 1};
% Get the matrix with base graph number 'bgn' and set number 'setIdx'.
% The element of matrix V in the following is H_BG(i,j)*V(i,j), where
% H_BG(i,j) and V(i,j) are defined in TS 38.212 5.3.2; if V(i,j) is not
% defined in Table 5.3.2-2 or Table 5.3.2-3, the elements are -1.
% % This is in the agreement v_ij
switch bgn
case 1
switch setIdx
case 1
V = bgs.BG1S1;
case 2
V = bgs.BG1S2;
case 3
V = bgs.BG1S3;
case 4
V = bgs.BG1S4;
case 5
V = bgs.BG1S5;
case 6
V = bgs.BG1S6;
case 7
V = bgs.BG1S7;
otherwise % 8
V = bgs.BG1S8;
end
Nplus2Zc = Zc*(66+2);
otherwise % bgn = 2
switch setIdx
case 1
V = bgs.BG2S1;
case 2
V = bgs.BG2S2;
case 3
V = bgs.BG2S3;
case 4
V = bgs.BG2S4;
case 5
V = bgs.BG2S5;
case 6
V = bgs.BG2S6;
case 7
V = bgs.BG2S7;
otherwise % 8
V = bgs.BG2S8;
end
Nplus2Zc = Zc*(50+2);% Why ask this and ?
end
P = nr5g.internal.ldpc.calcShiftValues(V,Zc);% according to V and Zc obtain P P=mod(V,Zc)
% The element of matrix P in the following is P(i,j) in TS 38.212 5.3.2
% when V(i,j) are defined in Table 5.3.2-2 or Table 5.3.2-3. If not
% defined, the elements are -1.
P = zeros(size(V));
for i = 1:size(V,1)
for j = 1:size(V,2)
if V(i,j) == -1
P(i,j) = -1;
else
P(i,j) = mod(V(i,j),Z);
end
end
end
P1 = P(:,1:(size(P,2) - size(P,1)));% Take it P In front of (52-42) perhaps (67-45) That's ok , Why take this ?
C = size(infoBits,2); % Get layers
codewords = zeros(Nplus2Zc,C);
% Get shift values matrix
P = nr5g.internal.ldpc.calcShiftValues(V,Zc);
P1 = P(:,1:(size(P,2) - size(P,1)));
C = size(infoBits,2);
codewords = zeros(Nplus2Zc,C);
for r = 1:C
% Per code-block processing only
infoVec = reshape(infoBits(:,r),Zc,[]);% The information bit( In the agreement C_k) become Zc That's ok ,K/Zc Column .
d = blockMultiply(P1,infoVec);
d0 = d(:,1:4);
% Solve 4 equations for Htype * m = d0
switch Htype{
bgn,setIdx}
case 1
% H1 = [ 1 0 -1 -1;
% -1 0 0 -1;
% 0 -1 0 0;
% 1 -1 -1 0 ];
m1 = sum(d0, 2);
m2 = d0(:,1) + m1([2:end 1]);
m3 = d0(:,2) + m2;
m4 = d0(:,3) + m1 + m3;
case 2
% H2 = [ 0 0 -1 -1;
% 105 0 0 -1;
% -1 -1 0 0;
% 0 -1 -1 0 ];
m1 = sum(d0, 2);
shift = mod(105, Zc);
if shift > 0
m1 = m1([(end-shift+1):end 1:(end-shift)]);
end
m2 = d0(:,1) + m1;
m4 = d0(:,4) + m1;
m3 = d0(:,3) + m4;
case 3
% H3 = [ 1 0 -1 -1;
% 0 0 0 -1;
% -1 -1 0 0;
% 1 -1 -1 0 ];
m1 = sum(d0, 2);
m2 = d0(:,1) + m1([2:end 1]);
m3 = d0(:,2) + m1 + m2;
m4 = d0(:,3) + m3;
otherwise % == 4
% H4 = [ 0 0 -1 -1;
% -1 0 0 -1;
% 1 -1 0 0;
% 0 -1 -1 0 ];
m1 = sum(d0, 2);
m1 = m1([end 1:(end-1)]);
m2 = d0(:,1) + m1;
m3 = d0(:,2) + m2;
m4 = d0(:,4) + m1;
end
% Get other parity bits
P3 = P(5:end,size(P1,2)+(1:4));
p = blockMultiply(P3, [m1 m2 m3 m4]) + d(:,5:end);
% Form codeword and assign to output
codewords(:,r) = [infoBits(:,r); mod([m1; m2; m3; m4; p(:)],2)];
end
end
5 Rate matching






% Get code block soft buffer size
if ~isempty(Nref)
fcnName = 'nrRateMatchLDPC';
validateattributes(Nref, {
'numeric'}, ...
{
'scalar','integer','positive'},fcnName,'NREF');
Ncb = min(N,Nref);
else % No limit on buffer size
Ncb = N;
end
% Get starting position in circular buffer
if bgn == 1
if rv == 0
k0 = 0;
elseif rv == 1
k0 = floor(17*Ncb/N)*Zc;
elseif rv == 2
k0 = floor(33*Ncb/N)*Zc;
else % rv is equal to 3
k0 = floor(56*Ncb/N)*Zc;
end
else
if rv == 0
k0 = 0;
elseif rv == 1
k0 = floor(13*Ncb/N)*Zc;
elseif rv == 2
k0 = floor(25*Ncb/N)*Zc;
else % rv is equal to 3
k0 = floor(43*Ncb/N)*Zc;
end
end
% Get rate matching output for all scheduled code blocks and perform
% code block concatenation according to Section 5.4.2 and 5.5
out = [];
for r = 0:C-1
if r <= C-mod(outlen/(nlayers*Qm),C)-1
E = nlayers*Qm*floor(outlen/(nlayers*Qm*C));
else
E = nlayers*Qm*ceil(outlen/(nlayers*Qm*C));
end
out = [out; cbsRateMatch(in(:,r+1),E,k0,Ncb,Qm)]; %#ok<AGROW>
end
end
function e = cbsRateMatch(d,E,k0,Ncb,Qm)
% Rate match a single code block segment as per TS 38.212 Section 5.4.2
% Bit selection, Section 5.4.2.1
k = 0;
j = 0;
e = zeros(E,1,class(d));
while k < E
if d(mod(k0+j,Ncb)+1) ~= -1 % Filler bits
e(k+1) = d(mod(k0+j,Ncb)+1);
k = k+1;
end
j = j+1;
end
% Bit interleaving, Section 5.4.2.2
e = reshape(e,E/Qm,Qm);
e = e.';
e = e(:);
end
边栏推荐
- CATIA automation object architecture - detailed explanation of application objects (III) systemservice
- Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 2 --blinker_ Hello_ WiFi (lighting technology - Mobile App control routine)
- Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 5 --blinker_ MIOT_ MULTI_ Outside (lighting technology app + Xiaoai classmate control socket multiple jacks)
- Flink-CDC实践(含实操步骤与截图)
- UCI and data multiplexing are transmitted on Pusch - determine the bit number of harqack, csi1 and csi2 (Part II)
- [solution to the new version of Flink without bat startup file]
- Epollet lessons
- Development of fire evacuation system
- 软件测试工程师是做什么的 通过技术测试软件程序中是否有漏洞
- Modify idea code
猜你喜欢

Leetcode daily question (931. minimum falling path sum)

About the configuration of vs2008+rade CATIA v5r22

Error output redirection

Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 3 --blinker_ MIOT_ Light (lighting technology app control + Xiaoai classmate control)

Development of fire evacuation system

Solve editor MD uploads pictures and cannot get the picture address

一款开源的Markdown转富文本编辑器的实现原理剖析

Trial of the combination of RDS and crawler
![[graduation successful] [1] - tour [Student Management Information System]](/img/91/72cdea3eb3f61315595330d2c9016d.png)
[graduation successful] [1] - tour [Student Management Information System]
![顺利毕业[2]-学生健康管理系统 功能开发中。。。](/img/91/72cdea3eb3f61315595330d2c9016d.png)
顺利毕业[2]-学生健康管理系统 功能开发中。。。
随机推荐
[solution to the new version of Flink without bat startup file]
Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 4 --blinker_ DHT_ WiFi (lighting technology app control + temperature and humidity data app display)
Quickly use markdown to edit articles
Analysis of the implementation principle of an open source markdown to rich text editor
Leetcode daily question (1024. video sticking)
Jestson nano downloads updated kernel and DTB from TFTP server
PolyWorks script development learning notes (I) - script development environment
UCI and data multiplexing are transmitted on Pusch (Part V) -- polar coding
The cyclic shift of PUCCH in NR channel is generated by MATLAB
Long类型的相等判断
Definition and use of enum in C language
Leetcode daily question (931. minimum falling path sum)
Usage of pandas to obtain MySQL data
Patent inquiry website
LeetCode每日一题(985. Sum of Even Numbers After Queries)
Intelligent home design and development
QT qstring:: number apply base conversion
[csdn] C1 analyse des questions de formation Partie III Bar _ JS Foundation
MySQL environment variable configuration
【22毕业季】我是毕业生yo~