扩频通信基于matlab扩频通信系统仿真含Matlab源码 968期
Posted 紫极神光
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了扩频通信基于matlab扩频通信系统仿真含Matlab源码 968期相关的知识,希望对你有一定的参考价值。
一、简介
二、源代码
% the basic codes from the generating poly from the book spread spectrum applications on commercial systems
function[code1, code2] = BasicSeq(m)
N = 2^m - 1;
sreg = [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1]; % register for code 1
sreg2 = [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1]; % register for code 2
code1 = zeros(1, N);
code2 = zeros(1, N);
switch m
case 3
for i=1:N
code1(i) = sreg(m);
first = mod(sreg(2) + sreg(3), 2);
sreg = circshift(sreg, [0, 1]);
sreg(1)=first;
code2(i) = sreg2(m);
first2 = mod(sreg2(1) + sreg2(3), 2);
sreg2 = circshift(sreg2, [0, 1]);
sreg2(1)=first2;
end
case 5
for i=1:N
code1(i) = sreg(m);
first = mod(sreg(3) + sreg(5), 2);
sreg = circshift(sreg, [0, 1]);
sreg(1)=first;
code2(i) = sreg2(m);
first2 = mod(sreg2(1) + sreg2(2) + sreg2(3) + sreg2(5), 2);
sreg2 = circshift(sreg2, [0, 1]);
sreg2(1)=first2;
end
case 7
for i=1:N
code1(i) = sreg(m);
first = mod(sreg(4) + sreg(7), 2);
sreg = circshift(sreg, [0, 1]);
sreg(1)=first;
code2(i) = sreg2(m);
first2 = mod(sreg2(4) + sreg2(5) + sreg2(6) + sreg2(7), 2);
sreg2 = circshift(sreg2, [0, 1]);
sreg2(1)=first2;
end
case 8
for i=1:N
code1(i) = sreg(m);
first = mod(sreg(1) + sreg(2) + sreg(3) + sreg(6) + sreg(7) + sreg(8), 2);
sreg = circshift(sreg, [0, 1]);
sreg(1)=first;
code2(i) = sreg2(m);
first2 = mod(sreg2(1) + sreg2(2) + sreg2(7) + sreg2(8), 2);
sreg2 = circshift(sreg2, [0, 1]);
sreg2(1)=first2;
end
case 9
for i=1:N
code1(i) = sreg(m);
first = mod(sreg(5) + sreg(9), 2);
sreg = circshift(sreg, [0, 1]);
sreg(1)=first;
code2(i) = sreg2(m);
first2 = mod(sreg2(3) + sreg2(5) + sreg2(6) + sreg2(9), 2);
sreg2 = circshift(sreg2, [0, 1]);
sreg2(1)=first2;
end
case 10
for i=1:N
code1(i) = sreg(m);
first = mod(sreg(7) + sreg(10), 2);
sreg = circshift(sreg, [0, 1]);
sreg(1)=first;
code2(i) = sreg2(m);
first2 = mod(sreg2(2) + sreg2(7) + sreg2(8) + sreg2(10), 2);
sreg2 = circshift(sreg2, [0, 1]);
sreg2(1)=first2;
end
case 11
for i=1:N
code1(i) = sreg(m);
first = mod(sreg(9) + sreg(11), 2);
sreg = circshift(sreg, [0, 1]);
sreg(1)=first;
code2(i) = sreg2(m);
first2 = mod(sreg2(3) + sreg2(8) + sreg2(9) + sreg2(11), 2);
sreg2 = circshift(sreg2, [0, 1]);
sreg2(1)=first2;
end
end
三、运行结果
四、备注
版本:2014a
完整代码或代写加1564658423
以上是关于扩频通信基于matlab扩频通信系统仿真含Matlab源码 968期的主要内容,如果未能解决你的问题,请参考以下文章
扩频通信基于matlab直接序列扩频系统仿真含Matlab源码 1529期
扩频通信基于matlab CDMA直接序列扩频系统仿真含Matlab源码 1528期
扩频通信基于matlab扩频通信Gold序列特性仿真含Matlab源码 1522期
扩频通信基于matlab扩频+解扩仿真含Matlab源码 1495期