Fit curve to nonsmooth empirical bit error rate (BER) data
fitber = berfit(empEbNo,empber)
fitber = berfit(empEbNo,empber,fitEbNo)
fitber = berfit(empEbNo,empber,fitEbNo,options)
fitber = berfit(empEbNo,empber,fitEbNo,options,fittype
)
[fitber,fitprops] = berfit(...)
berfit(...)
berfit(empEbNo,empber,fitEbNo,options,'all'
)
fitber = berfit(empEbNo,empber)
fits a curve to the empirical BER
data in the vector empber
and returns a vector of fitted bit error rate
(BER) points. The values in empber
and fitber
correspond
to the
E_{b}/N_{0}
values, in dB, given by empEbNo
. The vector empEbNo
must
be in ascending order and must have at least four elements.
The berfit
function is intended for curve fitting or interpolation,
not extrapolation. Extrapolating BER data beyond an order of
magnitude below the smallest empirical BER value is inherently unreliable.
fitber = berfit(empEbNo,empber,fitEbNo)
fits a curve to the empirical
BER data in the vector empber
corresponding to the
E_{b}/N_{0}
values, in dB, given by empEbNo
. The function then evaluates the curve at
the E_{b}/N_{0}
values, in dB, given by fitEbNo
and returns the fitted BER points. The
length of fitEbNo
must equal or exceed that of
empEbNo
.
fitber = berfit(empEbNo,empber,fitEbNo,options)
uses the structure options
to override the default options used for
optimization. These options are the ones used by the fminsearch
function.
You can create the options
structure using the
optimset
function. Particularly relevant fields are described in the
table below.
Field  Description 

options.Display  Level of display: 'off' (default) displays no output;
'iter' displays output at each iteration;
'final' displays only the final output;
'notify' displays output only if the function does not
converge. 
options.MaxFunEvals  Maximum number of function evaluations before optimization ceases. The default is 10^{4}. 
options.MaxIter  Maximum number of iterations before optimization ceases. The default is 10^{4}. 
options.TolFun  Termination tolerance on the closedform function used to generate the fit. The default is 10^{4}. 
options.TolX  Termination tolerance on the coefficient values of the closedform function used to generate the fit. The default is 10^{4}. 
fitber = berfit(empEbNo,empber,fitEbNo,options,
specifies which closedform function fittype
)berfit
uses to fit the empirical
data, from the possible fits listed in Algorithms below. fittype
can
be 'exp'
, 'exp+const'
, 'polyRatio'
,
or 'doubleExp+const'
. To avoid overriding default optimization options, use
options = []
.
[fitber,fitprops] = berfit(...)
returns the
MATLAB structure fitprops
, which describes the results of the curve fit.
Its fields are described in the table below.
Field  Description 

fitprops.fitType  The closedform function type used to generate the fit:
'exp' , 'exp+const' ,
'polyRatio' , or 'doubleExp+const' . 
fitprops.coeffs  The coefficients used to generate the fit. If the function cannot find a valid
fit, fitprops.coeffs is an empty vector. 
fitprops.sumSqErr  The sum squared error between the log of the fitted BER points and the log of the empirical BER points. 
fitprops.exitState  The exit condition of berfit : 'The curve fit
converged to a solution.' , 'The maximum number of function
evaluations was exceeded.' , or 'No desirable fit was
found' . 
fitprops.funcCount  The number of function evaluations used in minimizing the sum squared error function. 
fitprops.iterations  The number of iterations taken in minimizing the sum squared error function. This is not necessarily equal to the number of function evaluations. 
berfit(...)
plots the empirical and fitted BER
data.
berfit(empEbNo,empber,fitEbNo,options,
plots the empirical and fitted BER data from all the possible fits, listed in the Algorithms below, that return a valid fit. To avoid overriding default options, use
'all'
)options = []
.
A valid fit must be
realvalued
monotonically decreasing
greater than or equal to 0 and less than or equal to 1
If a fit does not confirm to this criteria, it is rejected.
The berfit
function fits the BER data using unconstrained nonlinear
optimization via the fminsearch
function. The closedform functions that
berfit
considers are listed in the table below, where
x is the E_{b}/N_{0} in linear
terms (not dB) and f is the estimated BER. These
functions were empirically found to provide close fits in a wide variety of situations,
including exponentially decaying BERs, linearly varying BERs, and BER curves with error rate
floors.
Value of fittype  Functional Expression 

'exp'  $$f(x)={a}_{1}\mathrm{exp}\left[\frac{{\left(x{a}_{2}\right)}^{{a}_{3}}}{{a}_{4}}\right]$$ 
'exp+const'  $$f(x)={a}_{1}\mathrm{exp}\left[\frac{{(x{a}_{2})}^{{a}_{3}}}{{a}_{4}}\right]+{a}_{5}$$ 
'polyRatio' 
$$f(x)={\scriptscriptstyle \frac{{a}_{1}{x}^{2}+{a}_{2}x+{a}_{3}}{{x}^{3}+{a}_{4}{x}^{2}+{a}_{5}x+{a}_{6}}}$$

'doubleExp+const'  $$\begin{array}{l}{a}_{1}\mathrm{exp}\left[\frac{{\left(x{a}_{2}\right)}^{{a}_{3}}}{{a}_{4}}\right]\\ \begin{array}{cc}& \end{array}+{a}_{5}\mathrm{exp}\left[\frac{{\left(x{a}_{6}\right)}^{{a}_{7}}}{{a}_{8}}\right]+{a}_{9}\end{array}$$ 
The sum squared error function that fminsearch
attempts to minimize is
$$F={\displaystyle \sum {[\mathrm{log}(\text{empiricalBER})\mathrm{log}(\text{fittedBER})]}^{2}}$$
where the fitted BER points are the values in fitber
and
the sum is over the E_{b}/N_{0} points given in
empEbNo
. It is important to use the log of the BER values rather than the
BER values themselves so that the highBER regions do not dominate the objective function
inappropriately.
For a general description of unconstrained nonlinear optimization, see the following work.
[1] Chapra, Steven C., and Raymond P. Canale, Numerical Methods for Engineers, Fourth Edition, New York, McGrawHill, 2002.