Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/core/open_close_dbase_connection.php on line 0

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/WCDMA-based-system-design/index.php(0) : eval()'d code on line 22

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/WCDMA-based-system-design/index.php(0) : eval()'d code on line 35

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/scripts/get_ad_type_position.php on line 0

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/scripts/load_ads.php on line 0

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/scripts/sponsor_found.php on line 0

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/scripts/load_links.php on line 0

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/WCDMA-based-system-design/index.php(0) : eval()'d code on line 161

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/WCDMA-based-system-design/index.php(0) : eval()'d code on line 164

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/WCDMA-based-system-design/index.php(0) : eval()'d code on line 167
matlab code for wcdma
projectus.freehost7.com:UG and PG level projects,mini projects and many more here ...



 

MATLAB Code for WCDMA system:

clc;

clear all;

close all;

%--------------------------------------------------------------------------%

%------------------------------TRANSMITTER-----------------------

%--------------------------------------------------------------------------%

%

data = round(rand(1,64)); % Original data

%convolution code

trellis=poly2trellis(3,[6,7]);

dataconv=convenc(data,trellis);

x=dataconv;

%convolution interleaving

nrows = 3;

slope = 2; % Interleaver parameters

D = nrows*(nrows-1)*slope; % Delay of interleaver/deinterleaver pair

x_padded = [x zeros(1,D)]; % Pad zeros at the end before interleaving.

x1 = convintrlv(x_padded,nrows,slope); % Interleaved data.

%generation of Gold code

G=120; 

           

for j=1:G       

    PN1=[PN1 lsr1(1)];

temp1 = xor(lsr1(4),lsr1(1));

temp2 = xor(lsr1(6),temp1);

temp3 = xor(lsr1(7),temp2);

temp4 = xor(lsr1(13),temp3);

temp5 = xor(lsr1(19),temp4);

for i=1:G-1

        lsr1(i)=lsr1(i+1);       %----Shifting----

    end

lsr1(120)=temp5;

end

%..............Generation of Second PN sequence..............

lsr2 =randsrc(1,120,[0 1]);     

PN2=[];                       

for j=1:G       

    PN2=[PN2 lsr2(1)];

temp1 = xor(lsr2(2),lsr1(1));

temp2 = xor(lsr2(3),temp1);

temp3 = xor(lsr2(5),temp2);

temp4 = xor(lsr2(7),temp3);

temp5 = xor(lsr2(9),temp4);

temp6 = xor(lsr2(10),temp5);

temp7 = xor(lsr2(13),temp6);

temp8 = xor(lsr2(14),temp7);

temp9 = xor(lsr2(16),temp8);

temp10 = xor(lsr2(17),temp9);

temp11 = xor(lsr2(19),temp10);

for i=1:G-1

lsr2(i)=lsr2(i+1);       %----Shifting----

end

lsr2(120)=temp11;

end

%..............Generation of Gold Codes from PN sequences..................

Code_Matrix=[];

for codes=1:K

    code=[];

for j=1:G

        code=[code xor(PN1(j),PN2(j))];

end

Code_Matrix=[Code_Matrix code'];

end

 

Gold_Code = gold_1

%spreading

k=1;

for i=1:140

 

k=k+1;

end

end

%modulation

xm=zeros(1,120*140);

j=1;

for i=1:2:120*140

    if((spread(i)==0) && (spread(i+1)==0))

   

    elseif((spread(i)==0) && (spread(i+1)==1))

        xm(j)=1;

        j=j+1;

    elseif((spread(i)==1) && (spread(i+1)==0))

        xm(j)=2;

        j=j+1;

        j=j+1;

    end

end

xmod=oqpskmod(xm);

 

 

 

%rrc filter

 

R=0.22;

Fs=8;

Fd=1;

Delay=2;

 

[xc,tc]=rcosflt(xmod,Fd,Fs,'filter',xs);

 

tempV=zeros(1,Fs-1);

xx=kron(spread,[1 tempV]);

tx_x=tc(1:length(xx))+PropD;

ynoisy=awgn(tx_x,15,'measured');

scatterplot(ynoisy);

xdemod=tx_x;

 

%demodulation

xdemod=oqpskdemod(ynoisy);

ym=zeros(1,120*140);

j=1;

for i=1:1:120*140

    if (xdemod(i)==0)

         

    elseif (xdemod(i)==1)

        ym(j)=0;

        ym(j+1)=1;

        j=j+2;

    elseif (xdemod(i)==2)

        ym(j)=1;

        ym(j+1)=0;

        j=j+2;

    elseif (xdemod(i)==3)

        ym(j)=1;

        ym(j+1)=1;

        j=j+2;

    end

   

end

 

 

 

 

 

 

%despread

for k=1:140

for j=1:120

despread1(j)=xor(tx_x((k-1)*120+j),Gold_Code(1,j));

end

sumds1=sum(despread1);

if(sumds1<60)

    despread(k)=0;

else

    despread(k)=1;

end

end

%deinterleave

y1 = convdeintrlv(despread,nrows,slope)

y1_trunc = y1(D+1:end); % Remove first D symbols.

 

%decode

tblen=5*nrows;

x_decoded = vitdec(y1_trunc,trellis,tblen,'cont','hard');

ser1 = symerr(b,x_decoded)

       

       

 

 

 

 NOTE: parts of the code may be missing:use at your own risk

or code may not be correct :can use it just as a starting structure of the program:but ocde is not fully correct