PN Sequence - SNS Courseware

11
PN Sequence 10/10/2019 1/11 snsce/ece/ec8395/siddharthan/pn sequence

Transcript of PN Sequence - SNS Courseware

PN Sequence

10/10/2019 1/11 snsce/ece/ec8395/siddharthan/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

10/10/2019 2/11 snsce/ece/ec8395/siddharthan/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 10/10/2019 3/11 snsce/ece/ec8395/siddharthan/pn

sequence

A 15-stage PN generator using shift

register

10/10/2019 4/11 snsce/ece/ec8395/siddharthan/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

10/10/2019 5/11 snsce/ece/ec8395/siddharthan/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.

10/10/2019 6/11 snsce/ece/ec8395/siddharthan/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

10/10/2019 7/11 snsce/ece/ec8395/siddharthan/pn

sequence

Data recover By PN correlation

10/10/2019 8/11 snsce/ece/ec8395/siddharthan/pn

sequence

Data detection by correlation with PN

code

10/10/2019 9/11 snsce/ece/ec8395/siddharthan/pn

sequence

MATLAB CODE FOR PN

SEQUNCE

GENRATION clc;

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

10/10/2019 10/11 snsce/ece/ec8395/siddharthan/pn

sequence

OUTPUT

10 20 30 40 50 60 70 0 0

0.5

1 PN Sequence

10/10/2019 11/11 snsce/ece/ec8395/siddharthan/pn

sequence