リード・ソロモン符号による誤り訂正のシミュレーションをcomm.RSEncoderによって行う方法
    7 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    akihisa oohori
 el 22 de Sept. de 2020
  
    
    
    
    
    Comentada: akihisa oohori
 el 23 de Sept. de 2020
            リード・ソロモン符号化を使用した、ノイズを含むBPSKのBERを求めたいと考えております。そこで
を参考に、後述のコードによって計算を行いました。
すると、符号語長M=7, メッセージ長K=5など、小さな値では問題なく計算が行えましたが、これらの値を大きくすると(M=63, K=51など)、下記のようなエラーが発生し計算を行うことが出来なくなりました。
エラー: comm.RSEncoder/setupImpl (行 420)
The dimensions of the input X must be consistent with the BitInput property value, the message and codeword lengths, and the primitive polynomial. For more information, type 'help comm.RSEncoder/BitInput'.
エラー: RS_bpsk (行 24)
        encData = rsEncoder(data);
解決方法がわかる方がいらっしゃいましたら、ご教示よろしくお願いいたします。
以下に使用したコードを載せさせていただきます。アドオンはCommunications Toolboxを使用しております。
clear
M = 2; % Modulation order
bps = log2(M); % Bits per symbol
N = 63; % RS codeword length
K = 51; % RS message length
data = randi([0 M-1],100,1);           % Generate binary data
bpskModulator=comm.BPSKModulator;      % Modulator
bpskModulator.PhaseOffset=pi/16;       % Offset
bpskDemodulator=comm.BPSKDemodulator;  % Demodulator
awgnChannel = comm.AWGNChannel('BitsPerSymbol',bps);
errorRate = comm.ErrorRate;
rsEncoder = comm.RSEncoder('BitInput',true,'CodewordLength',N,'MessageLength',K);
rsDecoder = comm.RSDecoder('BitInput',true,'CodewordLength',N,'MessageLength',K);
ebnoVec = (5:0.5:10)';                 %Eb/N0の値の範囲設定
errorStats = zeros(length(ebnoVec),3); %誤り統計行列の初期化
for i = 1:length(ebnoVec)
    awgnChannel.EbNo = ebnoVec(i);
    reset(errorRate)
    while errorStats(i,2) < 100 && errorStats(i,3) < 1e7
        data = randi([0 1],1500,1);                 % Generate binary data
        encData = rsEncoder(data);                  % RS encode
        modData = bpskModulator(encData);           % Modulate
        rxSig = awgnChannel(modData);               % Pass signal through AWGN
        rxData =bpskDemodulator(rxSig);             % Demodulate
        decData = rsDecoder(rxData);                % RS decode
        errorStats(i,:) = errorRate(data,decData);  % Collect error statistics
    end
end
berNoCoding = berawgn(ebnoVec,'psk',8,'nondiff');
semilogy(ebnoVec,errorStats(:,1),'b*', ...
ebnoVec,errorStats(:,1),'c-',ebnoVec,berNoCoding,'r')
ylabel('BER')
xlabel('Eb/No (dB)')
legend('Data','Curve Fit','No Coding')
grid
0 comentarios
Respuesta aceptada
  takemoto
    
 el 23 de Sept. de 2020
        上記ドキュメントによれば、comm.RSEncoderの適用する生成多項式の次数Mは、
M = log2(語長+1)
となります。また、入力系列に関する条件として、'BitInput'プロパティをtrueとした場合、
入力ビット系列は、上記次数に相当するビット数に対応させるため、Mの倍数とする必要が
ありそうです。添付の例では、
M = lo2(65+1) = 6
となりますので、データ長1500の部分を、例えば、K*6とすることで、エラーは回避できそうですが、いかがでしょうか。
Más respuestas (0)
Ver también
Categorías
				Más información sobre PHY サブコンポーネント en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
