property galois.GLFSR.characteristic_poly : Poly

The characteristic polynomial \(c(x) = x^{n} + a_1 x^{n-1} + a_2 x^{n-2} + \dots + a_{n}\).

Notes

The characteristic polynomial is the reciprocal of the feedback polynomial \(c(x) = x^n f(x^{-1})\).

Examples

In [1]: feedback_poly = galois.primitive_poly(7, 4).reverse(); feedback_poly
Out[1]: Poly(5x^4 + 3x^3 + x^2 + 1, GF(7))

In [2]: lfsr = galois.GLFSR(feedback_poly); lfsr
Out[2]: <Galois LFSR: f(x) = 1 + x^2 + 3x^3 + 5x^4 over GF(7)>

In [3]: lfsr.characteristic_poly
Out[3]: Poly(x^4 + x^2 + 3x + 5, GF(7))

In [4]: assert lfsr.characteristic_poly == lfsr.feedback_poly.reverse()