?? conv_encoder.m
字號(hào):
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;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -