PN Sequence
Presented By:
Darshil shah (I1241090051)
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
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
A 15-stage PN generator using shift
register
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
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.
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
Data recover By PN correlation
Data detection by correlation with PN
code
MATLAB CODE FOR PN SEQUNCE
GENRATIONclc;
clear all;
close all;
x1=[1 1 1 1 1 1];
n1=length(x1);
len1=2^n1-1;
p1(1,1) = x1(1,1);
z1 = x1;
for y1 = 2 : len1
x1=z1;
for i = 1 : n1
if (i==1)
z1(1,i) = xor (x1(1,5),x1(1,6));
else
z1(1,i) = x1(1,i-1);
end
end
p1(1,y1)=z1(1,6);
end
subplot 211;
stem (p1);
OUTPUT
0 10 20 30 40 50 60 70
0
0.5
1
PN Sequence
Example of PN Sequence
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
Pn sequence

Pn sequence

  • 1.
  • 2.
    OUTLINE • What isPN 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 PNcode? 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
  • 4.
    A 15-stage PNgenerator using shift register
  • 5.
    Properties of PNsequence • 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 Generatorblock 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 thefirst 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
  • 8.
    Data recover ByPN correlation
  • 9.
    Data detection bycorrelation with PN code
  • 10.
    MATLAB CODE FORPN SEQUNCE GENRATIONclc; clear all; close all; x1=[1 1 1 1 1 1]; n1=length(x1); len1=2^n1-1; p1(1,1) = x1(1,1); z1 = x1; for y1 = 2 : len1 x1=z1; for i = 1 : n1 if (i==1) z1(1,i) = xor (x1(1,5),x1(1,6)); else z1(1,i) = x1(1,i-1); end end p1(1,y1)=z1(1,6); end subplot 211; stem (p1);
  • 11.
    OUTPUT 0 10 2030 40 50 60 70 0 0.5 1 PN Sequence
  • 12.
    Example of PNSequence
  • 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

  • #5 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 …………………………………………………….
  • #6  IN EQUAL RUNS ::::: EXAMPLE OF COIN