我想在AWGN中使用RS(240.224)对QPSK进行BER估计,如paper所示。因此,我从类似MATLAB示例的东西开始,我只是做了如下参数更改:
rng(1993); % Seed random number generator for repeatable results
M = 4; % Modulation order
bps = log2(M); % Bits per symbol
N = 240; % RS codeword length
K = 224; % RS message length
rsEncoder = comm.RSEncoder( ...
BitInput=true, ...
CodewordLength=N, ...
MessageLength=K);
rsDecoder = comm.RSDecoder( ...
BitInput=true, ...
CodewordLength=N, ...
MessageLength=K);
ebnoVec = (3:0.5:8)';
ebnoVecCodingGain = ...
ebnoVec + 10*log10(K/N); % Account for RS coding gain
errorStats = zeros(length(ebnoVec),3);
for i = 1:length(ebnoVec)
awgnChannel.EbNo = ebnoVecCodingGain(i);
reset(errorRate)
while errorStats(i,2) < 100 && errorStats(i,3) < 1e7
data = randi([0 1],1500,1);
encData = rsEncoder(data);
modData = pskmod(encData,M,InputType='bit');
rxSig = awgnChannel(modData);
rxData = pskdemod(rxSig,M,OutputType='bit');
decData = rsDecoder(rxData);
errorStats(i,:) = errorRate(data,decData);
end
end
berCurveFit = berfit(ebnoVecCodingGain,errorStats(:,1));
semilogy(ebnoVecCodingGain,errorStats(:,1),'b*', ...
ebnoVecCodingGain,berCurveFit,'c-')
ylabel('BER')
xlabel('Eb/No (dB)')
legend('RS coded BER','Curve Fit')
grid
我不断得到这个错误:
Error using comm.RSEncoder/setupImpl
the dimensions of the Input X must be consistent with the BitInput property value, the message and Codeword lengths, and primitive polynomial. ...
1条答案
按热度按时间7gcisfzg1#
您的代码段缺少MATLAB示例中的行。实际的参考代码在这里:Estimate BER of QPSK in AWGN with Reed-Solomon Coding。
但是,密钥修复是
data = randi([0 1],224*8,1);
摘自
help comm.RSEncoder/BitInput
:“当您将此属性设置为true时,X必须是位的列向量,其整数倍为MessageLength*M位。”在你选择(N,K)的情况下,M = 8,因为你使用的是伽罗瓦域GF(2^M)。我还建议从SNR范围
ebnoVec = (0:0.5:5)';
中减去3,这样在所有SNR处都会有一些比特错误,否则berfit将返回一条与模拟SNR范围长度不同的曲线。