LoRaWAN Fragmented Data Block
Transport v1.0.0 Specification
©2018 LoRa Alliance™ Page 27 of 30
The authors reserve the right to change
specifications without notice.
m=1; 679
else 680
m=0; 681
end 682
683
684
x= 1+1001*N; %initialize the seed differently for each line 685
nb_coeff=0; 686
while (nb_coeff=M) %this can happen if m=1, in that case just try again with a 689
different random number 690
x=prbs23(x); 691
r=mod(x, M+m); %bit number r of the current line will be switched to 1 692
end 693
694
matrix_line(r+1) = 1; %set to 1 the column which was randomly selected 695
nb_coeff = nb_coeff + 1; 696
end 697
698
699
700
The prbs23() function implements a PRBS generator with 2^23 period. 701
%standard implementation of a 23bit prbs generator 702
function r=prbs23(start) 703
x= start; 704
b0 = bitand(x,1); 705
b1 = bitand(x,32)/32; 706
x = floor(x/2) + bitxor(b0,b1)*2^22; 707
r=x; 708
709