lab24a.m

来自「再不同传输环境下」· M 代码 · 共 27 行

M
27
字号
function [ber, numBits] = bertooltemplate(EbNo, maxNumErrs, maxNumBits)
% Import Java class for BERTool.
import com.mathworks.toolbox.comm.BERTool;

% Initialize variables related to exit criteria.
totErr = 0;  % Number of errors observed
numBits = 0; % Number of bits processed

% --- Set up parameters. ---
M=32;
coding='gray';
N_symbols = 10000; % Number of symbols in the calculation
% Simulate until number of errors exceeds maxNumErrs
% or number of bits processed exceeds maxNumBits.
while((totErr < maxNumErrs) && (numBits < maxNumBits))

   % Check if the user clicked the Stop button of BERTool.
   if (BERTool.getSimulationStop)
      break;
   end

    %Vecteur Data 
    x=randsrc(N_symbols,1,0:M-1);
    %Moodulation
    y=qammod(x,M,0,coding);

   %Calcul du SNR 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?