我的8psk调制代码出错了

时间:2014-12-25 21:28:14

标签: matlab modulation

我正在尝试编码8PSK调制系统,这是代码:

custMap = [0 2 4 6 7 5 3 1];
hChan = comm.AWGNChannel('BitsPerSymbol',log2(8));
hErr = comm.ErrorRate;
% Initialize the simulation vectors. The Eb/No is varied from 0 to 10 dB in
% 1 dB steps.
ebnoVec = 0:10;
for k = 1:length(ebnoVec)
      % Set the channel Eb/No
      hChan.EbNo = ebnoVec(k);
      while errVec(2) < 200 && errVec(3) < 1e7
          % Generate a 1000-symbol frame
          data = randi([0 1],4000,1);
          modData = step(hMod,data);
          % Pass the modulated data through the AWGN channel
          rxSig = step(hChan,modData);
          % Demodulate the received signal
          rxData = step(hDemod,rxSig);
      end

  end

但我在这一行遇到了问题:

modData = step(hMod,data);

这是错误: enter image description here 我该如何解决问题,谢谢你的帮助

1 个答案:

答案 0 :(得分:1)

您已将通信通道配置为使用3位/符号。你的错误在这里:

% Generate a 1000-symbol frame
data = randi([0 1],4000,1);

对于1000个符号,您必须生成3000位。