pub enum O150Sequence {
Prbs9,
Prbs11,
Prbs15,
Prbs20,
Prbs20Zs,
Prbs23,
Prbs29,
Prbs31,
}Expand description
The pseudo-random test sequences of ITU-T O.150 (05/96), Sec. 5 and Table 1.
Each is produced by an $n$-stage shift register whose $k$-th and $n$-th stage outputs are added modulo two and fed back to the first stage,
$$ Q_{i+1}(t+1) = Q_{i}(t), \quad i = 1, \dots, n - 1, \qquad Q_{1}(t+1) = Q_{k}(t) \oplus Q_{n}(t), $$
the polynomial $x^{n} + x^{k} + 1$, period $2^{n} - 1$. The output is the last stage $Q_{n}(t)$, negated for the inverted sequences, whose longest run of zeros is then $n$ instead of $n - 1$ (Sec. 4). The second sequence of period $2^{20} - 1$ (Sec. 5.5) forces its output to one before 14 zeros, $RD(t) = Q_{20}(t) + \overline{Q_{6}(t) + \dots + Q_{19}(t)}$ ($+$ the logical OR).
| Sequence | Clause | $n$ | $k$ | Output | Longest run of zeros |
|---|---|---|---|---|---|
Prbs9 | 5.1 | 9 | 5 | non-inverted | 8 |
Prbs11 | 5.2 | 11 | 9 | non-inverted | 10 |
Prbs15 | 5.3 | 15 | 14 | inverted | 15 |
Prbs20 | 5.4 | 20 | 3 | non-inverted | 19 |
Prbs20Zs | 5.5 | 20 | 17 | zero suppression | 14 |
Prbs23 | 5.6 | 23 | 18 | inverted | 23 |
Prbs29 | 5.7 | 29 | 27 | inverted | 29 |
Prbs31 | 5.8 | 31 | 28 | inverted | 31 |
The Recommendation fixes the starting phase of the 511-bit sequence only, “the first
ONE of 9 consecutive ONEs” (Sec. 5.1); O150Sequence::bits starts every register
with its stages at one, which gives that phase and makes an inverted sequence begin
with its $n$ zeros. A test set synchronises to the received sequence (Sec. 4.2), so
the phase does not matter for a measurement.
The printed formula of Sec. 5.5 ends its OR with $Q_{6}(k)$ instead of $Q_{19}(k)$, and Sec. 5.8 calls the 31-stage register “twenty-nine-stage”: two misprints that the text of the same clauses corrects (Sec. 5.1 of the Recommendation).
§Examples
use comnum_mapping::source::O150Sequence;
let s = O150Sequence::Prbs9;
let b = s.bits(511 + 9);
assert_eq!(&b[..9], &[1; 9]); // Sec. 5.1: the first ONE of 9 ONEs
assert_eq!(&b[511..], &b[..9]); // period 2⁹ − 1
assert_eq!(O150Sequence::from_name("prbs20z")?, O150Sequence::Prbs20Zs);Variants§
Prbs9
$2^{9} - 1$ bits, Sec. 5.1 (O.153, data circuits up to 14 400 bit/s).
Prbs11
$2^{11} - 1$ bits, Sec. 5.2 (O.152, 64 kbit/s and N × 64 kbit/s).
Prbs15
$2^{15} - 1$ bits, inverted, Sec. 5.3 (O.151, 1544 to 44 736 kbit/s).
Prbs20
$2^{20} - 1$ bits, Sec. 5.4 (O.153, data circuits up to 72 kbit/s).
Prbs20Zs
$2^{20} - 1$ bits with zero suppression, Sec. 5.5 (O.151, 1544 to 44 736 kbit/s).
Prbs23
$2^{23} - 1$ bits, inverted, Sec. 5.6 (O.151, 34 368 and 139 264 kbit/s).
Prbs29
$2^{29} - 1$ bits, inverted, Sec. 5.7 (specific measurement tasks).
Prbs31
$2^{31} - 1$ bits, inverted, Sec. 5.8 (specific measurement tasks).
Implementations§
Source§impl O150Sequence
impl O150Sequence
Sourcepub const ALL: [O150Sequence; 8]
pub const ALL: [O150Sequence; 8]
The eight sequences, in the order of Sec. 5.
Sourcepub fn from_name(name: &str) -> Result<O150Sequence>
pub fn from_name(name: &str) -> Result<O150Sequence>
The sequence of a name: prbs9, prbs11, prbs15, prbs20, prbs20z (the zero
suppression of Sec. 5.5), prbs23, prbs29, prbs31.
§Errors
comnum_core::Error::Config for another name.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
The name of O150Sequence::from_name.
Sourcepub fn feedback(self) -> u32
pub fn feedback(self) -> u32
The other feedback stage $k$: the polynomial is $x^{n} + x^{k} + 1$.
Sourcepub fn longest_zeros(self) -> u32
pub fn longest_zeros(self) -> u32
The longest run of zeros of the sequence, Table 1.