You are on page 1of 5

G. S.

Sanyal School of Telecommunications


Indian Institute of Technology Kharagpur

MOOC: Spread Spectrum Communications & Jamming

Assignment 4: Solution to MATLAB code generation of Kasami code


and check its correlation properties.
Due date: Max. marks: 20

Write a MATLAB code to generate small set Kasami code of length 15 using m-sequence
generated by the linear feedback shift register configuration shown in Fig. 1 with corre-
sponding generator polynomial x4 + x + 1. The initial shift register state is ’0011’. Based on
the results obtained during the simulation run, answer the following questions.
Solution:
Important note: The complete MATLAB code which solves this assignment is
provided in the Appendix section of this document.

1. The m-sequence generated with the linear feedback shift register configuration as shown
in Fig. 1 (assuming that the most significant bit represents the first output bit) is: (3
marks)
Solution: Refer to line number 17-25 of the appended MATLAB code. The resultant
sequence is 001111010110010. (correct option ii.)

1 0 0 1
1 1 0 0 O/P
clock

Figure 1: Linear Feedback Shift Register

1
2. The decimated sequence generated based on the m-sequence obtained in question 1 is:
(3 marks)
Solution: The decimated sequence is obtained by taking every d-th chip from the
generated m-sequence – where d = 2k + 1 with k = log2 (15 + 1)/2 – and repeating these
2k − 1 chips 2k + 1 times. Decimated sequence is generated in line number 30 of the
appended MATLAB code. The resultant sequence is 110110110110110.
(correct option i.)
3. The Kasami code generated by bit wise ’XOR’ operation of the m-sequence (obtained
in question 1) and the decimated sequence (obtained for question 2) is: (2 marks)
Solution: Refer to line number 32 of the appended MATLAB code. The resultant
sequence is 111001100000100.
(correct option iv.)
4. Circular right shift of the decimated sequence (obtained in question 2) by an amount
of 7 results in the sequence:(2 marks)
Solution: In the line number 34 of the appended MATLAB code, circshift(temp seq’,7)’
generates desired the result which is 011011011011011
(correct option iii.)
5. The Kasami code generated by bit wise ’XOR’ operation of the m-sequence (obtained
in question 1) and the shifted sequence (obtained in question 4) is:(2 marks)
Solution: Refer to line number 34 of the appended MATLAB code. The resultant
Kasami code is 010100001101001.
(correct option iv.)
6. Periodic autocorrelation of the Kasami code obtained in question 3 (in bipolar form.
i.e., a binary ’0’ is represented by the signal level ’-1’) is:
Hint:Periodic autocorrelation and crosscorrelation functions are defined as:
M −1
cim cim+ν
X
φauto (ν) =
m=0
M −1
cim cjm+ν ,
X
φcross (ν) =
m=0

where cimdenotes m-th sample of i-th Kasami code with length M . It should be noted
that cim+ν = cin if rem(m + ν, M ) = n, where rem(x, y) is the remainder of the division
of x by y. (4 marks)
Solution: Refer to line numbers 37-43 of the appended MATLAB code. The resultant
plot obtained on executing the stem command in line number 47 of the appended code
generates the desired figure.
(correct option iii.)

2/5
7. Periodic crosscorrelation between the Kasami codes obtained in questions 3 and 5 (in
bipolar form. i.e., a binary ’0’ is represented by the signal level ’-1’) is:(4 marks)
Solution: Refer to line numbers 37-43 of the appended MATLAB code. The resultant
plot obtained on executing the stem command in line number 52 of the appended code
generates the desired figure
(correct option ii.)

3/5
Appendix

4/5
5/5

You might also like