The Scrambler
A scrambler is a software or hardware device (algorithm) that performs scrambling, that is, the reversible transformation of a digital stream without changing the transmission rate in order to obtain the properties of a random sequence.
This example implements scrambling with a "Pseudo Random Binary Sequence" (PRBS). This sequence is calculated due to the LFSR of length 15, given by the associated polynomial 1+ x14+x15 and the initial value 100101010000000. Also below is a picture describing the formula for the operation of a pseudorandom sequence generator.
Next, let's look at the implemented scrambling and descrambling scheme. It and a bitwise comparison of the operation of this algorithm are shown in the figure below.
Let's run this model using the startup function we described and save the results of the bit error.
function run_model(name_model)
Path = string(@__DIR__) * "/" * name_model * ".engee"
if name_model in [m.name for m in engee.get_all_models()] # Проверка условия загрузки модели в ядро
model = engee.open( name_model ) # Открыть модель
model_output = engee.run( model, verbose=true ); # Запустить модель
else
model = engee.load( Path, force=true ) # Загрузить модель
model_output = engee.run( model, verbose=true ); # Запустить модель
engee.close( name_model, force=true ); # Закрыть модель
end
return model_output
end
run_model("Scrambler_descrambler")
Let's analyze the stored values. BER is zero for 1001 steps.
# Считывание из simout сохранённых сигналов
BER = simout["Scrambler_descrambler/Error Rate Calculation.Out"];
BER = collect(BER)
BER[end-3:end,:]
Conclusion
Based on the results of this demonstration, we explored the possibilities of implementing the scrambling method used in the DVB video transmission protocols of the second generation.