个人主页:研学社的博客
欢迎来到本博客❤️❤️
博主优势:博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
本文目录如下:
目录
1 概述
2 运行结果
3 Matlab代码实现
4 参考文献
在 MATLAB 中设计并仿真通信链路
优化的通信链路以满足所需的误码率 (BER)。
通过通道最大化总数字比特率。
部分代码:
clear all;close all;clc % Reset workspace
%% Set Simulation Parameters
numIter = 5; % The number of iterations of the simulation.
nSym = 1000; % Constraint: Max 1000 symbols per packet
SNR_Vec = 0:2:16; % Vector that stores the Signal-to-Noise Ratios
lenSNR = length(SNR_Vec); % Length of SNR Vector
BER_Vec = zeros(numIter, lenSNR); % Vector that stores the BER computed during each iteration
%% Set BER/Bitrate Experimental Parameters
% Modulation order
% M = 4; % 4-QAM
M = 16; % 16-QAM
% M = 32; % 32-QAM
% Number of equalizer training symbols
% trainlen = 200;
trainlen = 100;
% trainlen = 50;
% Set Equalizer step size
% step = 0.01; % 4-QAM
step = 0.001; % 16-QAM
% Results:
% Optimized system: 16 QAM, 100 training symbols, 2.5778 bitrate
%% Set Communication System Parameters
k = log2(M);
% Reed-Solomon Parameters
N = 15; % Codeword length
L = 10; % Message length
S = 39; % Shortened message length
cRate = L/N; % Code rate
% Set channel
chan = [1 .2 .4]; % Somewhat invertible channel impulse response, Moderate ISI
%% Create objects
% Equalizer
Equalizer = dfe(5,3,lms(step)); % Decision Feedback / LMS - Best performing equalizer
% Equalizer = lineareq(6,rls(0.99,0.1)); % Linear/RLS - Good performance
% Equalizer = lineareq(8, lms(0.01)); % Linear/LMS - Worst performance, but also meets specifications
% Configure Equalizer
Equalizer.SigConst = qammod(((0:M-1)'),M)'; % Set ideal signal constellation.
Equalizer.ResetBeforeFiltering = 0; % Resets equalizer before use
% Reed-Solomon Encoder and Decoder
rsEncoder = comm.RSEncoder(N,L,'BitInput',true);
rsDecoder = comm.RSDecoder(N,L,'BitInput',true);
%% Run simulation (numIter times)
for i = 1:numIter
bits = randi(2,[nSym*k, 1])-1; % Generate random binary data for each iteration
for j = 1:lenSNR % Perform one iteration of the simulation at each SNR Value
encMsg = rsEncoder(bits); % RS encode
tx = qammod(encMsg,M,'InputType','bit'); % Modulate signal
% Draw and apply channel
if isequal(chan,1)
txChan = tx;
elseif isa(chan,'channel.rayleigh')
reset(chan) % Draw a different channel each iteration
txChan = filter(chan,tx);
else
txChan = filter(chan,1,tx); % Apply the channel to transmitted signal.
end
部分理论来源于网络,如有侵权请联系删除。
[1]孙颖. 无人机辅助的无线传感器网络数据传输研究[D].南京邮电大学,2022.DOI:10.27251/d.cnki.gnjdc.2022.000644.