Tutorial illustrating the use of ROOT::Math::LFSR::GenerateSequence can be run with:
root > .x PRBS.C
root > .x PRBS.C+ with ACLIC
These values match the PRBS sequences generated by a Keysight waveform generator except for the N first bits that appear at the end rather than at the beginning
- See also
- https://www.sciencedirect.com/science/article/pii/S0168900222002431#fig6
LFSR::GenerateSequence PRBS3, PRBS4 and PRBS5 tests
==========================
PRBS period 7: 0 0 1 0 1 1 1
PRBS period 15: 0 0 0 1 0 0 1 1 0 1 0 1 1 1 1
PRBS period 31: 0 0 0 1 1 0 1 1 1 0 1 0 1 0 0 0 0 1 0 0 1 0 1 1 0 0 1 1 1 1 1
#include <iostream>
void PRBS()
{
printf("\nLFSR::GenerateSequence PRBS3, PRBS4 and PRBS5 tests\n");
printf("==========================\n");
std::array<std::uint16_t, 2> taps3 = {3, 2};
std::array<std::uint16_t, 2> taps4 = {4, 3};
std::array<std::uint16_t, 2> taps5 = {5, 3};
for (auto prbs : {prbs3, prbs4, prbs5}) {
std::cout << "PRBS period " << prbs.size() << ":\t";
for (auto p : prbs) {
std::cout << static_cast<unsigned short>(p) << " ";
}
std::cout << std::endl;
}
}
std::vector< Output > GenerateSequence(std::bitset< k > start, std::array< std::uint16_t, nTaps > taps, bool left=true, bool wrapping=false, bool oppositeBit=false)
Generation of a sequence of pseudo-random bits using a linear feedback shift register (LFSR),...
- Author
- Fernando Hueso-González
Definition in file PRBS.C.