Aim of the Experiment:
In this experiment, you will be generating psuedo-random binary sequences using linear feedback shift registers. You will also learn about the self-synchronizing digital data scrambler and descrambler. These binary sequences will be used to simulate binary data sources for the remaining experiments. You don't have to check out any equipment for this lab.
Applications of Pseudo-Random Binary Sequences
Pseudo-random binary sequences are also known as pseudo-noise (PN) sequences because the sequences resemble noise. PN sequences are used in many contexts.
PN sequences are used to estimate an impulse response of an unknown system, e.g. room acoustics, communication channel, and biomedical instrumentation probes. The impulse response can then be used for equalization/calibration. For example, voiceband dial-up modems and DSL modems use PN sequences for channel estimation and equalization.
PN sequences are used in CDMA cell phones in the uplink direction (from mobile to basestation) to enable the basestation to distinguish one user from another. This is discussed in Appendix L of the reader and in lecture 21 slides.
PN sequences are used in data scramblers to prevent long strings of 0's and 1's. For baseband transmission, during a long string of 0's or 1's, the primary frequency component in the signal would be at DC, and DC does not get passed in phone lines. For bandpass transmission, during a long string of 0's or 1's, the primary frequency of the message signal (DC) would be upconverted to sit at the carrier frequency. This presents at least two problems:
Deviations from the laboratory manual:
Directions:
Implementations can store scrambler state either in an array (1 bit per element) or by using a single 32-bit integer. The former allows for each access of elements but requires more memory. The latter uses less memory but requires masking and shifting operations to extract and change individual bits. It is somewhat of a tradeoff as to which implementation is better.
Using Mathematica to analyze connection polynimials:
Tretter's lab manual asserts that the following polynomial is irreducible, i.e., cannot be factored into simpler polynomials over modulo-2 arithmetic:
2 3 4 1 + x + x + x + xWe can test this assertion in Mathematica:
In[6]:= Factor[ 1 + x + x^2 + x^3 + x^4, Modulus -> 2 ] 2 3 4 Out[6]= 1 + x + x + x + xSo, it is irreducible.
Treter's lab manual asserts that the same connection polynomial is not primitive. A polynomial of order m is primitive if the smallest value of N for which the polynomial xN - 1 is divisible by the connection polynomial equals 2m - 1. So, we can search over all N from 1 to 2m - 1 inclusive. The connection polynomial above divides x5 - 1:
In[29]:= Factor[ x^5 - 1, Modulus -> 2 ] 2 3 4 Out[29]= (1 + x) (1 + x + x + x + x )
Lab Report:
Coding Guidelines:
The scrambler and descrambler will be used in the remaining labs. In later labs, a different (longer) polynomial will be used.
Suggested Implementation:
Put scrambler and descrambler in separate functions. Each should process a single bit at a time. An extremely modular program would also use separate functions for initializing the states of each.
Recitation Slides for Lab 4 by Prof. Steven Tretter
Assignment:
Submitting this assignment is optional, but doing it would be useful with your QUIZ preparations