%% Generate Physical Broadcast Channel Symbols
% Consider the first Synchronization Signal / Physical Broadcast Channel (SS/PBCH) block in a burst and assume that the number of SS/PBCH blocks per half-frame is 4.

ssbindex = 0;
v = mod(ssbindex,4);   

% Generate a random sequence of binary values that represent encoded BCH bits. The length of the random sequence corresponds to the PBCH bit capacity as specified in TS 38.212 Section 7.1.5.

E = 864;               
cw = randi([0 1],E,1);

% Generate the sequence of 432 PBCH quadrature phase shift keying (QPSK) modulation symbols.

ncellid = 17;
sym = nrPBCH(cw,ncellid,v);

% Copyright 2019 The MathWorks, Inc.