LoRaWAN
®
Fragmented Data Block Transport
Specification TS004-2.0.0
©2022 LoRa Alliance
®
Page 32 of 32
The authors reserve the right to change
specifications without notice.
m=0; 859
end 860
861
862
x= 1+1001*N; %initialize the seed differently for each line 863
nb_coeff=0; 864
while (nb_coeff=M) %this can happen if m=1, in that case just try again with a 867
different random number 868
x=prbs23(x); 869
r=mod(x, M+m); %bit number r of the current line will be switched to 1 870
end 871
if (matrix_line(r+1) == 0) 872
matrix_line(r+1) = 1; %set to 1 the column which was randomly selected 873
nb_coeff = nb_coeff + 1; 874
end 875
end 876
877
The prbs23() function implements a PRBS generator with (2^23)-1 period: 878
%standard implementation of a 23bit prbs generator 879
function r=prbs23(start) 880
x= start; 881
b0 = bitand(x,1); 882
b1 = bitand(x,32)/32; 883
x = floor(x/2) + bitxor(b0,b1)*2^22; 884
r=x; 885
886
887