Accelerating the pace of engineering and science

# comm.KasamiSequence System object

Package: comm

Generate Kasami sequence

## Description

The KasamiSequence object generates a sequence from the set of Kasami sequences. The Kasami sequences are a set of sequences that have good cross-correlation properties.

To generate a Kasami sequence:

1. Define and set up your Kasami sequence object. See Construction.

2. Call step to generate a Kasami sequence according to the properties of comm.KasamiSequence. The behavior of step is specific to each object in the toolbox.

## Construction

H = comm.KasamiSequence creates a KasamiSequence System object™, H. This object generates a Kasami sequence.

H = comm.KasamiSequence(Name,Value) creates a Kasami sequence generator object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

## Properties

 Polynomial Generator polynomial Specify the polynomial that determines the shift register's feedback connections. The default is [1 0 0 0 0 1 1]. You can specify the generator polynomial as a binary numeric vector that lists the coefficients of the polynomial in descending order of powers. The first and last elements must equal 1. Specify the length of this vector as n+1, where n is the degree of the generator polynomial and must be even. Alternatively, you can specify the generator polynomial as a vector containing the exponents of z for the nonzero terms of the polynomial in descending order of powers. The last entry must be 0. For example, [1 0 0 0 0 0 1 0 1] and [8 2 0] represent the same polynomial, $g\left(z\right)={z}^{8}+{z}^{2}+1$. InitialConditions Initial conditions of shift register Specify the initial values of the shift register as a binary numeric scalar or as binary numeric vector. The default is [0 0 0 0 0 1]. Set the vector length equal to the degree of the generator polynomial. When you set this property to a vector value, each element of the vector corresponds to the initial value of the corresponding cell in the shift register. When you set this property to a scalar value, that value specifies the initial conditions of all the cells of the shift register. The scalar, or at least one element of the specified vector, requires a nonzero value for the object to generate a nonzero sequence. Index Sequence index Specify the index to select a Kasami sequence of interest from the set of possible sequences. The default is 0. Kasami sequences have a period equal to N = 2n –1, where n indicates a nonnegative, even integer equal to the degree of the generator polynomial that you specify in the Polynomial property. There are two classes of Kasami sequences: those obtained from a small set and those obtained from a large set. You choose a Kasami sequence from the small set by setting this property to a numeric, scalar, integer value in the range [0...2n/2–2]. You choose a sequence from the large set by setting this property to a numeric 1$×$2 integer vector [k m] for k in [–2,..., 2n–2], and m in [–1,..., 2n/2–2]. Shift Sequence offset from initial time Specify the offset of the Kasami sequence from its starting point as a numeric, integer scalar value that can be positive or negative. The default is 0. The Kasami sequence has a period of N = 2n–1, where n is the degree of the generator polynomial that you specify in the Polynomial property. The shift value is wrapped with respect to the sequence period. VariableSizeOutput Enable variable-size outputs Set this property to true to enable an additional input to the step method. The default is false. When you set this property to true, the enabled input specifies the output size of the Kasami sequence used for the step. The input value must be less than or equal to the value of the MaximumOutputSize property. When you set this property to false, the SamplesPerFrame property specifies the number of output samples. MaximumOutputSize Maximum output size Specify the maximum output size of the Kasami sequence as a positive integer 2-element row vector. The second element of the vector must be 1. The default is [10 1]. This property applies when you set the VariableSizeOutput property to true. SamplesPerFrame Number of output samples per frame Specify the number of Kasami sequence samples that the step method outputs as a numeric, positive, integer scalar value . The default value is 1. When you set this property to a value of M, then the step method outputs M samples of a Kasami sequence that has a period of N = 2n–1. The value n equals the degree of the generator polynomial that you specify in the Polynomial property. ResetInputPort Enable generator reset input Set this property to true to enable an additional input to the step method. The default is false. The additional input resets the states of the Kasami sequence generator to the initial conditions that you specify in the InitialConditions property. OutputDataType Data type of output Specify the output data type as one of double | logical. The default is double.

## Methods

 clone Create Kasami sequence generator object with same property values getNumInputs Number of expected inputs to step method getNumOutputs Number of outputs from step method isLocked Locked status for input attributes and nontunable properties release Allow property value and input characteristics changes reset Reset states of Kasami sequence generator object step Generate a Kasami sequence

## Examples

Generate 5 samples of a Kasami sequence of length 63.

```    hks = comm.KasamiSequence('SamplesPerFrame', 5);
x   = step(hks)
```

## Algorithms

This object implements the algorithm, inputs, and outputs described on the Kasami Sequence Generator block reference page. The object properties correspond to the block parameters, except:

• The object does not have a property to select frame based outputs.

• The object does not have a property that corresponds to the Sample time parameter.