Вы находитесь на странице: 1из 17

# PSEUDO RANDOM

INTERLEAVER
BY
SHUBHAM SRIVASTAVA

CHAPTER 1
PSEUDO RANDOM INTERLEAVER
Interleaving is a process of rearranging the ordering of a data sequence in a one to one deterministic
format.Interleaving is a practical technique to enhance the error correcting capability of coding.

## BASIC PROCESS OF INTERLEAVING

Random interleavers scramble the data of different users with different pattern. Patterns of scrambling
the data of users are generated arbitrarily. Because of the scrambling of data, burst error of the channel
is randomized at the receiver side.

a pseudo random interleaver also scramble the data of different users with different pattern but
patterns of scrambling the data of users are deterministic using certain mathematical expressions.
Thats why I named this interleaver as pseudo random interleaverbecause it is not truly random
interleaver..the sequence is being generated using some mathematical formulas..

## ALGORITHM OF SCRAMBLING DATA IN PSEUDO

RANDOM INTERLEAVER..
Suppose there are N users and M chips to be transferred by each User..
We take X0=1 (can be any value.it is just for initialization)
Let p is a vector containing sequence of chips before interleaving for each user
p[]=[1 2 3 4 5 6 . . . . . .M]
now for each chip we calculate
Xn=AXn-1+Cm
Where A and C are interleaver constants..we can choose their values..every different value results in
different pattern..for same values of A and C pattern of interleaving remains same
And m is chip number of the user ..
Here, try not to use even values for A and C as they will result each time value of X n even,which is not
advisable.we should use prime values for A and Chowever odd values can also be takenbut odd
values are not good in more randomness as done by prime values
Then
We take remainder of Xn when divided by M (chip length or number of chips).let that remainder is r.if
r=0,then we set r=M.
We then swap values of p(m) and p(r)..
We repeat this for every chip of each user
In the end we will get new vector p containing new sequence of chips..
While moving to user number 2 from user 1 we will have value of XM , then we will calculate XM+1 I from
this XM .it means we donot initialize every time we jump from one user to another.However, we may
need to initialize this Xn if value of Xn is going out of capacity of programming languagewe fix an upper
limit for Xn. I have used upper limit for Xn as 10000000000000000000000000 in MATLAB. However any
one can use any upper limit value.but receiver should be aware of this upper cut valuewe can
standardize any particular value as upper value..so we donot need to transfer this value..if value of Xn
goes greater than this value,then we again initialize value of Xn as m+n, where m is chip number and n is
user numberwe can initialize it to any valueI have used m+n to have more randomness
Examples
1.Taking A=17,C=13.no of users=7 and chip length per user= 6, then sequence before interleaving is

Each row tells sequence for each user..for example row number 4 tells chip sequence to be transferred
for user number 4there are 7 users and chip length is 6
Now sequence after interleaving using pseudo random interleaver is
1

## Let us see what happens if receiver also use this algorithm

1

The same sequence is generated at receiver provided receiver should know the value of A and C
Therefore,we just need to transfer values of A,C and chip length to receiverinstead of above whole
matrix..

## MATLAB CODING OF PSEUDO RANDOM INTERLEAVER

clear;
clc
n=15;
%NUMBER OF USERS
chiplen=12;
%NUMBER OF CHIPS PER USER
a=19;
%VALUE OF PSEUDO RANDOM INTERLEAVER CONSTANT 'A'
c=7;
%VALUE OF PSEUDO RANDOM INTERLEAVER CONSTANT 'C'
k1=1;
% INITIAL VALUE X0
for i=1:n
for j=1:chiplen
pi1(j)=j;
scrambrule1(i,j)=j;
% INPUT PATTERN
end
for j=1:chiplen
k1=a*k1+c*j;
% calculating Xn
if (k1>=10000000000000000000000000) % that is just a UPPER LIMIT i
% have taken for k1 or you can say Xn
k1=i+j;
end
k=rem(k1,chiplen);
if (k==0)
k=chiplen;
end
tmp=pi1(j);
pi1(j)=pi1(k);
pi1(k)=tmp;
end
for j=1:chiplen
scrambrule(i,j)=pi1(j);
end
end
scrambrule1
scrambrule

## %SHOWING INPUT SEQUENCE

%SHOWING OUTPUT SEQUENCE

scrambrule1 =
1

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

9 10 11 12

scrambrule =
7

5 11 10 12

4 12

1 10

2 11

4 10

1 11

7 12

5 11 10

2 12

7 10

6 12

4 11

8 12

6 11

4 10

4 12

5 10

9 11

3 10

4 12

9 11

9 10

5 12

2 11

5 10

4 11

6 12

9 11 10 12

12

5 11

11

4 12

8 10

5 10

1 10

9 10

1 11

