15
PN Sequence Presented By: Darshil shah (I1241090051)

Pn sequence

Embed Size (px)

Citation preview

Page 1: Pn sequence

PN Sequence

Presented By:

Darshil shah (I1241090051)

Page 2: Pn sequence

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

Page 3: 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

Page 4: Pn sequence

A 15-stage PN generator using shift register

Page 5: Pn sequence

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

Page 6: Pn sequence

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.

Page 7: Pn sequence

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

Page 8: Pn sequence

Data recover By PN correlation

Page 9: Pn sequence

Data detection by correlation with PN code

Page 10: Pn sequence

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);

Page 11: Pn sequence

OUTPUT

0 10 20 30 40 50 60 700

0.5

1PN Sequence

Page 12: Pn sequence

Example of PN Sequence

Page 13: Pn sequence
Page 14: 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

Page 15: Pn sequence