Assignment Document

Wireless and Mobile Communications Lab

Pages:

Preview:


  • "Wireless and Mobile Communications LabAssignment:a. Create an m file b. Implement a CDMA Transmitter 1. Generate Data Bits for four users 2. Apply BPSK to each 3. Convert the bits into pulse. 4. Generate four different Spread Codes. 5. Implement CDM..

Preview Container:


  • "Wireless and Mobile Communications LabAssignment:a. Create an m file b. Implement a CDMA Transmitter 1. Generate Data Bits for four users 2. Apply BPSK to each 3. Convert the bits into pulse. 4. Generate four different Spread Codes. 5. Implement CDMA technique for four users. c. Plot all the results.MATLAB Solution:Generated bits for 4 usersu1 = randi([0,1], 1, 15);u2 = randi([0,1], 1, 15);u3 = randi([0,1], 1, 15);u4 = randi([0,1], 1, 15);U_1=2*u1-1;U_2=2*u2-1;U_3=2*u3-1;U_4=2*u4-1;Making all the four users data a square wave squarewave=ones(1,8);U1 = [];for i = 1:1:15n = U_1(i)*squarewave;U1 = [U1 n];endU2 = [];for i = 1:1:15n = U_2(i)*squarewave;U2 = [U2 n];endU3 = [];for i = 1:1:15n = U_3(i)*squarewave;U3 = [U3 n];endU4 = [];for i = 1:1:15n = U_4(i)*squarewave;U4 = [U4 n];endCodecsSC1=[1,1,1,1,1,1,1,1];SC2=[1,1,1,1,-1,-1,-1,-1];SC3=[1,1,-1,-1,1,1,-1,-1];SC4=[1,1,-1,-1,-1,-1,1,1];Adding the codecs to the square wavesUSC1=[];for i=1:1:15n = U1((8*(i-1)+1):(8*i)).*SC1;USC1 = [USC1 n];endUSC2=[];for i=1:1:15n = U2((8*(i-1)+1):(8*i)).*SC2;USC2 = [USC2 n];end USC3=[];for i=1:1:15n = U3((8*(i-1)+1):(8*i)).*SC3;USC3 = [USC3 n];endUSC4=[];for i=1:1:15n = U4((8*(i-1)+1):(8*i)).*SC4;USC4 = [USC4 n];endSum of all coded data streamsUSC=USC1+USC2+USC3+USC4;Case 1 (Without Noise and Interference)R1=[];for i=1:1:15n=USC((8*(i-1)+1):(8*i)).*SC1;if (sum(n)>0)R1=[R1 1];elseR1=[R1 0];endendR2=[];for i=1:1:15n=USC((8*(i-1)+1):(8*i)).*SC2;if (sum(n)>0)R2=[R2 1];elseR2=[R2 0];endendR3=[];for i=1:1:15n=USC((8*(i-1)+1):(8*i)).*SC3;if (sum(n)>0)R3=[R3 1];elseR3=[R3 0];end endR4=[];for i=1:1:15n=USC((8*(i-1)+1):(8*i)).*SC4;if (sum(n)>0)R4=[R4 1];elseR4=[R4 0];endendCase 2 (Adding Noise)NUSC=awgn(USC,20);NR1=[];for i=1:1:15n=NUSC((8*(i-1)+1):(8*i)).*SC1;if (sum(n)>0)NR1=[NR1 1];elseNR1=[NR1 0];endendNR2=[];for i=1:1:15n=NUSC((8*(i-1)+1):(8*i)).*SC2;if (sum(n)>0)NR2=[NR2 1];elseNR2=[NR2 0];endendNR3=[];for i=1:1:15n=NUSC((8*(i-1)+1):(8*i)).*SC3;if (sum(n)>0)NR3=[NR3 1];elseNR3=[NR3 0];endendNR4=[];for i=1:1:15n=NUSC((8*(i-1)+1):(8*i)).*SC4;if (sum(n)>0)NR4=[NR4 1];elseNR4=[NR4 0]; endendBit Error Rateerror1=nnz(u1-NR1);BER1=(error1/4)/15error2=nnz(u2-NR2);BER2=(error2/4)/15error3=nnz(u3-NR3);BER3=(error3/4)/15error4=nnz(u4-NR4);BER4=(error4/4)/15BER1 = 0BER2 = 0BER3 = 0BER4 = 0Case 3 (interference)IUSC=USC+USC3;IR1=[];for i=1:1:15n=IUSC((8*(i-1)+1):(8*i)).*SC1;if (sum(n)>0)IR1=[IR1 1];elseIR1=[IR1 0];end endIR2=[];for i=1:1:15n=IUSC((8*(i-1)+1):(8*i)).*SC2;if (sum(n)>0)IR2=[IR2 1];elseIR2=[IR2 0];endendIR3=[];for i=1:1:15n=IUSC((8*(i-1)+1):(8*i)).*SC3;if (sum(n)>0)IR3=[IR3 1];elseIR3=[IR3 0];endendIR4=[];for i=1:1:15n=IUSC((8*(i-1)+1):(8*i)).*SC4;if (sum(n)>0)IR4=[IR4 1];elseIR4=[IR4 0];endendBit Error Rateerror1=nnz(u1-IR1);BER1=(error1/4)/15error2=nnz(u2-IR2);BER2=(error2/4)/15error3=nnz(u3-IR3);BER3=(error3/4)/15error4=nnz(u4-IR4);BER4=(error4/4)/15BER1 = 0BER2 = 0 BER3 = 0BER4 = 0Case 4 (Interference and Noise)NIUSC=awgn(USC,20)+USC3;NIR1=[];for i=1:1:15n=NIUSC((8*(i-1)+1):(8*i)).*SC1;if (sum(n)>0)NIR1=[NIR1 1];elseNIR1=[NIR1 0];endendNIR2=[];for i=1:1:15n=NIUSC((8*(i-1)+1):(8*i)).*SC2;if (sum(n)>0)NIR2=[NIR2 1];elseNIR2=[NIR2 0];endendNIR3=[];for i=1:1:15n=NIUSC((8*(i-1)+1):(8*i)).*SC3;if (sum(n)>0)NIR3=[NIR3 1];elseNIR3=[NIR3 0];endendNIR4=[];for i=1:1:15n=NIUSC((8*(i-1)+1):(8*i)).*SC4;if (sum(n)>0)NIR4=[NIR4 1];elseNIR4=[NIR4 0]; "

Why US?

Because we aim to spread high-quality education or digital products, thus our services are used worldwide.
Few Reasons to Build Trust with Students.

128+

Countries

24x7

Hours of Working

89.2 %

Customer Retention

9521+

Experts Team

7+

Years of Business

9,67,789 +

Solved Problems

Search Solved Classroom Assignments & Textbook Solutions

A huge collection of quality study resources. More than 18,98,789 solved problems, classroom assignments, textbooks solutions.

Scroll to Top