9 12

9 11

6 12

>>

## TREE BASED INTERLEAVER VERSUS PSEUDO RANDOM

INTERLEAVER
if input sequence is
1

## Then output sequence using tree based interleaver I got

2

Not only this I have also got sequence for those users which are not present yet but system calculates
their sequence too because of number of levels presentso additional sequences are
1

However,there are 7 users present,but system calculates sequence of 14 users out of which 7 are absent
and only 7 are present..7 are not needed to be calculated..
This increases the complexity in calculation..
Also we need to transfer first two rows of interleaving sequence in tree based interleaver as receiver
donot know themeverytime we run the same program of tree based interleaver,we will get different
sequence.
Here if we run the same program again for same input chip sequence given above,we will get
6

## We will get entirely different matrix.therefore,because of mechanism of tree based interleaver,we

need to transfer two entire rows.
However,in pseudo random interleaver,we just need to transfer the values of A,C and chip
lengthonly 3 values.therfore very less bandwidth is required in the case of pseudo random
interleaver in comparison to tree based interleaver ,when a large number of chips is to be transferred
by each user..

## PSEUDO RANDOM INTERLEAVER VERSUS PRIME INTERLEAVER

If any one look at pseudo random interleaver , we need to transfer 3 values here(A,C,chip length),and in
prime interleaver we just need to transfer 1 value i.e.,chip lengththen how our pseudo random
interleaver is better than prime interleaver??
In order to understand this,we should look at the purpose of A and C values..
By changing values of A and C,we can change the chip sequence randomness
For example,if A=17,C=13,number of users=7 and chiplength=6,then
input pattern of chip sequence for each user corresponding to each row is
1

1

1

## However if we change the values of A and C

Taking A=11 and C=19 for the same input pattern and input condition,we get output pattern as
3

This pattern will remain same until we donot change the values of A and Chow many times we run the
program this above matrix will remain same
So we can change the chip sequence by using different values of A and C..we can change the
randomness of chip sequences here

## But in prime interleaver

For same input pattern containing number of users=7 and number of chips=6
We get output sequence as
6

We will get same output sequence if we run it second time for same input chip sequence
6

So we cannot change transmitted pattern in prime interleaver to check for more randomness..
however,we can change the transmitted pattern sequence in pseudo random interleaver by changing
values of A and Cchoose that value of A and C by which we are getting less BER
If any system still has problem with 3 values being transferred in pseudo random interleaver,
then we can standardize values of A and C for that system,then we need to transfer only 1 value as in
prime interleaver..

Now we are going to put this code in the code of idma under awgn channel and see the result

CHAPTER 2

## PSEUDO RANDOM INTERLEAVER IN AWGN CHANNEL

RESULTS COMPARISON TO TREE BASED INTERLEAVER
The result of pseudo random interleaver in awgn channel with a=19 and C=7 with 16 users,250 blocks
and datalength 512 is below:
-1

10

-2

## Bit Error Rate for 12 users coded

10

-3

10

-4

10

-5

10

-6

10

-7

10

6
Eb/No

the result of tree based interleaver in AWGN channel with 16 users,250 blocks and 512 data length is
given below:

-1

10

-2

10

-3

## Bit Error Rate

10

-4

10

-5

10

-6

10

-7

10

6
Eb/No

So,the results look quite similar in comparison to tree based interleaver,but these results are on A=19
and C=7 in pseudo random interleaver,but it is quite possible that there may be any value of A and C for
which we can get better results..
Take a look at one more example.
With A=19 and c=7 as usual and taking 32 users with 250 block length and 512 data length..the output of
pseudo random interleaver in AWGN channel is

10

-1

## Bit Error Rate for 12 users coded

10

-2

10

-3

10

-4

10

-5

10

-6

10

-7

10

10

11

12

Eb/No

And in same conditions for 32 users with 250 block length and 512 data length..the output of tree based
interleaver in AWGN channel is

10

-1

10

-2

10

-3

10

-4

10

-5

10

-6

10

-7

10

10

11

12

Eb/No

## LET US LOOK AT ANOTHER EXAMPLE.

IN PSEUDO RANDOM INTERVAL
With A=19 and C=7 with 16 users,200 blocks and 256 datalength,the BER results are given below

-1

10

-2

10

-3

10

-4

10

-5

10

-6

10

6
Eb/No

-1

10

-2

## Bit Error Rate

10

-3

10

-4

10

-5

10

3.5

4.5
Eb/No

5.5

So the results of pseudo random interleaver are quite better than tree based interleaver here in this
condition
So this pseudo random interleaver requires more attention because it is always possible that for some
value of A and C,the results are better than that given by tree based interleaver,prime interleaver and
master random interleaver

THANKING YOU
SHUBHAM SRIVASTAVA