function [c, newH] = makeParityChk(dSource, H, strategy)
% Generate parity check vector bases on LDPC matrix H using sparse LU decomposition
%
% dSource : Binary source (0/1)
% H : LDPC matrix
% strategy: Strategy for finding the next non-zero diagonal elements
% {0} First : First non-zero found by column search
% {1} Mincol : Minimum number of non-zeros in later columns
% {2} Minprod: Minimum product of:
% - Number of non-zeros its column minus 1
% - Number of non-zeros its row minus 1
%
% c : Check bits
%
%---------------------------------------------%
% %
% 工作室提供代做matlab仿真 %
% %
% 详情请访问:http://cn.mikecrm.com/5k6v1DP %
% %
%---------------------------------------------%
% Get the matric dimension
[M, N] = size(H);
% Set a new matrix F for LU decomposition
F = H;
% LU matrices
L = zeros(M, N - M);
U = zeros(M, N - M);
% Re-order the M x (N - M) submatrix
for i = 1:M
% strategy {0 = First; 1 = Mincol; 2 = Minprod}
switch strategy
% Create diagonally structured matrix using 'First' strategy
case {0}
% Find non-zero elements (1s) for the diagonal
[r, c] = find(F(:, i:end));
% Find non-zero diagonal element candidates
rowIndex = find(r == i);
% Find the first non-zero column
chosenCol = c(rowIndex(1)) + (i - 1);
% Create diagonally structured matrix using 'Mincol' strategy
case {1}
% Find non-zero elements (1s) for the diagonal
[r, c] = find(F(:, i:end));
colWeight = sum(F(:, i:end), 1);
% Find non-zero diagonal element candidates
rowIndex = find(r == i);
% Find the minimum column weight
[x, ix] = min(colWeight(c(rowIndex)));
% Add offset to the chosen row index to match the dimension of the...
% original matrix F
chosenCol = c(rowIndex(ix)) + (i - 1);
% Create diagonally structured matrix using 'Minprod' strategy
case {2}
% Find non-zero elements (1s) for the diagonal
[r, c] = find(F(:, i:end));
colWeight = sum(F(:, i:end), 1) - 1;
rowWeight = sum(F(i, :), 2) - 1;
% Find non-zero diagonal element candidates
rowIndex = find(r == i);
% Find the minimum product
[x, ix] = min(colWeight(c(rowIndex))*rowWeight);
% Add offset to the chosen row index to match the dimension of the...
% original matrix F
chosenCol = c(rowIndex(ix)) + (i - 1);
otherwise
fprintf('Please select columns re-ordering strategy!\n');
end % switch
% Re-ordering columns of both H and F
tmp1 = F(:, i);
tmp2 = H(:, i);
F(:, i) = F(:, chosenCol);
H(:, i) = H(:, chosenCol);
F(:, chosenCol) = tmp1;
H(:, chosenCol) = tmp2;
% Fill the LU matrices column by column
L(i:end, i) = F(i:end, i);
U(1:i, i) = F(1:i, i);
% There will be no rows operation at the last row
if i < M
% Find the later rows with non-zero elements in column i
[r2, c2] = find(F((i + 1):end, i));
% Add current row to the later rows which have a 1 in column i
F((i + r2), :) = mod(F((i + r2), :) + repmat(F(i, :), length(r2), 1), 2);
end % if
end % for i
% Find B.dsource
z = mod(H(:, (N - M) + 1:end)*dSource, 2);
% Parity check vector found by solving sparse LU
c = mod(U\(L\z), 2);
% Return the rearrange H
newH = H;
fprintf('Message encoded.\n');
没有合适的资源?快使用搜索试试~ 我知道了~
用matlab仿真实现ldpc编解码,BPSK调制, 测定误码率与信噪比的关系
共7个文件
m:7个
5星 · 超过95%的资源 需积分: 50 91 下载量 180 浏览量
2019-04-09
16:02:00
上传
评论 18
收藏 10KB ZIP 举报
温馨提示
用matlab仿真实现ldpc编解码,BPSK调制, 测定误码率与信噪比的关系
资源推荐
资源详情
资源评论
收起资源包目录
用matlab仿真实现ldpc编解码,BPSK调制, 测定误码率与信噪比的关系.zip (7个子文件)
用matlab仿真实现ldpc编解码,BPSK调制, 测定误码率与信噪比的关系
LDPC_BSN
decodeBitFlip.m 2KB
makeParityChk.m 4KB
makeLdpc.m 4KB
decodeProbDomain.m 3KB
decodeLogDomain.m 3KB
ldpcBER.m 2KB
decodeLogDomainSimple.m 2KB
共 7 条
- 1
资源评论
- yiyi分析亲密关系2023-07-25这个文件提供了一个可复现的仿真实验环境,让读者可以根据自己的需求进行二次开发和测试不同参数的LDPC编解码系统。
- 王者丶君临天下2023-07-25尽管这个文件没有过多技术探讨和复杂理论,但它以简单和实用为主,为LDPC编解码和信道建模提供了一个良好的起点。
- 耄先森吖2023-07-25这个文件的编写语言简单明了,循序渐进地解释了每个步骤,让人容易理解和跟随。
- 不能汉字字母b2023-07-25这个文件真实展示了用matlab进行LDPC编解码、BPSK调制的仿真,对于理解相关理论和实际应用有很大帮助。
- 首席程序IT2023-07-25作者对于误码率与信噪比的关系进行了详细的测定和分析,提供了有用的参考数据,对于进一步研究和优化LDPC编解码算法很有帮助。
xmlywz006
- 粉丝: 8
- 资源: 33
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功