sdr.is_preferred_pair(poly1: PolyLike, poly2: PolyLike) bool

Determines if two primitive polynomials generate preferred pair \(m\)-sequences.

Parameters:
poly1: PolyLike

The first primitive polynomial \(f(x)\).

poly2: PolyLike

The second primitive polynomial \(g(x)\).

Returns:

A boolean indicating if the two primitive polynomials generate preferred pair \(m\)-sequences.

Notes

A preferred pair of primitive polynomials of degree \(m\) are two polynomials \(f(x)\) and \(g(x)\) such that the periodic cross-correlation of the two \(m\)-sequences generated by \(f(x)\) and \(g(x)\) have only the values in \(\{-1, -t(m), t(m) - 2\}\).

\[\begin{split} t(m) = \begin{cases} 2^{(m+1)/2} + 1 & \text{if $m$ is odd} \\ 2^{(m+2)/2} + 1 & \text{if $m$ is even} \end{cases} \end{split}\]

There are no preferred pairs for degrees divisible by 4.

References

  • John Proakis, Digital Communications, Chapter 12.2-5: Generation of PN Sequences.

Examples

Determine if the pair \(f(x) = x^5 + x^3 + 1\) and \(g(x) = x^5 + x^3 + x^2 + x + 1\) is a preferred pair.

In [1]: sdr.is_preferred_pair("x^5 + x^3 + 1", "x^5 + x^3 + x^2 + x + 1")
Out[1]: True

Determine if the pair \(f(x) = x^5 + x^3 + 1\) and \(g(x) = x^5 + x^2 + 1\) is a preferred pair.

In [2]: sdr.is_preferred_pair("x^5 + x^3 + 1", "x^5 + x^2 + 1")
Out[2]: False