Tutorial illustrating the use of ROOT::Math::LFSR::GenerateSequence can be run with:
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>
{
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};
std::cout <<
"PRBS period " <<
prbs.size() <<
":\t";
std::cout << static_cast<unsigned short>(
p) <<
" ";
}
std::cout << std::endl;
}
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
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.