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,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,1,0,0,0];
tx = [];
values = randsrc(1,1,[0:15]);
for k=1:length(values)
sym = values(k);
tx = [tx chip_values((sym+1),1:end)];
end;
tx = tx.';
h = modem.oqpskmod;
y = modulate(h, tx);
g = modem.oqpskdemod(h);
z = demodulate(g, y);
length(z)
for k=1:length(tx)
if(tx(k)~=z(k))
fprintf('%d %d\n',tx(k),z(k));
end;
end;
my question is in this simple case why my tx and z do not contain the same values eventhough i did not introduce any noise yet? thanks!
values of tx comes as follows:
Columns 1 through 13
0 1 1 0 0 0 0 0 0 1 1 1 0
Columns 14 through 26
1 1 1 1 0 1 1 1 0 0 0 1 1
Columns 27 through 32
0 0 1 0 0 1
values of the z comes as follows:
Columns 1 through 13
3 0 1 1 0 0 0 0 0 0 1 1 1
Columns 14 through 26
0 1 1 1 1 0 1 1 1 0 0 0 1
Columns 27 through 32
1 0 0 1 0 0
h =
Type: 'OQPSK Modulator'
M: 4
PhaseOffset: 0
Constellation: [1x4 double]
SymbolOrder: 'Binary'
SymbolMapping: [0 1 2 3]
InputType: 'Integer'
g =
Type: 'OQPSK Demodulator'
M: 4
PhaseOffset: 0
Constellation: [1x4 double]
SymbolOrder: 'Binary'
SymbolMapping: [0 1 2 3]
OutputType: 'Integer'
DecisionType: 'Hard decision'