Matlab Toolbox - 5G/NR

 

 

 

 

PUCCH Format 0 

 

NOTE :  It is required to have Matlab 5G Toolbox  to run this script. Matlab Version that I used for this page is 2019a v9.6, 5G Toolbox v1.1

 

 

 

Ack Bit Variation

 

SR Bit Variation

 

 

InitialCS Variation

 

 

Grouphopping Variation

 

 

 

Number of Symbol Variation

 

 

 

 

Source Code

 

5G_PUCCH_Format1.m

ack = [0;1];

sr = 1;

symAllocation = [10 4];

nslot = 0;

nid = 0;

initialCS = 0;

cp = 'normal';

freqHopping = 'disabled';

groupHopping = 'disable';

occi = 0;

sym = nrPUCCH1(ack,sr,symAllocation,cp,nslot,nid,groupHopping,initialCS,freqHopping,occi)

 

h = figure(1);

 

subplot(2,2,1);

stem(real(sym),'ro','MarkerFaceColor',[1 0 0]);

ylabel('real');

 

subplot(2,2,3);

stem(imag(sym),'bo','MarkerFaceColor',[0 0 1]);

ylabel('imaginary');

 

subplot(2,2,[2 4]);

plot(real(sym),imag(sym),'ro','MarkerFaceColor',[1 0 0]);

axis([-1 1 -1 1]);

titleText = sprintf('%d ',reshape(ack.',1,[]));

titleText = sprintf('ack = [ %s], sr = %d',titleText, sr);

titleText = sprintf('%s nid = %d, iCS = %d, sym =[%d %d]',titleText,nid,initialCS,symAllocation(1),symAllocation(2));

titleText = sprintf('%s \nfHop = %s, gHop = %s, occi = %d',titleText,freqHopping,groupHopping,occi);

title(titleText);

pbaspect([1 1 1]);

 

set(h,'Position',[400 200 800 350]);

set(h, 'MenuBar', 'None')