1

QRコードを作成するmatlabプログラムを作成する必要があります。

私の問題は、Reed Solomon の誤り訂正です。

ユーザーは、必要な単語を入力します。[...] 多項式ジェネレーター (Reed Solomon) に入れるべき数字の文字列を取得しました (これをうまく行っているサイトをいくつか見つけました: http://www.pclviewer.com/rs2/calculator.html )

たとえば、次のように入力します: 32 91 11 120 209 114 220 77 67 64 236 17 236

【リードソロモン生成多項式】

168 72 22 82 217 54 156 0 46 15 180 122 16

関数 rsenc comm.rsencoder gf を見つけました ... しかし、これらの関数の操作を理解することは不可能です。関数の詳細: http://www.mathworks.fr/fr/help/comm...n.html#fp12225

このタイプのコードを試しました:

n = 255; k = 13; % Codeword length and message length
m = 8; % Number of bits in each symbol
msg = [32 91 11 120 209 114 220 77 67 64 236 17 236]; % Message is a Galois array.
obj = comm.RSEncoder(n, k);
c1 = step(obj, msg(1,:)');
c = [c1].';

彼は 255 の文字列を生成しましたが、私は 13 の出力が必要です。

ご協力ありがとうございました。

4

1 に答える 1

0

あなたは間違いを犯していると思います。

「n」は、パリティ コードを含む最終メッセージの長さです。'k' はメッセージの長さ (シンボルの数)

これが役立つと思います:

clc, clear all;
M = 16;     % Modulation Order || same that Max value, at your case: 256! 2^m
hEnc = comm.RSEncoder;
hEnc.CodewordLength = M - 1; % Max = M-1, Min = 4, Must be greater than MessageLenght
hEnc.MessageLength = 13;  % Experiment change up and down value (using odd number)
hEnc.BitInput = false;
hEnc
t = hEnc.CodewordLength - hEnc.MessageLength;
frame = 2*hEnc.MessageLength; % multiple of MensagemLength
fprintf('\tError Detection (in Symbols): %d\n',t);
fprintf('\tError Correction: %.2f\n',t/2);
data = randi([0 M-1], frame, 1); % Create a frame with symbols range (0 to M-1)
encodedData = step(hEnc, data);  % encod the frame
于 2013-10-15T04:53:54.507 に答える