55TEST (LFSR, GenerateSequence)
66{
77 // PRBS3
8- std::array<std::uint16_t , 2 > taps3 = {2 , 3 }; // Exponents of the monic polynomial
8+ std::array<std::uint16_t , 2 > taps3 = {3 , 2 }; // Exponents of the monic polynomial
99 auto prbs3 = ROOT::Math::LFSR::GenerateSequence<3 , 2 , bool >(std::bitset<3 >().flip (), taps3); // Start value all high
1010 EXPECT_EQ (prbs3, std::vector<bool >({false , false , true , false , true , true , true }));
1111
1212 // PRBS4
13- std::array<std::uint16_t , 2 > taps4 = {3 , 4 }; // Exponents of the monic polynomial
13+ std::array<std::uint16_t , 2 > taps4 = {4 , 3 }; // Exponents of the monic polynomial
1414 auto prbs4 = ROOT::Math::LFSR::GenerateSequence<4 , 2 , bool >(std::bitset<4 >().flip (), taps4); // Start value all high
1515 EXPECT_EQ (prbs4, std::vector<bool >({false , false , false , true , false , false , true , true , false , true , false , true ,
1616 true , true , true }));
@@ -22,5 +22,6 @@ TEST(LFSR, GenerateSequence)
2222 false , true , false , false , false , false , true , false , false , true , false ,
2323 true , true , false , false , true , true , true , true , true }));
2424
25- // Exponents of the monic polynomial extracted from Keysight waveform generator manual p. 284
25+ // Exponents of the monic polynomial were extracted from
26+ // Keysight Trueform Series Operating and Service Guide p. 284-285. More examples in tutorials/math/PRBS.C
2627}
0 commit comments