简体   繁体   English

BER的modem.oqpskmod

[英]modem.oqpskmod for BER

hi can anyone show how to use the modem.oqpskmod for BER. 嗨,任何人都可以展示如何为BER使用modem.oqpskmod。 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. 假设我有一个名为value的数组,其中只包含1和0。 my question is how would i calculate BER? 我的问题是我将如何计算误码率? of course if above my code is correct. 当然如果上面的代码是正确的。

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). 基于此Wikipedia页面 ,您只需计算不正确的位数,然后除以传输的位数,即可得出误码率(BER)。 If values is the unmodulated input signal and z is the output signal after modulation and demodulation, you can compute it like this: 如果values是未经调制的输入信号,而z是经过调制和解调后的输出信号,则可以这样计算:

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. 如果z值不是0和1。
  • If z is a different size than values (ie row vector versus column vector). 如果z的大小不同于values (即行向量与列向量)的大小。

I don't know if you are ever likely to come across these two situations, but better safe than sorry. 我不知道您是否曾经遇到过这两种情况,但总比后悔好。 ;) ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM