当前位置: 首页 > news >正文

(22)以RS码为例说明信道编码AWGN信道的Eb/N0设置

文章目录

  • 前言
  • 一、编码Eb/N0与未编码Eb/N0及编码码率
  • 二、仿真代码
  • 三、仿真结果


前言

本文说明了如何为采用信道编码的通信链路设置Eb/N0(比特能量与噪声功率谱密度比)。


一、编码Eb/N0与未编码Eb/N0及编码码率

在通信系统仿真中,如果采用了FEC编码,则在设置AWGN信道Eb/N0时,需要考虑FEC编码码率R=K/N的影响。其中K为码字中信息码元的个数;N为码字的编码码元个数,也即信息码元数加校验码元数。

当通信链路中采用了信道编码, 编码的Eb/N0设置方法为:

CodedEbNo = UncodedEbNo + 10*log10(codeRate)

下面给出MATLAB仿真代码。

二、仿真代码

下面的MATLAB代码建立了一个“(15,9)RS码+8PSK”编码调制通信系统,显示了如何为采用信道编码的通信链路设置Eb/N0。

仿真中,通过设置不同的Eb/N0,绘制了系统的性能曲线。

N = 15;          % R-S codeword length in symbols
K = 9;           % R-S message length in symbols
num = 1e3;       % R-S codeword number in symbols
M = 8;           % Modulation order% Construct a (15,9) Reed-Solomon encoder and a 8-PSK modulator.
rsEncoder = comm.RSEncoder('CodewordLength',N,'MessageLength',K,'BitInput',true);
pskModulator = comm.PSKModulator('ModulationOrder',M,'BitInput',true);% Create the corresponding Reed-Solomon decoder and 8-PSK demodulator objects.
rsDecoder = comm.RSDecoder('CodewordLength',N,'MessageLength',K,'BitInput',true);
pskDemodulator = comm.PSKDemodulator('ModulationOrder',M,'BitOutput',true);% Calculate the Reed-Solomon code rate based on the ratio of message symbols to the codeword length.
codeRate = K/N;
bitsPerSymbol = log2(M);% Specify the uncoded Eb/No in dB. Convert the uncoded Eb/No to the corresponding coded Eb/No using the code rate.
UncodedEbNo = 0:2:16;
CodedEbNo = UncodedEbNo + 10*log10(codeRate);% Construct an AWGN channel taking into account the number of bits per symbol. Set the EbNo property of channel to the coded Eb/No.
channel = comm.AWGNChannel('BitsPerSymbol',bitsPerSymbol);
% channel.EbNo = CodedEbNo;% Set the total number of errors and bits for the simulation.
% For accuracy, the simulation should run until a sufficient number of bit errors are encountered.
% The number of total bits is used to ensure that the simulation does not run too long.
totalErrors = 100;
totalBits = 1e6;% Construct an error rate calculator System object and initialize the error rate vector.
errorRate = comm.ErrorRate;
ber = zeros(length(UncodedEbNo),1);for R = 1:length(UncodedEbNo)reset(errorRate);errorVec = zeros(3,1);channel.EbNo = CodedEbNo(R);% Run the simulation to determine the BER. while errorVec(2) < totalErrors && errorVec(3) < totalBits% Generate random bitsdataIn = randi([0,1],num*K,1);% Use the RS (15,9) encoder to add error correction capabilitydataEnc = rsEncoder(dataIn);% Apply 8-PSK modulationtxSig = pskModulator(dataIn);% Pass the modulated data through the AWGN channelrxSig = channel(txSig);% Demodulate the received signaldemodData = pskDemodulator(rxSig);% Decode the demodulated data with the RS (15,9) decoderdataOut = rsDecoder(demodData);% Collect error statisticserrorVec = errorRate(dataIn,demodData);end% Display the resultant bit error rate.ber(R) = errorVec(1);
endfigure()
semilogy(UncodedEbNo,ber,'ro-','LineWidth',1.5);
grid on;
xlabel('UncodedEbNo(dB)');
ylabel('BER');
title('8-PSK over AWGN Channels with RS Coding');

三、仿真结果

仿真结果如下:

在这里插入图片描述



http://www.mrgr.cn/news/45686.html

相关文章:

  • 【电商搜索】现代工业级电商搜索技术-EMNLP2024-无监督的用户偏好学习
  • 大数据新视界 --大数据大厂之 Presto 性能优化秘籍:加速大数据交互式查询
  • 动态规划算法题目练习——91.解码方法
  • 九、5 USART串口数据包
  • Windows的兼容性为什么这么强大?
  • LVS负载均衡群集
  • 基于SSM车位租赁系统【附源码】
  • DAMA数据管理知识体系(第6章 数据存储和操作)
  • 快速启动工具 | Biniware Run v7.1.0.0 绿色中文版
  • Linux高效查日志命令介绍
  • JMeter
  • PyQt入门指南七 自定义信号与槽的使用
  • Java如何调用构造函数和方法以及使用
  • 软件工程系列(1)需求工程
  • Linux驱动学习——内核编译
  • 一个月学会Java 第5天 控制结构
  • Word转PDF的转换方法有哪些?这7个效率技巧,不知道就亏大了!
  • Java中常见的等待唤醒机制及实践
  • Study-Oracle-11-ORALCE19C-ADG集群测试
  • Java访问器方法和更改器方法