-
sdr.preferred_pairs(degree: int, poly: PolyLike | None =
None
) Iterator[tuple[Poly, Poly]] Generates primitive polynomials of degree
that produce preferred pair -sequences.- Parameters:¶
- Returns:¶
An iterator of primitive polynomials
of degree that produce preferred pair -sequences.
See also
Notes¶
A preferred pair of primitive polynomials of degree
are two polynomials and such that the periodic cross-correlation of the two -sequences generated by and have only the values in .There are no preferred pairs for degrees divisible by 4.
References¶
John Proakis, Digital Communications, Chapter 12.2-5: Generation of PN Sequences.
Examples¶
Generate one preferred pair with
.In [1]: next(sdr.preferred_pairs(5, poly="x^5 + x^3 + 1")) Out[1]: (Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^3 + x^2 + x + 1, GF(2)))
Generate all preferred pairs with
.In [2]: list(sdr.preferred_pairs(5, poly="x^5 + x^3 + 1")) Out[2]: [(Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^3 + x^2 + x + 1, GF(2))), (Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^4 + x^2 + x + 1, GF(2))), (Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x + 1, GF(2))), (Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x^2 + 1, GF(2)))]
Generate all preferred pairs with degree 5.
In [3]: list(sdr.preferred_pairs(5)) Out[3]: [(Poly(x^5 + x^2 + 1, GF(2)), Poly(x^5 + x^3 + x^2 + x + 1, GF(2))), (Poly(x^5 + x^2 + 1, GF(2)), Poly(x^5 + x^4 + x^2 + x + 1, GF(2))), (Poly(x^5 + x^2 + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x + 1, GF(2))), (Poly(x^5 + x^2 + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x^2 + 1, GF(2))), (Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^3 + x^2 + x + 1, GF(2))), (Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^4 + x^2 + x + 1, GF(2))), (Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x + 1, GF(2))), (Poly(x^5 + x^3 + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x^2 + 1, GF(2))), (Poly(x^5 + x^3 + x^2 + x + 1, GF(2)), Poly(x^5 + x^4 + x^2 + x + 1, GF(2))), (Poly(x^5 + x^3 + x^2 + x + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x + 1, GF(2))), (Poly(x^5 + x^4 + x^2 + x + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x^2 + 1, GF(2))), (Poly(x^5 + x^4 + x^3 + x + 1, GF(2)), Poly(x^5 + x^4 + x^3 + x^2 + 1, GF(2)))]
Note, there are no preferred pairs for degrees divisible by 4.
In [4]: list(sdr.preferred_pairs(4)) Out[4]: [] In [5]: list(sdr.preferred_pairs(8)) Out[5]: []