Upload
darshil-shah
View
54
Download
2
Embed Size (px)
Citation preview
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 700
0.5
1PN 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/pnsequencegenerator.html
• http://www.xilinx.com/support/documentation/application_notes/xapp211.pdf
• https://archive.org/details/BetterPnGeneratorsForCdmaApplicationAVerilog-hdlImplementation