# Pseudorandom Noise Sequence(PN sequence) Basics

PN sequence is widely used in CDMA systems for the following reasons.

• spread the bandwidth of baseband modulated signal to the much larger bandwidth before transmission

• to distiguish between different users by allocating unique PN sequences to them.

PN sequence stands for Pseudorandom Noise Sequence. Though the name suggests they are random sequences; but they are not random.
PN sequences are deterministic and periodic in nature. The same pattern repeats after some duration.
Following are important properties of a PN sequence.

• Relative frequencies of one and zero are each equal to one half.

• For 1s and 0s; half of all run lengths are of length 1; 1/4 are of length 2;1/8 are of length 3 and so on.

• If new sequence is generated by shifting original sequence by nonzero elements than
equal number of aggrements and also disaggrements exist between these two sequences.

PN sequences are generated by combining outputs of feedback shift registers. One such circuit is depicted in the figure.

## PN sequence MATLAB code

h = commsrc.pn('GenPoly', [[8 2 0]], 'Mask', [1 0 0 0 0 0 1 0]);

set(h, 'NumBitsOut', 1023);

pnseq = generate(h);

for k=1:length(pnseq)

if(pnseq(k) == 0)

pnseq(k) = -1;

end

end

maxpeak = xcorr(pnseq,pnseq);

plot(maxpeak);

## Useful Links to MATLAB codes

Refer following as well as links mentioned on left side panel for useful MATLAB codes.

PTS for PAPR reduction

OFDM Preamble generation

Time off estimation corr

Freq off estimation corr

channel estimation

11a WLAN channel

11g WLAN channel

15.3 UWB channel

15.4a UWB channel

16d SUI Channel

16e wimax channel

Rician channel

Rayleigh channel

SC-FDMA

PN sequence generation

3D plotting

AM FM PM modulation

CRC8 CRC32

## RF and Wireless tutorials

WLAN 802.11ac 802.11ad wimax Zigbee z-wave GSM LTE UMTS Bluetooth UWB IoT satellite Antenna RADAR