Techniqueintro
Pseudo-random binary sequence input
Also called PRBS, maximum-length binary input.
An input signal for identification that switches between two levels by a maximum-length shift register sequence, with a near white spectrum.
A pseudo-random binary sequence (PRBS) input is a test signal for system identification that takes only two values, and , and switches between them in the pattern of a maximum-length sequence from a linear feedback shift register. With a register of bits and a primitive feedback polynomial, the sequence repeats after steps. Over one period its autocorrelation takes only two values, so its spectrum is flat at every nonzero harmonic of . It is therefore close to white noise, but it is deterministic, periodic, and has the smallest possible peak value for its power. A PRBS of period is persistently exciting of order exactly .
In plain words
To learn how a machine responds, you want to push it at all speeds, slow and fast, with equal force. Random noise does that, but it has spikes, and many plants can only take a limited push. A PRBS is a switch that flips between "high" and "low" in a pattern that looks random but is made by a simple shift register. Because it only ever sits at the two levels, it gives the most energy for a given limit on the push. Because the pattern repeats exactly, you can average over repeats to cut noise, and you know beforehand which frequencies it contains. Holding each value for several samples moves the energy toward slow motions.
When it applies
- The plant tolerates two-level switching of the input, for example a valve, a heater power or a motor voltage around an operating point.
- The model is linear, or is linear for small deviations around ; the amplitude must stay inside that range.
- The number of parameters to be estimated is less than , since the order of persistent excitation is .
- The experiment can run for at least one full period after the transient, so that the periodic properties hold for the recorded data.
The template
PRBS-EXPERIMENT(⟨p⟩, ⟨a⟩, ⟨u0⟩, ⟨P⟩, ⟨m⟩)- 1
r ← the degree of the primitive polynomial ⟨p⟩; M ← 2^r - 1 - 2
s(0), ..., s(r - 1) ← any bits that are not all 0 - 3
for n ← r to m·M - 1 do s(n) ← XOR of s(n - r + i) over the terms x^i, i < r, of ⟨p⟩ - 4
for n ← 0 to m·M - 1 do - 5
hold u ← ⟨u0⟩ + ⟨a⟩·(2 s(n) - 1) for ⟨P⟩ samples - 6
record y while u is applied; drop the first period as a transient - 7
return u and y for ⟨the estimator⟩
The holes are the feedback polynomial , which fixes the register length and the taps, the amplitude and operating point , the clock period in samples, the number of periods , and the estimator that will use the data.
The sequence (L1 to L3). The recursion of L3 has as its characteristic polynomial. When is primitive of degree , every nonzero start state runs through all nonzero states of the register before it repeats, so has period exactly . For and the recursion is , and the start gives one period
with 8 ones and 7 zeros. In every period there are ones and zeros.
The correlation (theorem). Map the bits to as in L5 with and take the mean over one period. Then
The reason is the shift-and-add property of maximum-length sequences: is again a shift of for , so it has ones and zeros, and the product of the two signals sums to over a period.
The spectrum (theorem). Over one period the discrete Fourier transform of the signal has and for . For and , the values are and . So the power is the same at every nonzero harmonic , and the mean is only .
The clock period (L5). Holding each bit for samples multiplies the line spectrum by the envelope , which has its first zero at . A rule of thumb is to pick so that this first zero lies a few times above the bandwidth of the plant, and to pick longer than the settling time of the plant, so that one period of the response does not wrap onto the next.
Persistent excitation. For the covariance matrix has the eigenvalues and , all positive. At the second one is . The order of persistent excitation is exactly .
Classic examples
- Correlation analysis of the impulse response. With and a plant whose impulse response dies out within samples, the periodic cross-correlation of with is . So is read off from up to a small known offset, without solving any equations. The correlation can be computed fast with the Walsh-Hadamard transform after a permutation of the samples.
- Empirical transfer function estimate. With a whole number of periods in steady state, the input has power only at the harmonics , the ratio there has no leakage, and averaging over the periods lowers the noise variance by a factor .
- Least-squares identification of ARX models and the prediction error method. A PRBS with larger than the number of input coefficients gives a nonsingular normal matrix, and its low crest factor gives the most input power under an amplitude limit.
- Dither in closed-loop identification. A small PRBS added to the reference makes the closed-loop data informative while the controller keeps the plant near its operating point.
Variations
- Random binary signal. Flip a fair coin at each clock instant. It is persistently exciting of every order, but its spectrum on a finite record is not flat.
- Generalized binary noise. Switch the level with a fixed probability at each sample, which sets the mean time between switches and so shapes the low-frequency power.
- De Bruijn sequences. Add the all-zero state to get period ; the correlation is then no longer two-valued.
- Inverse-repeat PRBS. Apply the sequence and then its negative. The period doubles, and the response to even-order nonlinearities cancels in the average.
- Multilevel and ternary sequences. Sequences over more than two levels from shift registers over a finite field reveal static nonlinearities that a binary signal cannot see.
- Multisine. A sum of sinusoids at chosen harmonics with phases picked to keep the peak low. It gives full control over the spectrum, at the cost of a higher crest factor than a binary signal.
Pitfalls
- A polynomial that is not primitive. At L1, the polynomial gives period 6 from the start , and gives period 5. The order of persistent excitation drops with the period. Take from a table of primitive polynomials, or check that the period is .
- An all-zero start. At L2, the all-zero state maps to itself and the sequence is constant. Any other start works.
- A period shorter than the response. If is shorter than the settling time, the periodic correlation in L7 returns instead of . Choose so that one period covers the settling time.
- A clock period that is too short. With and a slow plant, most of the input power is above the bandwidth of the plant and the low-frequency fit has a poor signal-to-noise ratio. Raise at L5.
- A record that is not a whole number of periods. The two-valued correlation and the flat line spectrum hold over whole periods only. Record full periods after the transient at L6.
- The nonzero mean. The mean of the sequence is , not . Remove the sample means of and before estimating, or include an offset in the model.
Exercises
- Show that the matrix of size has the eigenvalues and , and conclude that the order of persistent excitation of a PRBS is .
- Generate the sequence of from the start and check that its period is 31.
- For a plant with impulse response for and a PRBS with and , compute the periodic cross-correlation at and recover from it.
References
- Keith Godfrey (editor), Perturbation Signals for System Identification, Prentice Hall, 1993, the chapters on maximum-length binary sequences, their correlation and spectral properties, and their use as test signals
- Torsten Söderström and Petre Stoica, System Identification, Prentice Hall, 1989, Chapter 5 (input signals: the pseudo-random binary sequence, its covariance function and its order of persistent excitation)
- Lennart Ljung, System Identification: Theory for the User, second edition, Prentice Hall, 1999, Chapter 13 (experiment design and the choice of input signals)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W3 standard |
|
Tag YHRB09 Edit this page History Report an error Markdown