Products & Services Solutions Academia Support User Community Company

Learn more about Communications Toolbox   

Theoretical Performance Results

Computing Theoretical Error Statistics

While the biterr function discussed above can help you gather empirical error statistics, you might also compare those results to theoretical error statistics. Certain types of communication systems are associated with closed-form expressions for the bit error rate or a bound on it. The functions listed in the table below compute the closed-form expressions for some types of communication systems, where such expressions exist.

Type of Communication SystemFunction
Uncoded AWGN channel berawgn
Coded AWGN channel bercoding
Uncoded Rayleigh and Rician fading channel berfading
Uncoded AWGN channel with imperfect synchronization bersync

Each function's reference page lists one or more books containing the closed-form expressions that the function implements.

Plotting Theoretical Error Rates

The example below uses the bercoding function to compute upper bounds on bit error rates for convolutional coding with a soft-decision decoder. The data used for the generator and distance spectrum are from [5] and [2], respectively.

coderate = 1/4; % Code rate
% Create a structure dspec with information about distance spectrum.
dspec.dfree = 10; % Minimum free distance of code
dspec.weight = [1 0 4 0 12 0 32 0 80 0 192 0 448 0 1024 ...
   0 2304 0 5120 0]; % Distance spectrum of code
EbNo = 3:0.5:8;
berbound = bercoding(EbNo,'conv','soft',coderate,dspec);
semilogy(EbNo,berbound) % Plot the results.
xlabel('E_b/N_0 (dB)'); ylabel('Upper Bound on BER');
title('Theoretical Bound on BER for Convolutional Coding');
grid on;

This example produces the following plot.

Comparing Theoretical and Empirical Error Rates

The example below uses the berawgn function to compute symbol error rates for pulse amplitude modulation (PAM) with a series of Eb/N0 values. For comparison, the code simulates 8-PAM with an AWGN channel and computes empirical symbol error rates. The code also plots the theoretical and empirical symbol error rates on the same set of axes.

% 1. Compute theoretical error rate using BERAWGN.
M = 8; EbNo = [0:13];
[ber, ser] = berawgn(EbNo,'pam',M);
% Plot theoretical results.
figure; semilogy(EbNo,ser,'r');
xlabel('E_b/N_0 (dB)'); ylabel('Symbol Error Rate');
grid on; drawnow;

% 2. Compute empirical error rate by simulating.
% Set up.
n = 10000; % Number of symbols to process
k = log2(M); % Number of bits per symbol
% Convert from EbNo to SNR.
% Note: Because No = 2*noiseVariance^2, we must add 3 dB
% to get SNR. For details, see Proakis book listed in
% "Selected Bibliography for Performance Evaluation."
snr = EbNo+3+10*log10(k);
ynoisy=zeros(n,length(snr)); % Preallocate to save time.

% Main steps in the simulation
x = randint(n,1,M); % Create message signal.
y = pammod(x,M); % Modulate.
% Send modulated signal through AWGN channel.
% Loop over different SNR values.
for jj = 1:length(snr)
   ynoisy(:,jj) = awgn(real(y),snr(jj),'measured');
end
z = pamdemod(ynoisy,M); % Demodulate.

% Compute symbol error rate from simulation.
[num,rt] = symerr(x,z);

% 3. Plot empirical results, in same figure.
hold on; semilogy(EbNo,rt,'b.');
legend('Theoretical SER','Empirical SER');
title('Comparing Theoretical and Empirical Error Rates');
hold off;

This example produces a plot like the one in the following figure. Your plot might vary because the simulation uses random numbers.

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS