% main nae comments add kar diae hain. Agar phir bhi samaj na ae to
% directly command window main code run kar ke check kar laina. agar phir
% bhi samaj na ae to muje call kar laina
%first of all we will generate a rondom code
%then we create its gold sequence
%then in the end we will make its speread spectrum
% then after reciving thet signal
%first we will recive its speread spectrum
%then we create its gold sequence
%in the end we will get that rondom code again
clc;
close all;
clear all;
b=round(rand(1,20)); %generates rand no 1 or zero
pattern=[]; % array declare ki hai
for k=1:20 % loop which starts from 1 and end at 20
if (b(1,k)==0) %if b(x,x) is equal to zero, assign sig zero
%sig is integer
sig=zeros(1,6); % add 6 zeros instead of one
else
sig=ones(1,6); %if b(x,x) is equal to one, assign sig one
%sig is integer
end
pattern=[pattern sig]; %concatination (means join karna)
end
b1=b;
message=b1;
message1=pattern;
subplot(3,2,1);
plot(pattern)
axis([-1 120 -.5 1.5]); %x-axis -1 to 120 and y-axis -.5 to 1.5
ylabel('\bf Code Sequence')
title('\bf Transmited')
%--------------------------
%gold code
Goldcode=((randint(1,20))>.5)+0; %specific code apply kia hai code par
% jis ke pass ye code ho ga sirf wohi is
% code ko dobara recover kar sake ga
GC=[];
for k=1:20
if (Goldcode(1,k)==0)
s=zeros(1,6); % add 6 zeros instead of one (ta ke plot clear ho jae)
else
s=ones(1,6); % add 6 zeros instead of one
end
GC=[GC s]; %concatination
end
subplot(3,2,3);
plot(GC);
axis([-1 120 -.5 1.5]); %x-axis -1 to 120 and y-axis -.5 to 1.5
ylabel('\bf GOLD Sequence')
% Spreading the pattern with the gold code
k=1;
for i=1:20
for j=1:20
spread(1,k)=xor(b1(1,i),Goldcode(1,j)); %ye modulation ke taran hai
k=k+1;
end
end
spread;
subplot(3,2,5);
plot(spread);
axis([-1 400 -.5 1.5]);
ylabel('\bf Spreaded Sequence')
%-----------Recived--------upper wala spread spectrum humain recive ho gya
%hai.....jo kaam upper kia hai us ka inverse is se niche kia hai
i=1;
k=1;
los= length(spread);
while k < los
s=0;
for j=1:20
temp(1,j) = xor(spread(1,k),Goldcode(1,j));
k=k+1;
s=s+temp(1,j);
end
if(s==0)
b2(1,i) = 0;
else
b2(1,i) = 1;
end
i=i+1;
end
despreaded_signal = b2;
%demodulade signal
pattern=[];
for k=1:20
if b2(1,k)==0
sig=zeros(1,6);
else
sig=ones(1,6);
end
pattern=[pattern sig];
end
subplot(3,2,2);
plot(spread);
axis([-1 400 -.5 1.5]);
ylabel('\bf Spreaded Sequence')
title('\bf Recived')
subplot(3,2,4);
plot(GC);
axis([-1 120 -.5 1.5]); %x-axis -1 to 120 and y-axis -.5 to 1.5
ylabel('\bf GOLD Sequence')
subplot(3,2,6);
plot(pattern)
axis([-1 120 -.5 1.5]); %x-axis -1 to 120 and y-axis -.5 to 1.5
ylabel('\bf Code Sequence')
CDMA.zip_cdma_cdma matlab_zip
版权申诉
122 浏览量
2022-09-20
22:22:41
上传
评论
收藏 1KB ZIP 举报
小波思基
- 粉丝: 74
- 资源: 1万+
最新资源
- 使用ASP.NET Core和Entity Framework Core来构建一个基本的进销存系统.rar
- 深度学习经典数据集+FER2013面部表情识别+附带使用方法的python代码
- Python中,要实现连接多个相机并识别多个二维码.rar
- 使用FFT算法对一个信号进行分析.rar
- 171cms游戏应用下载系统源码.zip
- 基于jsp+servlet+mysql蛋糕甜品店购物网站源码+数据库(期末大作业).zip
- Java项目:在线蛋糕商城系统(java+jsp+mysql)源码+数据库+期末大作业.zip
- ZapyaClient10_7-1.apk
- 织梦cms站长导航网站源码.zip
- 基于SSM+MySQL的网络投票调查问卷系统源码+数据库(java期末大作业).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