Main Content

nrBCH

Broadcast channel (BCH) encoding

Description

example

cdblk = nrBCH(trblk,sfn,hrf,lssb,idxoffset,ncellid) encodes BCH transport block trblk, as defined in TS 38.212, Section 7.1 [1], and returns the encoded BCH transport block. The function takes these additional input arguments:

  • sfn, the system frame number

  • hrf, the half frame bit in synchronization signal / physical broadcast channel (SS/PBCH) block transmissions

  • lssb, the number of candidate SS/PBCH blocks in a half frame

  • idxoffset, the subcarrier offset or the SS block index, depending on the input value of lssb

  • ncellid, the physical layer cell identity number

Examples

collapse all

Generate a random sequence of binary values corresponding to a BCH transport block of 24 bits.

trblk = randi([0 1],24,1,'int8');  

Specify the physical layer cell identity number as 321, the system frame number as 10, and the second half frame.

nid = 321;  
sfn = 10;   
hrf = 1;     

Specify the number of candidate SS/PBCH blocks as 8. When you specify the number of candidate SS/PBCH blocks as 4 or 8, you can specify the subcarrier offset kssb as an input argument to the BCH encoder.

lssb = 8;                     
kssb = 18;               

Encode the BCH transport block using the specified arguments.

cdblk = nrBCH(trblk,sfn,hrf,lssb,kssb,nid);

When you specify the number of candidate SS/PBCH blocks as 64, you can specify the SS block index ssbIdx as an input argument instead of the subcarrier offset kssb.

lssb = 64;                     
ssbIdx = 13;               

Encode the BCH transport block with the updated input arguments.

cdblk2 = nrBCH(trblk,sfn,hrf,lssb,ssbIdx,nid);

Input Arguments

collapse all

BCH transport block, specified as a 24-by-1 binary column vector. The input trblk is the BCCH-BCH-Message, as defined in TS 38.331 Section 6.2.1 [2]. The BCCH-BCH-Message contains the master information block (MIB), as defined in TS 38.331 Section 6.2.2.

Data Types: double | int8

System frame number, specified as a nonnegative integer.

Data Types: double

Half frame bit in SS/PBCH block transmissions, specified as 0 for the first half of a frame or 1 for the second half of a frame. For more information, see TS 38.214 Section 4.1 [3].

Data Types: double

Number of candidate SS/PBCH blocks in a half frame, specified as 4, 8, or 64.

Data Types: double

Subcarrier offset or SS block index, specified as a nonnegative integer.

  • If lssb is 4 or 8, idxoffset specifies the subcarrier offset, which must be an integer from 0 to 31.

  • If lssb is 64, idxoffset specifies the SS block index, which must be an integer from 0 to 63.

Data Types: double

Physical layer cell identity number, specified as an integer from 0 to 1007.

Data Types: double

Output Arguments

collapse all

Encoded BCH transport block, returned as an 864-by-1 binary column vector. cdblk inherits the data type of the input trblk.

Data Types: double | int8

References

[1] 3GPP TS 38.212. “NR; Multiplexing and channel coding.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[2] 3GPP TS 38.331. “NR; Radio Resource Control (RRC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[3] 3GPP TS 38.214. “NR; Physical layer procedures for data.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2018b

See Also

Functions