PN Sequence
(PRBS) Generators:Frequently
Asked Questions
Handy
Tip: A quick way to
locate the answer to your specific question is to
use your browser's built-in Find
command. You can use the browser's
"Edit" menu, then select
"Find", or just press Ctrl-F
to display the find dialog box.
| Introduction
to PN Sequence Generation |
Can you
tell me more about PN sequences
and how they are generated?
Sure.
The PN in PN sequence stands for pseudonoise,
which is just another name for pseudorandom
binary sequence, or PRBS.
Pseudorandom sequences are generated using a
binary shift register with taps that are modulo-2
added together and fed back to the register's
input. The name commonly used for this simple
circuit is linear feedback shift register,
or LFSR. The type of sequence
generated by an LFSR is called a linear recursive
sequence, or LRS.
What is
the theory behind LFSRs and
pseudorandom sequence generation?
We
suggest you take a look at an article we wrote on
Linear
Feedback Shift Registers. It's
pretty interesting and goes into a fair amount of
detail on LFSR theory, as well as related topics
like m-sequences and feedback tap selection. It's
a pretty handy reference, and
you don't need to have a Ph.D. to understand it.
How do
I know what feedback taps to
select in order to obtain an m-sequence?
In
short, any combination of feedback taps will
provide a recursive sequence, regardless of which
taps you choose. However, only certain
combinations of feedback taps will result in
maximal-length sequences, called m-sequences.
These are the longest sequences possible given a
specific shift register size, and they have many
desirable properties. If the register size is m
stages, the length of the m-sequence will be 2m-1.
Tables of feedback sets for m-sequences are given
in an article we wrote on Linear
Feedback Shift Registers. We
think you will find this to be a handy
reference on sequence generators.
| Applications
of PN Sequence Generators |
Can
your PN sequence generators be used as simple PRBS
Generators?
Absolutely!
Our generators are PRBS generators, but
with lots of bells and whistles for those who
wish to use them (like developers of wireless and
spread spectrum systems). But if you use only the
PN Sequence output port
(TTL-compatible), you're guaranteed to get a
simple pseudorandom sequence. Just select the
feedback taps you want and you're ready to go!
Can
your PN sequence generators be used as a Data
Simulators? Can they simulate data
streams at baseband? What about BPSK
and QPSK at RF and microwave
frequencies?
Definitely,
all these formats are supported! In fact, data
simulation was one of the applications our
engineers had in mind when they designed these
generators. Our generators are standard PRBS
generators that output not only TTL-level
pseudorandom sequences for baseband applications,
but also provide AC outputs for driving
inexpensive, external modulators for wireless
applications.
For
wireless applications, simply attach a
double-balanced mixer/modulator for BPSK
simulation, or a QPSK (or I&Q) modulator for
either QPSK or BPSK simulation. These mixers are
readily available for prices typically less than
$200. See our FAQ on mixer
connections for
details on using mixers with our generators. You
will find it to be a snap!
The
difference between using our sequence generators
for PRBS data generation, or for spread spectrum
generation, boils down to one simple thing --
whether or not you apply an external data source
to an input port on the generator. If you do, our
generator will spread it's bandwidth, thus giving
you "spread spectrum." If you don't,
you'll get just the pseudorandom sequence. It's
as simple as that.
How do
I use your PN sequence generator in a direct
sequence application?
The
definition of "direct sequence" is that
a data-modulated carrier is multiplied by a
broadband PN sequence in order to spread the data
signal's bandwidth.
Having
said that, the way you use our generator depends
upon the type of data modulation desired. If it
is PSK, which is usually the case, you simply
apply the data signal to the Data Input
port of the generator, where it will be modulo-2
added with the PN sequence. This is called code
inversion modulation, but it can be shown
that this is equivalent to first PSK modulating
the data onto a carrier, and then multiplying the
result with the PN sequence.
If the
desired data modulation scheme isn't PSK,
modulation of the data must be performed external
to the generator. In such a case the Data
Input port is left unused.
To
modulate the carrier, simply connect the AC
Output port of the generator to a double-balanced
mixer. Refer to the FAQ on mixer
connections for
information on balanced mixers and how to use
them for BPSK and QPSK modulation. It's easy!
If
you're interested in QPSK modulation, be sure to
read the FAQ on I&Q
sequence derivation.
Our
generators can also be used in receiver
applications, for despreading the spread signal.
Setup is virtually the same as for transmitter
applications, the only exception being that the
carrier signal is replaced by the received spread
signal. If two of our generators are used in a
transmitter/receiver application, you should
consider using the Master/Slave feature of our
generators to keep the two generators in perfect
synchronization. See our FAQ on Master/Slave for
further details.
How do
I use your PN sequence generator in a frequency
hopping application?
The
answer to this is not as straightforward as it is
for direct sequence, because the data to be
hopped can be modulated into the signal in any
one of numerous ways. But if we ignore the data
and focus on the PN sequence, the question is
much easier to answer.
Our
generators include a parallel port that outputs
all taps of the sequence-generating shift
register. Simply connect each of these taps to
the parallel inputs of a direct digital
synthesizer (DDS), using proper termination
techniques to avoid excessive ringing. The output
frequency of the DDS, also known as a numerically
controlled oscillator (NCO), will jump around in
a pseudorandom fashion.
Our
generators can also be used in receiver
applications, for dehopping the hopped signal.
Setup is virtually the same as for transmitter
applications. If two of our generators are used
in a transmitter/receiver application, you should
consider using the Master/Slave feature of our
generators to keep the two generators in perfect
synchronization. See our FAQ on Master/Slave for
further details.
How do
I use your PN sequence generator in a receiver
application?
Using
our generators in receiver applications is
virtually the same as using them in transmitter
applications. For details, refer to our FAQ's on direct
sequence applications and frequency
hopping applications. For
information on keeping the transmitter's and
receiver's PN sequences in perfect
synchronization, refer to our FAQ on the Master/Slave
feature of our
generators.
| Features
of PN Sequence Generators |
I know
what PN sequences are. But what are all those
other codes supported by your generators, like Gold,
JPL, and Barker Codes?
These
are other, less-commonly used codes (sequences)
that have certain properties making them more
valuable in some applications. For short answers
to your question, look up the codes in our Spread
Spectrum Glossary. If
you wish, you can find detailed information on
these and other codes in the Advanced
Topics
section of our Spread
Spectrum Resources
directory.
Your
generators support both truncated and
appended codes. What are they, and what
are they used for?
You
probably know that any PN sequences has a certain
natural length before repeating itself. A
truncated code is one where the sequence is
intentionally restarted before it
otherwise would on its own. On the other hand, an
appended code is one where the sequence is
restarted after the natural repetition
occurs.
As an
example, the natural length of a maximal R8
sequence is 28-1 = 255 chips. With our
generators you can set the Truncation
Length to virtually any number of chips
you want. If you set it to 250, the sequence will
start over after the first 250 chips -- the last
5 chips will never be generated. But if you set
the truncation length to 260, all 255 chips will
be generated, followed naturally by the first 5
chips, after which the sequence will start over.
In this case the first 5 chips are generated
twice-in-a-row for each period. (Truncation
Length is also known as the Sequence Length
or LRS Length.)
As for
what truncated and appended codes are used for,
we haven't the slightest idea! But because the
Department of Defense (DOD), National Security
Agency (NSA), and other government agencies
insist on having these features available, we can
only assume there must be something useful about
them. Our guess is that even some of our civilian
customers know how to use these features to their
advantage, but are careful not to disclose their
knowledge as this might benefit their
competitors.
What
exactly is Burst Mode and how is
it used?
Normally
a PN sequence will run indefinitely and is
periodic in nature. But when one of our
generators is set to Burst Mode, this will no
longer be the case. Instead, the PN sequence will
run for precisely one period and then stop. To
trigger (start) the burst, you press the Run
button on the front panel.
Alternatively, you can trigger the burst on the
rising edge of a TTL-level pulse applied to the Run
input port on the rear panel.
Note
that the burst length can be set to an arbitrary
number of chips, if so desired. The number of
chips in the burst is determined by the Truncation
Length setting of the generator. (Also
known as the Sequence Length or LRS
Length.)
How do
your generators derive the I and Q
signals for QPSK applications?
You can
select one of two ways. The first, and most
commonly used, is where the I output takes the
odd chips from the PN sequence, and the Q output
takes the even chips. Thus, there are two chips
(bits) per QPSK symbol. As would be expected, the
I and Q outputs are updated simultaneously, every
other clock cycle. (Unless OQPSK modulation is
selected, in which case the I and Q outputs are
updated on alternate clock cycles. This is the
definition of OQPSK.)
The
second method is available only with generators
having dual PN generators. In this method, the I
output is provided by one of the generators, and
the Q output is provided by the other.
How are
the "Various High-Speed TTL I/O
Ports for Precision Control" used?
These
are ports that duplicate functions available to
the user on the front panel. For the most part,
these ports aren't necessary for normal
operation, but may come in handy for special
applications.
Nevertheless,
two of the ports are commonly used and are very
handy. The Epoch output port
outputs a pulse whenever the PN sequence begins
to repeat itself. This can be used to trigger an
oscilloscope when observing the sequence on the
scope. The other is the Run input port,
which can be used to trigger a burst of chips
when Burst
Mode is
selected.
The
remaining I/O control ports operate as follows: A
rising-edge on the Preset input port
will stop the shift register and load it with the
Initial Fill (a.k.a. Preset Code),
as set by the user. A rising edge on the Run
input port will start the shift
register, or stop it if it is already running.
In
direct sequence applications, the user may apply
a data source to the Data input port,
and this is modulo-2 added with the PN sequence
to produce the direct sequence output. If the Data
Defeat input port is asserted (pulled
low), the data input is "turned off" so
that only the PN sequence will be output. If the PN
Defeat input port is asserted (pulled
low), the PN sequence is "turned off"
so that only the data will be output.
How do
I use the Master/Slave feature
of your generators to maintain code synchronization
between two or more generators?
Two or
more of our generators can be connected in a
master/slave configuration that is designed to
maintain perfect synchronization between the
generators' PN sequences. The most obvious use of
this feature is in transmitter/receiver
applications. But the feature can be useful in
other applications as well, such as creating Gold
codes from the outputs of multiple generators, or
doing cross-correlation studies on two sequences.
Let's
suppose you wish to keep just two generators
synchronized. Simply connect three special
Master/Slave Output ports on the master generator
to three special Master/Slave Input ports on the
slave generator. One of these connections passes
the clock signal from the master to the slave. So
only once clock source is used in the setup, and
it is connected to the master generator. The
other two connections are used to keep the two PN
sequences in phase.
Once
the master/slave connections are made, the two
generators are easily kept synchronized. Just be
sure to use the master to control both
generators. For example, use the Preset
button on the master to load the initial contents
of both generator's shift registers. And use the Run
button on the master to start or stop both
generators. If you must make a setting change on
both generators, like the feedback taps, just do
so on the slave first. When you make the
corresponding change on the master, it will
automatically re-synchronize the slave. (If you
want to change a setting on the slave only,
simply preset the master afterward to
re-synchronize the two.)
| Techniques
in using PN Sequence Generators |
What is
a double-balanced mixer/modulator,
and how do I connect it to the PN sequence
generator?
A
double-balanced mixer is a passive device that
multiplies signals applied to two of its port and
outputs the result on its third port. It is a
conceptually simple device, consisting of only
two tiny transformers and four diodes connected
in a cathode-to-anode ring configuration. The
fascinating thing about double-balanced mixers is
that you can choose any two of the ports to be
inputs, and the third automatically assumes the
role of output.
However,
double-balanced mixers are optimized to work best
when connected in a specific way. As a mixer, the
two transformer-coupled ports are typically
designed to be driven by the RF and LO (local
oscillator), with the IF (intermediate frequency)
output taken from the diode-connected port. (By
"diode-connected" we mean the port that
connects to the diodes without transformer
isolation.) As a digital modulator, one of the
transformer-coupled ports is driven by the RF
carrier, the output is taken from the other
transformer-coupled port, and the diode-connected
port is driven by the binary stream.
Our PN
sequence generators have an AC-coupled output
port that is designed to drive a double-balanced
mixer. (Actually it has two such output ports, I
and Q. But only the I port is used for BPSK
modulation.) Simply connect the AC output of the
generator to the IF input of the mixer, with a 50
ohm in-line (series) termination resistor at the
generator end of the cable, and an in-line
current limiting resistor (about 50 ohms) at the
mixer end of the cable. For the carrier, connect
the RF source to the RF input of the mixer. The
LO port outputs the resulting BPSK signal.
Generating
a QPSK signal is very similar, but uses both the
I & Q AC outputs of the generator, and
requires a QPSK (or I&Q) mixer/modulator.
Both connections from the generator require the
termination and current-limiting resistors.
Mini-Circuits and
other vendors sell double-balanced
mixer/modulators for typically under $200. Pomona
Electronics, Pasternack
Enterprises, and
other vendors sell in-line series resistors for
around $15 each.
What is
carrier imbalance and how can I
correct it?
In an
ideal world, the carrier of an m-sequence
modulated PSK signal would be suppressed to a
level below that of the main lobe. Specifically,
it would be suppressed by 10 log(N) dB, where N
is the period of (number of chips in) the PN
sequence. (If the sequence isn't an m-sequence,
carrier suppression isn't guaranteed.)
In the
real world, however, ideal suppression doesn't
occur for a number of reasons. For example, there
will always be a certain amount of carrier
feed-through in a real mixer. Regardless of the
cause, degradation of carrier suppression is
referred to as carrier imbalance. If sufficiently
degraded, the carrier level may actually exceed
that of the main spectral lobe.
It is
interesting to note that a small degree of
carrier imbalance may add destructively
with the natural carrier component, thus actually
improving carrier suppression. Nevertheless, this
is still considered a carrier imbalance.
Any unnatural
DC bias in a PN sequence will contribute to
carrier imbalance. (A natural DC bias will
always be present due to the fact that the number
of ones in an m-sequence always exceeds the
number of zeros by one within each period. This
accounts for the fact that the carrier is merely
suppressed, but not eliminated, with
m-sequences.) So, with DC coupled drivers, the DC
offset must be carefully controlled.
With AC
coupled drivers, as provided by our generators, all
DC bias is removed, both natural and unnatural,
thus resulting in no carrier component
whatsoever, not even the expected suppressed
carrier. Fortunately, while this is considered a
form of carrier imbalance, it is usually of no
concern since lack of a carrier component is
often the desired case. Still, there are ways of
correcting this if so desired.
The
easiest way of correcting carrier imbalance is by
adjusting the DC offset of the PN signal where it
enters the mixer. This is readily accomplished by
inserting a bias T on the input
port of the mixer and applying an adjustable DC
bias voltage. Simply tweak the voltage until the
desired carrier component is observed. Keep in
mind that a positive voltage will emulate an
extra 1 chip, whereas a negative voltage will
emulate an extra 0 chip.
Unfortunately,
this technique has a side effect. Because of the
inequality between the rise and fall times of the
PN signal, a code imbalance will
likely be introduced, and will manifest itself by
spectral lines appearing in the nulls of the PN
signal's frequency spectrum. If the amplitude of
these lines is acceptable, then all is well. If
not, another approach involving the use of a
pulse generator may need to be used in removing
both carrier and code imbalances. Refer to the
FAQ on code
imbalance for
more information.
What is
code imbalance and how can I
correct it?
Code
imbalance is a condition that can occur when PSK
modulating a carrier with a PN signal that has
certain types of distortion. The primary cause of
the imbalance is due to the fact that rise and
fall times in the PN signal are generally unequal
and nonuniform. Code imbalance is manifested by
spectral lines appearing in the nulls of the PSK
signal's frequency spectrum. Under ideal
conditions the nulls would be perfectly
suppressed.
There
are other, typically less prominent, causes of
spectral components in the nulls. At higher chip
rates, ripples in a PN signal will often occur as
a result of driving the non-linear input of a
balanced mixer. For example, with our generators
there is a ripple of about 5% present in the PN
signal at 20 MHz chip rates. These ripples tend
to spread a small percentage of the power from
the spectral lobes into the null regions.
A small
degree of code imbalance is often not a concern
in practical spread spectrum systems. And, in
fact, shaping filters can substantially reduce
the spectral components found in the nulls. But
in critical cases, for example when spectral
lines would defeat the purpose of signal hiding
(one of the uses of spread spectrum), the
presence of spectral lines in the nulls is
unacceptable and so must be corrected.
So how
does one eliminate code imbalance? Ironically,
the very cause of the problem can be exploited to
correct the problem. As previously mentioned, the
prominent cause is the difference in rise and
fall times of the PN signal. This phenomenon
effectively makes the ones in the PN sequence
either longer or shorter than the zeros. The
simplest method of eliminating this imbalance is
by adding a small DC bias to the PN signal,
through the use of a bias tee,
at the code input of the mixer. Simply adjust the
voltage until the spectral lines disappear.
Unfortunately,
this technique has a side effect. The added DC
bias will introduce a carrier
imbalance, which
manifests itself with a spectral line at the
carrier frequency. If the level of this line is
acceptable, then all is well. Often, however,
having a spectral line at the carrier frequency
is just as bad as having them in the nulls.
The
good news is that there is a straightforward way
of virtually eliminating both code and carrier
imbalances in one step, as well as significantly
improving amplitude distortions in the PN signal.
Many high-quality pulse generators
have a mode of operation where the output follows
the input. Depending upon the model, the name of
the mode will be something like pulse
follower mode. In this mode the
generator's output simply follows the input. But
the output of the generator will be very clean,
and adjustments can be made to eliminate code and
carrier imbalances. To remove code imbalance,
tweak the input trigger level of the generator.
To remove carrier imbalance, tweak the output
offset level. You also have the luxury of being
able to adjust the output amplitude level as well
as the rise/fall times, if so desired, to
optimize mixer driving characteristics.
| Problems
Encountered using PN Sequence Generators |
Looking
at a PSK modulated signal, my spectrum analyzer
reveals a low carrier spectral line,
much lower in magnitude than what theory would
suggest. What is causing this and how can I
correct it?
The AC
output of our generators has a DC blocking
capacitor that removes all DC bias from the PN
sequence. This effectively removes the carrier
component of the spread spectrum signal. Refer to
the FAQ on carrier
imbalance for
more information, including methods for restoring
the carrier component.
Looking
at a PSK modulated signal, my spectrum analyzer
reveals a spectral line in the middle of
the main lobe, right at the carrier
frequency. What is causing this and how can I
correct it?
If the
sequence you are using is non-maximal (i.e. not
an m-sequence), the code may be highly imbalanced
(a lot more ones than zeros, or vice-versa),
which can cause a significant carrier component
to appear. This is normal.
But if
the sequence is an m-sequence, you may have a
defective mixer. Or you may be connecting the
generator to the mixer incorrectly. Refer to the
FAQ on mixer
connections for
instructions on driving a double-balanced mixer.
If you
still have a problem after confirming correct
mixer setup, and you're sure you are generating
an m-sequence, the problem may be due to carrier
imbalance. Refer to the FAQ on carrier
imbalance for
more information.
Looking
at a PSK modulated signal, my spectrum analyzer
reveals spectral lines in the nulls
of the frequency spectrum. What is causing this
and how can I correct it?
You may
have a defective mixer, or you may be connecting
the generator to the mixer incorrectly. Refer to
the FAQ on mixer
connections for
instructions on driving a double-balanced mixer.
If you
still have a problem after confirming correct
mixer setup, the problem may be due to code
imbalance. Refer to the FAQ on code
imbalance for
more information.
Looking
at a PSK modulated signal, my oscilloscope
reveals ripples in the envelope
of the signal. What is causing this and how can I
correct it?
If the
chip rate is high (>5 MHz) and the ripple is
about +/- 5% or less, this is to be expected. The
distortion is a result of the non-linearity of
the code input port of the mixer.
While
this distortion is of little consequence in many
situations, in others it may be unacceptable.
Refer to the FAQ on code
imbalance for
more information regarding the consequence of
this distortion, and for a technique to correct
it.
If the
ripple is greater than +/-5%, or occurs even at
low chip rates (<2 MHz), you may be connecting
the generator to the mixer incorrectly. Refer to
the FAQ on mixer
connections for
instructions on driving a double-balanced mixer.
Relevant
Search Terms
For the
benefit of those searching the Web,
following are search terms relevant to
this page:
PRBS
Generator
Pseudorandom Code Generator
Pseudorandom Codes
Pseudorandom Noise Generator
Pseudorandom Sequence Generator
Pseudorandom Sequences
Pseudorandom Binary Sequence Generator
Pseudorandom Binary Sequences
|
|