gusucode.com > UWB_matlab源码程序 > CP0901/cp0901_MUIBER_2PAM.m

    %
% Function 9.4 : "cp0901_MUIBER_2PAM"
%
% Evaluates the theoretical probability of error
% for a 2PAM system in AWGN channels under the
% Standard Gaussian Approximation
%
% 'ebn0'     is a vector containing the values in dB of the
% ratio Eb/No
% 'erx0'     is the energy of the useful signal
% 'erxMUI'   is a vector containing the received energies
% of the 
%            interfering users.
% 'pulse'    is the waveform of the basic pulse
% 'Rb'       is the user bit rate [b/s]
% 'fc'       is the sampling time [Hz]
% 'gamma_r'  represents the ratio (Ts/(Tb/Ns))
%


function [BER] = ...
   cp0901_MUIBER_2PAM(ebno,erx0,erxMUI,pulse,Rb,fc,gamma_r)

% ----------------------------------------------------
% Step One - Evaluation of the required constant terms
% ----------------------------------------------------

% (Sigma_m)^2 [sm2]

  sm2 = cp0901_sm2_PAM(pulse,fc);
  
% MUI energy summation [EMUI]

  EMUI = sum(erxMUI./erx0);
  
% -------------------------------------
% Step Two - Evaluation of SIR and SNRn
% -------------------------------------

SIR = (gamma_r)/(sm2*Rb*EMUI);

EBN0 = 10.^(ebno/10);
SNRn = EBN0.*2;

% -----------------------------------
% Step Three - Performance evaluation
% -----------------------------------

SNRref = 1./((1./SNRn)+(1/SIR));

BER = 0.5.*erfc(sqrt(SNRref./2));