-
Notifications
You must be signed in to change notification settings - Fork 0
/
sourceTx.m
29 lines (22 loc) · 2.82 KB
/
sourceTx.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
25
26
27
28
29
function txBits = sourceTx(systemParam)
%Funcion que genera numeros aleatorios
%txBits = randi([0,1],1,systemParam.nDataBits);
%Establecemos la cadena a mano para poder comprobar la efectividad sin que
%nos varie la fuente en cada ejecucion de codigo y asi poder comparar
%resultados
txBits = [1 1 0 1 1 0 0 1 1 1 0 1 1 0 1 0 0 1 1 1 1 0 1 1 1 1 1 0 1 0 1 0 0 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1 1 1 0 1 1 0 0 0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 0 0 0 0 1 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 0 1 1 0 0 0 0 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 0 1 0 1 1 0 1 0 0 1 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 0 1 0 1 0 1 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 1 1 0 0 1 0 0 1 0 1 1 1 0 1 1 1 1 1 0 0 1 0 0 0 0 1 1 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 0 1 0 1 1 1 1 1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 1 0 0 0 0 0 1 0 0 1 0 0 1 0 1 1 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0 1 1 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 1 1 0 1 0 0 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 0 0 0 0 0 1 1 1 0 1 1 1 0 0 1 0 0 1 1 1 1 0 0 1 0 1 1 1 1 1 1 0 0 1];
% if strcmp(systemParam.mapping.type, 'bpsk')
% % Para bpsk de 0 a 1
% txBits = randi([0,1],1,systemParam.nDataBits);
% elseif strcmp(systemParam.mapping.type, 'qpsk')
% % Para qpsk de 0 a 3
% txBits = randi([0,3],1,systemParam.nDataBits);
% elseif strcmp(systemParam.mapping.type, 'qam16')
% % Para qam16 de 0 a 15
% txBits = randi([0,15],1,systemParam.nDataBits);
% elseif strcmp(systemParam.mapping.type, 'qam64')
% % Para qam64 de 0 a 63
% txBits = randi([0,63],1,systemParam.nDataBits);
% else
% disp('Modulacion introducida no valida');
end