views:

32

answers:

1

hi can anyone show how to use the modem.oqpskmod for BER. thanks!

    h = modem.oqpskmod
    y = modulate(h, values);
    g = modem.oqpskdemod(h)
    z = demodulate(g, y)

let's assume that i have array called values which contains only 1s and 0s. my question is how would i calculate BER? of course if above my code is correct.

+1  A: 

Based on this Wikipedia page, you simply have to compute the number of incorrect bits and divide by the total number of transferred bits to get the bit error rate (BER). If values is the unmodulated input signal and z is the output signal after modulation and demodulation, you can compute it like this:

BER = sum(logical(values(:)-z(:)))/numel(values);

EDIT: I modified the above code just in case you run into two situations:

  • If z has values other than 0 and 1.
  • If z is a different size than values (i.e. row vector versus column vector).

I don't know if you are ever likely to come across these two situations, but better safe than sorry. ;)

gnovice
Thanks a lot gnovice!
kl