Manipulating Galois Variables
2016-07-18 16:10
232 查看
Communications Toolbox
Manipulating Galois Variables
This section describes techniques for manipulating Galois variables or for transferring information between Galois arrays and ordinary MATLAB arrays.
Determining Whether a Variable Is a Galois Array
To find out whether a variable is a Galois array rather than an ordinary MATLAB array, use the
Extracting Information From a Galois Array
To extract the array elements, field order, or primitive polynomial from a variable that is a Galois array, append a suffix to the name of the variable. The table below lists the exact suffixes, which are independent of
the name of the variable.
The code below illustrates the use of these suffixes. The definition of
appropriate number of bits.
This section describes techniques for manipulating Galois variables or for transferring information between Galois arrays and ordinary MATLAB arrays.
Note These techniques are particularly relevant if you write M-file functions that process Galois arrays. For an example of this type of usage, enteredit gf/convin the Command Window and examine the first several lines of code in the editor window. |
To find out whether a variable is a Galois array rather than an ordinary MATLAB array, use the
isafunction. An illustration is below.
mlvar = eye(3); gfvar = gf(mlvar,3); no = isa(mlvar,'gf'); % False because mlvar is not a Galois array yes = isa(gfvar,'gf'); % True because gfvar is a Galois array
Extracting Information From a Galois Array
To extract the array elements, field order, or primitive polynomial from a variable that is a Galois array, append a suffix to the name of the variable. The table below lists the exact suffixes, which are independent of
the name of the variable.
Information | Suffix | Output Value |
Array elements | .x | MATLAB array of type uint16that contains the data values from the Galois array |
Field order | .m | Integer of type doublethat indicates that the Galois array is in GF( 2^m) |
Primitive polynomial | .prim_poly | Integer of type uint32that represents the primitive polynomial. The representation is similar to the description in How Integers Correspond to Galois Field Elements. |
Note If the output value is an integer data type and you want to convert it todoublefor later manipulation, use the doublefunction. |
empruses a vector of binary coefficients of a polynomial to create a Galois array in an extension field. Another part of the example retrieves the primitive polynomial for the field and converts it to a binary vector representation having the
appropriate number of bits.
% Check that e solves its own minimal polynomial. e = gf(5,4); % An element of GF(16) emp = minpol(e); % The minimal polynomial, emp, is in GF(2). empr = roots(gf(emp.x,e.m)) % Find roots of emp in GF(16). % Check that the primitive element gf(2,m) is % really a root of the primitive polynomial for the field. primpoly_int = double(e.prim_poly); mval = e.m; primpoly_vect = gf(de2bi(primpoly_int,mval+1,'left-msb'),mval); containstwo = roots(primpoly_vect); % Output vector includes 2.
相关文章推荐
- 第一次机房收费系统-回顾总结(一)
- RTMPdump(libRTMP) 源代码分析 8: 发送消息(Message)
- error=Error Domain=NSURLErrorDomain Code=-1003
- 认识createjs(二) Container容器及监听事件
- 计蒜客-程序设计竞赛入门
- cesiumjs开发实践 (七)
- Java-IO之Apache Commons IO(1)
- unity3d中上下左右键控制移动
- Toolbar的适配方案
- test1
- 文本分词中词语词性标注说明
- JAVA中int、String的类型转换
- floodlight学习系列(1)——在Eclipse中安装运行floodlight
- 移动端JS 触摸事件基础
- Android UI线程和非UI线程
- java中HashSet详解
- leetcode_c++:链表:Intersection of Two Linked Lists(160)
- Android应用语言切换功能
- win7频繁提示资源管理器已停止工作解决办法
- NSString使用大全