-
Notifications
You must be signed in to change notification settings - Fork 0
/
BER.m
24 lines (23 loc) · 723 Bytes
/
BER.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% ///////////////////Probabilidad de error de símbolo\\\\\\\\\\\\\\\\\\\\\\
% Entradas:
% X -> señal a la entrada del emisor
% Y -> salida del receptor
% N -> número de portadoras
% samples -> muestras totales que se transmiten
% Salidas:
% ser -> probabilidad de error de símbolo
% /////////////////////////////////////////////////////////////////////////
function ber = BER(X,Y,N,samples)
ber = 0;
for i = 1:samples
for n = 1:N
if (real(X(n,i))*real(Y(n,i)) <= 0)
ber = ber + 1;
end
if (imag(X(n,i))*imag(Y(n,i)) <= 0)
ber = ber + 1;
end
end
end
ber = (ber/(samples*N*2))*100;
end