通信人家园

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索

军衔等级:

  新兵

注册:2015-1-5
跳转到指定楼层
1#
发表于 2015-4-29 14:52:38 |只看该作者 |正序浏览
刚开始学习LDPC码。看到MATLAB上有现有的语句,但是为什么都没有噪声,解调出来误码率很大呢?求大神相助

clc;
H = dvbs2ldpc(1/2);% 产生不同码率的LDPC校验矩阵
enc = fec.ldpcenc(H);  % Construct a default LDPC encoder object
% Generate and encode a random binary message
msg = randint(1,enc.NumInfoBits,2);%产生与校验矩阵相匹配的随机信息序列
codeword = encode(enc,msg);%产生LDPC码
xlswrite('ldpc',codeword')
xlswrite('msg',msg')
size(msg)

% Construct a companion LDPC decoder object
dec = fec.ldpcdec(H);
dec = fec.ldpcdec;
dec.DecisionType = 'Soft decision';
dec.OutputFormat = 'Information part';
dec.NumIterations = 50;
% % Stop if all parity-checks are satisfied
dec.DoParityChecks = 'Yes';
% Decode received signal
decodedmsg = decode(dec, codeword);
cor=0;
n=32400
for i=1:n
    if msg(i)==decodedmsg(i)
        cor=cor;
    else cor=cor+1;
    end
end
ber=cor/n

举报本楼

本帖有 3 个回帖,您需要登录后才能浏览 登录 | 注册
您需要登录后才可以回帖 登录 | 注册 |

手机版|C114 ( 沪ICP备12002291号-1 )|联系我们 |网站地图  

GMT+8, 2024-11-25 20:48 , Processed in 0.105468 second(s), 15 queries , Gzip On.

Copyright © 1999-2023 C114 All Rights Reserved

Discuz Licensed

回顶部