-
大小: 9KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-06-01
- 语言: 其他
- 标签:
资源简介
LDPC编译码仿真。程序给出了LDPC码在BPSK调制下的通过AWGN 信道下的误比特率与信噪比的关系图仿真!
代码片段和文件信息
function vHat = decodeBitFlipping(rx H iteration)
% Hard-decision/bit flipping sum product algorithm LDPC decoder
%
% rx : Received signal vector (column vector)
% H : LDPC matrix
% iteration : Number of iteration
%
% vHat : Decoded vector (0/1)
%
%
% Copyright Bagawan S. Nugroho 2007
% http://bsnugroho.googlepages.com
[M N] = size(H);
% Prior hard-decision
ci = 0.5*(sign(rx‘) + 1);
% Initialization
rji = zeros(M N);
% Asscociate the ci matrix with non-zero elements of H
qij = H.*repmat(ci M 1);
% Iteration
for n = 1:iteration
fprintf(‘Iteration : %d\n‘ n);
% ----- Horizontal step -----
for i = 1:M
% Find non-zeros in the column
c1 = find(H(i :));
% Get the summation of qij\c1(k)
for k = 1:length(c1)
rji(i c1(k)) = mod(sum(qij(i c1)) + qij(i c1(k)) 2);
end % for k
end % for i
% ------ Vertical step ------
for j = 1:N
% Find non-zero in the row
r1 = find(H(: j));
% Number of 1s in a row
numOfOnes = length(find(rji(r1 j)));
for k = 1:length(r1)
% Update qij set ‘1‘ for majority of 1s else ‘0‘ excluding r1(k)
if numOfOnes + ci(j) >= length(r1) - numOfOnes + rji(r1(k) j)
qij(r1(k) j) = 1;
else
qij(r1(k) j) = 0;
end
end % for k
% Bit decoding
if numOfOnes + ci(j) >= length(r1) - numOfOnes
vHat(j) = 1;
else
vHat(j) = 0;
end
end % for j
end % for n
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1697 2007-05-04 19:06 decodeBitFlip.m
文件 2568 2007-05-04 19:09 decodeLogDomain.m
文件 2169 2007-05-04 19:06 decodeLogDomainSimple.m
文件 2468 2007-05-04 19:06 decodeProbDomain.m
文件 2009 2007-05-04 19:31 ldpcBER.m
文件 1541 2010-02-25 10:25 license.txt
文件 3468 2007-05-04 19:15 makeLdpc.m
文件 3819 2007-05-04 18:25 makeParityChk.m
评论
共有 条评论