Generate Hadamard code from orthogonal set of codes
The Hadamard Code Generator block generates a Hadamard code from a Hadamard matrix, whose rows form an orthogonal set of codes. Orthogonal codes can be used for spreading in communication systems in which the receiver is perfectly synchronized with the transmitter. In these systems, the despreading operation is ideal, as the codes are decorrelated completely.
The Hadamard codes are the individual rows of a Hadamard matrix. Hadamard matrices are square matrices whose entries are +1 or -1, and whose rows and columns are mutually orthogonal. If N is a nonnegative power of 2, the N-by-N Hadamard matrix, denoted HN, is defined recursively as follows.
The N-by-N Hadamard matrix has the property that
HNHNT = NIN
where IN is the N-by-N identity matrix.
The Hadamard Code Generator block outputs a row of HN. The output is bipolar. You specify the length of the code, N, by the Code length parameter. The Code length must be a power of 2. You specify the index of the row of the Hadamard matrix, which is an integer in the range [0, 1, ... , N-1], by the Code index parameter.
A positive integer that is a power of two specifying the length of the Hadamard code.
An integer between 0 and N-1, where N is the Code length, specifying a row of the Hadamard matrix.
A positive real scalar specifying the sample time of the output signal.
Determines whether the output is frame-based or sample-based.
The number of samples in a frame-based output signal. This field is active only if you select Frame-based outputs.
The output type of the block can be specified as an int8 or double. By default, the block sets this to double.