Prev Next nrzbits

Randon Non-Return-Zero Binary Data
Syntax y = nrzbits(N)
Syntax y = nrzbits(N,M)
Include: include spt\nrzbits.oms
See Also binbits

ARGUMENTS:
   INPUTS:  
      N = SCALAR, any numerical type, coerced to INTEGER
          before processing. Represents the number of rows
          in the returned matrix.
      M = SCALAR, any numerical type, coerced to INTEGER
          before processing. Represents the number of 
          columns in the returned matrix.
   RETURN: MATRIX, INTEGER, equi-probable 1s and -1s.

Description

Create matrix of random Non-Return-to-Zero (NRZ) symbols, i.e., equi-probable values of -1 or 1. Returns a matrix filled with equi-probable non-return-to-zero bits, i.e., 1s and -1s. Integer type in returned. Binary data is sometimes represented this way since multiplication of 1s and -1s is isomorphic to binary addition.

Example
Create a 5x6 array of +1's and -1's:

O>nrzbits(5,6)
{
[  -1 ,  -1 ,  -1 ,   1 ,  -1 ,  -1 ]
[  -1 ,   1 ,   1 ,   1 ,  -1 ,   1 ]
[   1 ,  -1 ,   1 ,  -1 ,  -1 ,   1 ]
[   1 ,  -1 ,   1 ,  -1 ,   1 ,   1 ]
[   1 ,  -1 ,  -1 ,  -1 ,  -1 ,  -1 ]
}