필터 지우기
필터 지우기

The specified codeword length and message length are not valid with using encode hamming

조회 수: 3 (최근 30일)
Hello,
i have this code to encode a 7 bit sequence to a 11 bit hamming code.
n = 11;
k = 7;
data = randi([0 1],k,1);
encData = encode(data,n,k,'hamming/binary');
but i get this error:
The specified codeword length and message length are not valid.
How can i solve this problem?

답변 (1개)

Walter Roberson
Walter Roberson 2017년 6월 10일
The formula works out such that you can only encode messages of length k if k = 2^n - n - 1 for some integer n. For example, messages of length 4 11 26 57 120 247 502 1013 2036 4083 ...

카테고리

Help CenterFile Exchange에서 Hamming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by