Communications Toolbox | ![]() ![]() |
Computing and Displaying Bit Error Rates
The biterr
function compares each demodulated signal (that is, each column of newsignal
) to the original signal. Then biterr
computes the number of bit errors, as well as the rate or fraction of bit errors. The built-in MATLAB function disp
displays the two bit error rates in the MATLAB Command Window.
% Check whether Gray code resulted in fewer bit errors. % Compare signal with each column of newsignal. [num,rate] = biterr(newsignal,signal); disp('Bit error rates for the two constellations used here') disp('----------------------------------------------------') disp(['Gray code constellation: ', num2str(rate(1))]) disp(['Non-Gray code constellation: ', num2str(rate(2))])
![]() | Demodulating the Signal | Plotting a Signal Constellation | ![]() |