2. OUTLINE
• What is PN code?
• A 15-stage PN generator.
• Properties of PN sequence.
• Data detection by correlation with PN code.
• Application of PN sequence.
• MAT-Lab Simulation for PN sequence generation.
• Example of PN sequence
3. What is PN code?
1. A bit sequence that is random within the sequence length
but repeats indefinitely
2. All its properties are predictable, if we know how it is
generated
3. Easy to generate and synchronize
4. Other names:
• Pseudo random bit sequences (PRBS)
• m-sequences
• Maximal length sequences
5. Properties of PN sequence
• 1’s and 0’s occur with equal probability
• Adding a shifted version to a PN sequence gives same PN
sequence (in different phase)
• High auto-correlation, low cross-correlation
• Power spectrum contains all frequencies with sin2x/x2
envelop
6. Reset Signal
Properties
PN Sequence
Generator block
Reset Signal
Output Signal
Sample-based
Sample time = 1
Sample-based
Sample time = 1
Frame-based
Sample time =1
Samples per
frame = 2
Frame-based
Sample time = 1
Samples per
frame = 2
Sample-based
Sample time = 2
Samples per
frame = 1
Frame-based
Sample time = 1
Samples per
frame = 2
Resetting a Signal
Suppose that the PN Sequence Generator block outputs [1 0 0 1 1 0 1 1] when there is no
reset. You then select the Reset on nonzero input check box and input a reset signal [0 0 0 1].
The following table shows three possibilities for the properties of the reset signal and the PN
Sequence Generator block.
7. 1. In the first two cases, the PN sequence is reset at the fourth
bit, because the fourth bit of the reset signal is a 1 and the
Sample time is 1. Note that in the second case, the frame
sizes are 2, and the reset occurs at the end of the second
frame.
2. In the third case, the PN sequence is reset at the seventh bit.
This is because the reset signal has Sample time 2, so the
reset bit is first sampled at the seventh bit. With these
settings, the reset always occurs at the beginning of a frame
14. References
• Digital Communication: Theory, Techniques and Applications by
R N Mutagi
• http://www-
rohan.sdsu.edu/doc/matlab/toolbox/commblks/ref/pnsequencege
nerator.html
• http://www.xilinx.com/support/documentation/application_notes/
xapp211.pdf
• https://archive.org/details/BetterPnGeneratorsForCdmaApplication
AVerilog-hdlImplementation
Editor's Notes
16BIT DATA TRANSMITTED+USING XOR AT THE LAST TWO BITS AS SHOWN IN FIG+USE SHIFT REGISTER+AND AGAIN XOR PROCESS+ AND CONT…..+OUTPUT AS PN DATA …………………………………………………….