First time here? Check out the FAQ!

Ask Your Question
0

how to calculate lfsr_sequence period?

asked 4 years ago

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)
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 4 years ago

Max Alekseyev gravatar image

updated 4 years ago

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)
Preview: (hide)
link

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: 4 years ago

Seen: 268 times

Last updated: Feb 02 '21

Related questions