基本信息
源码名称:matlab卷积码编解码
源码大小:1.05KB
文件格式:.zip
开发语言:MATLAB
更新时间:2020-05-10
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
卷积码编解码
%msg = msg';
% check to see if extra zero padding is necessary
if rem(length(msg), k0) > 0
msg = [msg, zeros(size(1:k0-rem(length(msg),k0)))];
end
n = length(msg)/k0; % 把输入比特按k0分组,n为所得的组数。
% check the size of matrix g
if rem(size(g, 2), k0) > 0 %列数除以k0
error('Error, g is not of the right size.');
end
% determine L and n0
L = size(g, 2)/k0;
n0 = size(g, 1);%
% add extra zeros,以保证编码器是从全0开始,并回到全0状态。
u = [zeros(size(1:(L-1)*k0)), msg, zeros(size(1:(L-1)*k0))];
% generate uu, a matrix whose columns are the contents of conv. encoder at
% various clock cycles.
u1 = u(L*k0: -1 :1);
for i = 1:n L-2
u1 = [u1, u((i L)*k0:-1:i*k0 1)];
end
uu = reshape(u1, L*k0, n L-1);
% determine the output
output = reshape(rem(g*uu, 2), 1, n0*(L n-1));
len_tal = n0*(L n - 1);
卷积码编解码
len=length(msg);
%msg = msg';
% check to see if extra zero padding is necessary
if rem(length(msg), k0) > 0
msg = [msg, zeros(size(1:k0-rem(length(msg),k0)))];
end
n = length(msg)/k0; % 把输入比特按k0分组,n为所得的组数。
% check the size of matrix g
if rem(size(g, 2), k0) > 0 %列数除以k0
error('Error, g is not of the right size.');
end
% determine L and n0
L = size(g, 2)/k0;
n0 = size(g, 1);%
% add extra zeros,以保证编码器是从全0开始,并回到全0状态。
u = [zeros(size(1:(L-1)*k0)), msg, zeros(size(1:(L-1)*k0))];
% generate uu, a matrix whose columns are the contents of conv. encoder at
% various clock cycles.
u1 = u(L*k0: -1 :1);
for i = 1:n L-2
u1 = [u1, u((i L)*k0:-1:i*k0 1)];
end
uu = reshape(u1, L*k0, n L-1);
% determine the output
output = reshape(rem(g*uu, 2), 1, n0*(L n-1));
len_tal = n0*(L n - 1);