Ask Your Question
0

how to calculate lfsr_sequence period?

asked 2021-01-29 08:50:41 +0200

Arman gravatar image

I need to find L's period!

F = GF(2); l = F(1); o = F(0)
F = GF(2); S = LaurentSeriesRing(F,'x'); x = S.gen()
fill = [l,l,o,l]; key = [l,l,l,l]; n = 20
L = lfsr_sequence(key,fill,n)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-02-02 00:44:06 +0200

Max Alekseyev gravatar image

updated 2021-02-02 00:47:54 +0200

Try this:

pol = lfsr_connection_polynomial(L)
P = PolynomialRing(GF(2),'y')
R.<y> = P.quotient(pol)
O = 2^pol.degree()-1
for p,_ in factor(O):
    while (O%p==0) and (y^(O//p)==1):
        O //= p
print("period =",O)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-01-29 08:50:41 +0200

Seen: 36 times

Last updated: Feb 02

Related questions