我正在尝试编码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);
这是错误: 我该如何解决问题,谢谢你的帮助
答案 0 :(得分:1)
您已将通信通道配置为使用3位/符号。你的错误在这里:
% Generate a 1000-symbol frame
data = randi([0 1],4000,1);
对于1000个符号,您必须生成3000位。