function [b__] = scrambling_ul(e, uSchVec, umodBit, c_init)

% vypocet volneho mista
N = ceil(length(e)/umodBit);
fRB0 = 12*7*2 - 2*12; % pouze uzivatel


I = 0;
while (N>0)
    N = N - sum(uSchVec)*fRB0;
    I = I+2;
end
dC = zeros(1,I/2);
% pocty symbolu
for i = 1:I/2,
    dC(i) = sum(uSchVec)*fRB0;
end

index = 0;
for i2 = 1:length(dC),
    c = scramblingCode(dC(i2)*umodBit, c_init +(i2-1)*2^9);
    b_ = zeros(dC(i2)*umodBit,1);
    for i = 1:dC(i2)*umodBit,
        if(index+i-1 == length(e)),
            b_ = b_(1:i-1);
            break;
        else
            b_(i) = mod(c(i)+e(i+index),2);
        end
    end
    b__(index+1:index+length(b_)) = b_;
    index = index + dC(i2)*umodBit;
end