<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Pseudorandom_binary_sequence</id>
	<title>Pseudorandom binary sequence - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Pseudorandom_binary_sequence"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Pseudorandom_binary_sequence&amp;action=history"/>
	<updated>2026-05-04T21:31:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Pseudorandom_binary_sequence&amp;diff=1450214&amp;oldid=prev</id>
		<title>imported&gt;MüllerMarcus: /* Practical implementation */ Removing a link to a not even merged pull request on Github. That&#039;s not a source, that&#039;s more like an attempt to give weight to one&#039;s code contribution.</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Pseudorandom_binary_sequence&amp;diff=1450214&amp;oldid=prev"/>
		<updated>2024-02-05T16:26:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Practical implementation: &lt;/span&gt; Removing a link to a not even merged pull request on Github. That&amp;#039;s not a source, that&amp;#039;s more like an attempt to give weight to one&amp;#039;s code contribution.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Use American English|date = March 2019}}&lt;br /&gt;
{{Short description|Seemingly random, difficult to predict bit stream created by  a deterministic algorithm}}&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;pseudorandom binary sequence&amp;#039;&amp;#039;&amp;#039; (PRBS), &amp;#039;&amp;#039;&amp;#039;pseudorandom binary code&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;pseudorandom bitstream&amp;#039;&amp;#039;&amp;#039; is a [[binary sequence]] that, while generated with a deterministic [[algorithm]], is difficult to predict&amp;lt;ref name=&amp;quot;TTI&amp;quot;&amp;gt;{{cite web |url=http://www.tti-test.com/go/tgxa/prbs.htm |title=PRBS Pseudo Random Bit Sequence Generation |website=TTi |access-date=21 January 2016}}&amp;lt;/ref&amp;gt; and exhibits statistical behavior similar to a truly random sequence. PRBS generators are used in [[telecommunication]], such as in analog-to-information conversion,&amp;lt;ref&amp;gt;{{cite web |url=https://www.imeko.org/publications/tc4-2016/IMEKO-TC4-2016-14.pdf |title=PRBS non-idealities affecting Random Demodulation Analog-to-Information Converters |last1=Daponte |first1=Pasquale |last2=De Vito |first2=Luca |last3=Iadarola |first3=Grazia |last4=Rapuano |first4=Sergio}}&amp;lt;/ref&amp;gt; but also in [[encryption]], [[simulation]], [[correlation]] technique and time-of-flight [[spectroscopy]]. The most common example is the [[maximum length sequence]] generated by a (maximal) [[Linear-feedback shift register|linear feedback shift register]] (LFSR). Other examples are [[Gold code|Gold sequences]] (used in [[CDMA]] and [[Global Positioning System|GPS]]), [[Kasami code|Kasami sequences]] and [[JPL sequence|JPL sequences]], all based on LFSRs.&lt;br /&gt;
&lt;br /&gt;
In [[Telecommunication|telecommunications]], pseudorandom binary sequences are known as &amp;#039;&amp;#039;&amp;#039;pseudorandom noise codes&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;PN&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PRN codes&amp;#039;&amp;#039;&amp;#039;) due to their application as [[pseudorandom noise]].&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
A binary sequence (BS) is a [[sequence]] &amp;lt;math&amp;gt;a_0,\ldots, a_{N-1}&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; bits, i.e.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;a_j\in \{0,1\}&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;j=0,1,...,N-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A BS consists of &amp;lt;math&amp;gt;m=\sum a_j&amp;lt;/math&amp;gt; ones and &amp;lt;math&amp;gt;N-m&amp;lt;/math&amp;gt; zeros.&lt;br /&gt;
&lt;br /&gt;
A BS is a &amp;#039;&amp;#039;&amp;#039;[[pseudorandomness|pseudorandom]] binary sequence&amp;#039;&amp;#039;&amp;#039; (PRBS) if&amp;lt;ref&amp;gt;{{cite web |url=http://www.scriptwell.net/correlation.htm |title=Articles on Correlation and Calibration |last1=Naszodi |first1=Laszlo |archive-url=https://web.archive.org/web/20131111050840/http://www.scriptwell.net/correlation.htm |archive-date=11 November 2013 |url-status=dead}}&amp;lt;/ref&amp;gt; its [[autocorrelation function]], given by&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;C(v)=\sum_{j=0}^{N-1} a_ja_{j+v}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
has only two values:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;C(v)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
m, \mbox{ if } v\equiv 0\;\; (\mbox{mod}N)\\ &lt;br /&gt;
\\&lt;br /&gt;
mc, \mbox{ otherwise }&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;c=\frac{m-1}{N-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is called the &amp;#039;&amp;#039;duty cycle&amp;#039;&amp;#039; of the PRBS, similar to the [[duty cycle]] of a continuous time signal.  For a [[maximum length sequence]], where &amp;lt;math&amp;gt;N = 2^k - 1&amp;lt;/math&amp;gt;, the duty cycle is 1/2.&lt;br /&gt;
&lt;br /&gt;
A PRBS is &amp;#039;pseudorandom&amp;#039;, because, although it is in fact deterministic, it seems to be random in a sense that the value of an &amp;lt;math&amp;gt;a_j&amp;lt;/math&amp;gt; element is independent of the values of any of the other elements, similar to real random sequences.&lt;br /&gt;
&lt;br /&gt;
A PRBS can be stretched to infinity by repeating it after &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; elements, but it will then be cyclical and thus non-random.  In contrast, truly random sequence sources, such as sequences generated by [[radioactive decay]] or by [[white noise]], are infinite (no pre-determined end or cycle-period).  However, as a result of this predictability, PRBS signals can be used as reproducible patterns (for example, signals used in testing telecommunications signal paths).&amp;lt;ref name=&amp;quot;O150&amp;quot;&amp;gt;{{cite web|url=http://www.itu.int/rec/T-REC-O.150-199210-S |title=ITU-T Recommendation O.150 |date=October 1992}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Practical implementation ==&lt;br /&gt;
Pseudorandom binary sequences can be generated using [[linear-feedback shift register]]s.&amp;lt;ref&amp;gt;Paul H. Bardell, William H. McAnney, and Jacob Savir, &amp;quot;Built-In Test for VLSI: Pseudorandom Techniques&amp;quot;, John Wiley &amp;amp; Sons, New York, 1987.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some common&amp;lt;ref name=&amp;quot;Bloopist&amp;quot;&amp;gt;{{cite web |url=http://blog.kurttomlinson.com/posts/prbs-pseudo-random-binary-sequence |title=PRBS (Pseudo-Random Binary Sequence) |last1=Tomlinson |first1=Kurt |website=Bloopist|date=4 February 2015 |access-date=21 January 2016}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web |url=https://users.ece.cmu.edu/~koopman/lfsr/index.html |title=Maximal Length LFSR Feedback Terms |last1=Koopman |first1=Philip |access-date=21 January 2016}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web |url=https://www.altera.com/support/support-resources/knowledge-base/solutions/rd02142013_406.html |title=What are the PRBS7, PRBS15, PRBS23, and PRBS31 polynomials used in the Altera Transceiver Toolkit? |website=[[Altera]] |date=14 February 2013 |access-date=21 January 2016}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web |url=http://www.xilinx.com/support/documentation/application_notes/xapp884_PRBS_GeneratorChecker.pdf |title=An Attribute-Programmable PRBS Generator and Checker (XAP884) |last1=Riccardi |first1=Daniele |last2=Novellini |first2=Paolo |date=10 January 2011 |at=Table 3:Configuration for PRBS Polynomials Most Used to Test Serial Lines |website=[[Xilinx]] |access-date=21 January 2016}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web |url=https://www.itu.int/rec/T-REC-O.150-199605-I/en |title=O.150 : General requirements for instrumentation for performance measurements on digital transmission equipment |date=1997-01-06}}&amp;lt;/ref&amp;gt; sequence generating [[monic polynomial]]s are&lt;br /&gt;
&lt;br /&gt;
:PRBS7  = &amp;lt;math&amp;gt;x^{7} + x^{6} + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:PRBS9  = &amp;lt;math&amp;gt;x^{9} + x^{5} + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:PRBS11  = &amp;lt;math&amp;gt;x^{11} + x^{9} + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:PRBS13 = &amp;lt;math&amp;gt;x^{13} + x^{12} + x^{2} + x + 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:PRBS15 = &amp;lt;math&amp;gt;x^{15} + x^{14} + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:PRBS20 = &amp;lt;math&amp;gt;x^{20} + x^{3} + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:PRBS23 = &amp;lt;math&amp;gt;x^{23} + x^{18} + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:PRBS31 = &amp;lt;math&amp;gt;x^{31} + x^{28} + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of generating a &amp;quot;PRBS-7&amp;quot; sequence can be expressed in C as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
int main(int argc, char* argv[]) {&lt;br /&gt;
    uint8_t start = 0x02;&lt;br /&gt;
    uint8_t a = start;&lt;br /&gt;
    int i;    &lt;br /&gt;
    for (i = 1;; i++) {&lt;br /&gt;
        int newbit = (((a &amp;gt;&amp;gt; 6) ^ (a &amp;gt;&amp;gt; 5)) &amp;amp; 1);&lt;br /&gt;
        a = ((a &amp;lt;&amp;lt; 1) | newbit) &amp;amp; 0x7f;&lt;br /&gt;
        printf(&amp;quot;%x\n&amp;quot;, a);&lt;br /&gt;
        if (a == start) {&lt;br /&gt;
            printf(&amp;quot;repetition period is %d\n&amp;quot;, i);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this particular case, &amp;quot;PRBS-7&amp;quot; has a repetition period of 127 values.&lt;br /&gt;
&lt;br /&gt;
== Notation ==&lt;br /&gt;
&lt;br /&gt;
The PRBS&amp;#039;&amp;#039;k&amp;#039;&amp;#039; or PRBS-&amp;#039;&amp;#039;k&amp;#039;&amp;#039; notation (such as &amp;quot;PRBS7&amp;quot; or &amp;quot;PRBS-7&amp;quot;) gives an indication of the size of the sequence.  &amp;lt;math&amp;gt;N = 2^k - 1&amp;lt;/math&amp;gt; is the maximum number&amp;lt;ref name=&amp;quot;O150&amp;quot; /&amp;gt;{{Rp|§3}} of bits that are in the sequence.  The &amp;#039;&amp;#039;k&amp;#039;&amp;#039; indicates the size of a unique [[Word (computer architecture)|word]] of data in the sequence.  If you segment the &amp;#039;&amp;#039;N&amp;#039;&amp;#039; bits of data into every possible word of length &amp;#039;&amp;#039;k&amp;#039;&amp;#039;, you will be able to list every possible combination of 0s and 1s for a k-bit binary word, with the exception of the all-0s word.&amp;lt;ref name=&amp;quot;O150&amp;quot; /&amp;gt;{{Rp|§2}} For example, PRBS3 = &amp;quot;1011100&amp;quot; could be generated from &amp;lt;math&amp;gt;x^{3} + x^{2} + 1&amp;lt;/math&amp;gt;.&amp;lt;ref name=&amp;quot;Bloopist&amp;quot; /&amp;gt;  If you take every sequential group of three bit words in the PRBS3 sequence (wrapping around to the beginning for the last few three-bit words), you will find the following 7 word arrangements:&lt;br /&gt;
   &amp;quot;&amp;lt;u&amp;gt;101&amp;lt;/u&amp;gt;1100&amp;quot; &amp;amp;rarr; 101&lt;br /&gt;
   &amp;quot;1&amp;lt;u&amp;gt;011&amp;lt;/u&amp;gt;100&amp;quot; &amp;amp;rarr; 011&lt;br /&gt;
   &amp;quot;10&amp;lt;u&amp;gt;111&amp;lt;/u&amp;gt;00&amp;quot; &amp;amp;rarr; 111&lt;br /&gt;
   &amp;quot;101&amp;lt;u&amp;gt;110&amp;lt;/u&amp;gt;0&amp;quot; &amp;amp;rarr; 110&lt;br /&gt;
   &amp;quot;1011&amp;lt;u&amp;gt;100&amp;lt;/u&amp;gt;&amp;quot; &amp;amp;rarr; 100&lt;br /&gt;
   &amp;quot;&amp;lt;u&amp;gt;1&amp;lt;/u&amp;gt;0111&amp;lt;u&amp;gt;00&amp;lt;/u&amp;gt;&amp;quot; &amp;amp;rarr; 001 (requires wrap)&lt;br /&gt;
   &amp;quot;&amp;lt;u&amp;gt;10&amp;lt;/u&amp;gt;1110&amp;lt;u&amp;gt;0&amp;lt;/u&amp;gt;&amp;quot; &amp;amp;rarr; 010 (requires wrap)&lt;br /&gt;
Those 7 words are all of the &amp;lt;math&amp;gt;2^k - 1 = 2^3 - 1 = 7&amp;lt;/math&amp;gt; possible non-zero 3-bit binary words, not in numeric order.  The same holds true for any PRBS&amp;#039;&amp;#039;k&amp;#039;&amp;#039;, not just PRBS3.&amp;lt;ref name=&amp;quot;O150&amp;quot; /&amp;gt;{{Rp|§2}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Pseudorandom number generator]]&lt;br /&gt;
* [[Gold code]]&lt;br /&gt;
* [[Complementary sequences]]&lt;br /&gt;
* [[Bit Error Rate Test]]&lt;br /&gt;
* [[Pseudorandom noise]]&lt;br /&gt;
* [[Linear-feedback shift register]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* {{OEIS el|1=A011686|2=A binary m-sequence: expansion of reciprocal|formalname=A binary m-sequence: expansion of reciprocal of x^7 + x^6 + 1}} -- the bit sequence for PRBS7 = &amp;lt;math&amp;gt;x^{7} + x^{6} + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Pseudorandomness]]&lt;br /&gt;
[[Category:Binary sequences]]&lt;/div&gt;</summary>
		<author><name>imported&gt;MüllerMarcus</name></author>
	</entry>
</feed>