⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 conv_encoder.m

📁 The result is an IS-95CDMA forward link software simulation package ,which mimics real-time data com
💻 M
字号:
function conv=Conv_Encoder(info)

%This is the Convolution Encoder. We pass our data (192 bit, a 20ms frame)into the Convolution Encoder R=1/2, k=9 R=input bits/output bits. K=9 means 9 stage shift register is used

%There is two generator sequences g0(752 octal),g1(561 octal)
%g0=[111101011];%753octal
%g1=[101110001];%561octal
%we reset our9 shift registers to reset state, all `0`s 

shifts=zeros([1,9]);

convo=zeros([1,384]);

for i=1:length(info)

%each stage of shift register gets the value from the previous one,except the first
shifts(2:9)=shifts(1:8);

%the next data bit comes into the first shift register 

shifts(1)=info(i);

%calculate the first code bit using g0
outa=mod((shifts(1)+shifts(2)+shifts(3)+shifts(4)+shifts(6)+shifts(8)+shifts(9)),2);

outb=mod((shifts(1)+shifts(3)+shifts(4)+shifts(5)+shifts(9)),2);

convo((i*2)-1)=outa;
convo(i*2)=outb;

end

conv=convo;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -