About working of cyclpoly() and encode()
조회 수: 4 (최근 30일)
이전 댓글 표시
Here is a MATLAB code to generate cyclic codes. n=7; k=4;%This is [7,4] cyclic code. pg = cyclpoly(n,k,’all’) % Now I get two generatopr polynomials – % [1 0 1 1] and [1 1 0 1]. % ’cyclpoly()’ returns coefficients of generator polynomials in ascending powers of x. % So,[1 0 1 1] = 1 +x^2 +x^3 =x^3 + x^2 + 1 % and [1 1 0 1] = 1+ x + x^3 = x^3 + x +1. d= 0:2^k – 1; dta = de2bi(d,’left-msb’); codes = encode(dta,n,k,’cyclic’,[1 0 1 1]) % Here, I give generator polynomial (x^3 + x^2 + 1)in ascending powers of x according to format %required by encode(). I get this answer :- codes =
0 0 0 0 0 0 0
0 1 1 0 0 0 1
1 1 0 0 0 1 0
1 0 1 0 0 1 1
1 1 1 0 1 0 0
1 0 0 0 1 0 1
0 0 1 0 1 1 0
0 1 0 0 1 1 1
1 0 1 1 0 0 0
1 1 0 1 0 0 1
0 1 1 1 0 1 0
0 0 0 1 0 1 1
0 1 0 1 1 0 0
0 0 1 1 1 0 1
1 0 0 1 1 1 0
1 1 1 1 1 1 1
-----------------------------------------------------------------------------When I check manually,I get the same codes for
generator polynomial = x^3 + x +1.
Also,when I use
codes = encode(dta,n,k,’cyclic’,[1 1 0 1]);
(that is, generator polynomial = x^3 + x + 1 specified by ascending powers of x),
I get the codes given above which are for
generator polynomial = x^3 + x^2 +1 according to manual method.
For reference,I am giving procedure for generating systematic cyclic code:- 1. Write d(x) for given message bits. e.g. For d = [0 0 0 0] ; d(x) = 0 For d =[0 0 0 1] ; d(x)= 1 For d =[0 0 1 1]; d(x) = x +1 For d = [0 1 1 1]; d(x) = x^2 + x +1 2. Find x^(n-k)*d(x). 3.Divide x^(n-k)*d(x) by generator polynomial & find remainder p(x). 4.Find code(x) = x^(n-k)*d(x) + p(x). 5.Write code word corresponding to code(x).
By observation, first 4 columns obtained by manual method are nothing but 4th to 7th columns given by encode() function. Last 3 columns obtained by manual method are first 3 columns of matrix given by encode(). OKAY,NO PROBLEM ! The problem is mentioned above already. Please tell me the reason of this problem. There may be other methods to find [7,4] cyclic codes. If you wish to tell them,you are welcome! But please tell me the reason for my problem!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Error Detection and Correction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!