
HadamardCode |
ptolemy.actor.lib.comm.HadamardCode |
Produce a Hadamard codeword by selecting a row from a Hadamard matrix.
The log base 2 of the matrix dimension is given by the <i>log2Length</i>
parameter, which should be a non-negative integer smaller than 32.
The row index is given by the <i>index</i> parameter or by the associated
<i>index</i> port, which should be a non-negative integer smaller
than the matrix dimension. If the index changes value when the actor is
in the middle of producing a sequence of Hadamard codeword, the actor
will take on the new index value, and start to produce the new codeword
from the beginning.
<p>
A Hadamard matrix is defined in the following way:
<p>
<i>H</i><sub>1</sub> = [1, 1; 1, -1]
<p>
<i>H</i><sub><i>n</i>+1</sub> = [<i>H</i><sub><i>n</i></sub>,
<i>H</i><sub><i>n</i></sub>;
<i>H</i><sub><i>n</i></sub>, -<i>H</i><sub><i>n</i></sub>]
<p>
where <i>n</i> is a positive integer.
Therefore, H<sub><i>n</i></sub> is a 2<sup><i>n</i></sup> by
2<sup><i>n</i></sup> square matrix.
The codeword length is 2<sup><i>n</i></sup>.
<p>
The actor produces Hadamard codeword in booleans. Therefore, 1 is treated
as "true" and -1 is treated as "false".
<p>
Author(s): Edward A. Lee and Ye Zhou
Version:$Id: HadamardCode.doc.html,v 1.1 2006/02/22 18:40:27 mangal Exp $
Pt.Proposed Rating:Red (eal)
Pt.Accepted Rating:Red (cxh)
index
Index of the code to generate. Codes with different indexes
are orthogonal. This is an int with default 0. It should
not exceed length-1, where length = 2^log2Length.
log2Length
Log base 2 of the length of the code. This is an integer with
default 5. It is required to be greater than 0.