function [b__] = scrambling_dl(e, dSchVec, dmodBit, c_init)

% vypocet volneho mista
N = ceil(length(e)/dmodBit);
% volne misto - RS - PSS,SSS; pocitano na RB x subramec
fRB0 = 12*7*2 - 8 - 2*12;
fRB1 = 12*7*2 - 8;
I = 0;
while (N>0)
    if(mod(I,10) == 0),
        N = N - sum(dSchVec)*fRB0;
    else
        N = N - sum(dSchVec)*fRB1;
    end
    I = I+2;
end
dC = zeros(1,I/2);
% pocty symbolu
for i = 1:I/2,
    if(mod(i-1,5) == 0),
        dC(i) = sum(dSchVec)*fRB0;
    else
        dC(i) = sum(dSchVec)*fRB1;
    end
end

index = 0;
for i2 = 1:length(dC),
    c = scramblingCode(dC(i2)*dmodBit, c_init +(i2-1)*2^9);
    b_ = zeros(dC(i2)*dmodBit,1);
    for i = 1:dC(i2)*dmodBit,
        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)*dmodBit;
end