% konstelace
    function [] = fce_konstelace(j);
    
    if j==17
        for i=1:4
            j=i-1;
            if (j==0)
                xc(i) = 0.14142;    
                yc(i) = 0.14142;  
            elseif (j==1)
                xc(i) = -0.14142;  
                yc(i) = 0.14142; 
            elseif (j==2)
                xc(i) = -0.14142;  
                yc(i) = -0.14142;  
            elseif (j==3)
                xc(i) = 0.14142;  
                yc(i) = -0.14142;  
            end;

            osax=[0,xc(i)];
            osay=[0,yc(i)];
            xlim([-0.2 0.2]) 
            ylim([-0.2 0.2]) 
            graf=plot(osax,osay);
            set(graf,'LineWidth',1,'Color','Blue','LineStyle','-')
            hold on
            graf1=stem(xc,yc);
            set(graf1,'LineWidth',2,'Color','Blue','MarkerSize',20,'LineStyle','none')

            hold on

            if j==0
                text(xc(i)-0.04,yc(i)+0.02,'   0','FontWeight','Bold')
            elseif j==1 
                text(xc(i)-0.04,yc(i)+0.02,'   1','FontWeight','Bold')
            elseif j==2
                text(xc(i)-0.04,yc(i)+0.02,'   2','FontWeight','Bold')
            elseif j==3
                text(xc(i)-0.04,yc(i)+0.02,'   3','FontWeight','Bold')
            end; 


        end;

        xlabel('x soufázová modulacní slozka')
        ylabel('y kvadraturní modulacni slozka ') 
        grid on
        title('Konstelacní diagram (IQ diagram)')
    
    else  
            if (j==0)
                xc = 0.14142;    
                yc = 0.14142;  
            elseif (j==1)
                xc = -0.14142;  
                yc = 0.14142; 
            elseif (j==2)
                xc = -0.14142;  
                yc = -0.14142;  
            elseif (j==3)
                xc = 0.14142;  
                yc = -0.14142;  
            end;

        osax=[0,xc];
        osay=[0,yc];
        graf=plot(osax,osay);
        set(graf,'LineWidth',1,'Color','Red','LineStyle','-')
        hold on
        graf1=stem(xc,yc);
        set(graf1,'LineWidth',2,'Color','Red','MarkerSize',20,'LineStyle','none')



    end