System object: comm.PNSequence
Package: comm

Generate a pseudo-noise (PN) sequence


Y = step(H)
Y = step(H,MASK)
Y = step(H,RESET)
Y = step(H,MASK,RESET)


Y = step(H) outputs a frame of the PN sequence in column vector Y. Specify the frame length with the SamplesPerFrame property. The PN sequence has a period of N = 2^n-1, where n is the degree of the generator polynomial that you specify in the Polynomial property.

Y = step(H,MASK) uses MASK as the shift value when you set the MaskSource property to 'Input port'. MASK must be a numeric, binary vector with length equal to the degree of the generator polynomial specified in the Polynomial property. Refer to the Mask property help for details of the mask calculation.

Y = step(H,RESET) uses RESET as the reset signal when you set the ResetInputPort property to true. The data type of the RESET input must be double precision or logical. RESET can be a scalar value or a column vector with length equal to the number of samples per frame specified in the SamplesPerFrame property. When the RESET input is a non zero scalar, the object resets to the initial conditions that you specify in the InitialConditions property and then generates a new output frame. A column vector RESET input allows multiple resets within an output frame. A non-zero value at the ith element of the vector will cause a reset at the ith output sample time. You can combine optional input arguments when you set their enabling properties. Optional inputs must be listed in the same order as the order of the enabling properties. For example,

Y = step(H,MASK,RESET)

    Note:   H specifies the System object™ on which to run this step method.

    The object performs an initialization the first time the step method is executed. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object issues an error. To change nontunable properties or inputs, you must first call the release method to unlock the object.

Was this topic helpful?