RS编码的matlab仿真(m文件仿真)
对加入突发噪声信道的RS(15,11)编码进行的仿真:代码如下:
L=1000;
M=4;%每个符号的比特数
N=2^M-1;%编码后码字长度
K=N-4;%信息长度
MSG=randint(L,1);%随机产生L比特信号
TP=gftuple([-1:N-1]',M);%产生加罗华域元素
PG=rspoly(N,K);%产生生成式
[CODE,ADDED]=rsenco(MSG,TP,K);%编码
NOI=rand(length(CODE)/M,1)<.03;%加入3%的噪声
NOI=(NOI*ones(1,M))';%产生突发错误
NOI=NOI(:);
CODE_NOI=rem(CODE+NOI,2);%噪声加入信号
[DEC,ERR,CCODE,ERR_C]=rsdeco(CODE_NOI,TP,K);%译码
MSG=[MSG;zeros(ADDED,1)];%调整长度
max(abs(DEC-MSG));%比较
X=[1:length(NOI)];
Z=[1:M*N:length(NOI)];
Y=zeros(1,length(Z));
Z=[Z;Z];
Y=[Y+min(ERR_C);Y+max(ERR_C)];
subplot(211);
plot(X,NOI,'yo',X,ERR_C,'rx',Z,Y,'g-');
title('Error Detection Record');
xlabel('o--placed error;x--detected error;vertical bar: RS-DECO section.');
axis([1,length(NOI),min(ERR_C),max(ERR_C)]);
X=[1:length(MSG)];
Z=[1:M*K:length(MSG)];
Y=zeros(1,length(Z));
Z=[Z;Z];
Y=[Y;Y+max(MSG)];
subplot(212);
plot(X,MSG,'yo',X,DEC,'rx',Z,Y,'g-');
title('Message and Decoded Signal Comparison');
xlabel('o--original message;x--decoded result.');
axis([1,length(MSG),min(min(MSG)),max(max(MSG))]);
RS编码的matlab仿真
原创
©著作权归作者所有:来自51CTO博客作者fpga和matlab的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
【方块编码】基于matlab的图像方块编码仿真
方块编码也叫方块截断编码(block truncation coding,简称BTC)是静态图像编码中的一种,
大数据 图像方块编码 图像编码 显示设备 软件版本 -
RS编译码理论介绍与MATLAB性能仿真
1.问题描述: RS编译码是一种非二进制编译码,RS编译码的码元符号取自伽罗达域GF(2m)
RS编译码 matlab 误码率 初始化 码元 -
zoomfft的matlab仿真
1.问题描述: FFT虽然迅速方便地实现了数字频谱分析的功能,但是对于希望在某些感兴趣的频率范围内以较高的分辨率进行频
zoomfft 采样频率 傅立叶变换 重采样 -
TDOA的matlab仿真
clc;clear;close all;warning off;%设置信噪比的大小SNR = [10,20,30,40,50,60,
matlab 算法 tdoa 时间同步 通过延迟