# Gold Sequence Generator

Generate Gold sequence from set of sequences

• Library:
• Communications Toolbox / Comm Sources / Sequence Generators

## Description

The Gold Sequence Generator block generates a binary sequence with small periodic cross-correlation properties from a bounded set of sequences. For more information on Gold sequences, see Gold Sequences.

## Ports

### Input

expand all

Current output size, specified as a scalar or a two-element row vector. The second element of the vector must be `1`.

Example: `[10 1]` indicates the current output column vector will be of size 10-by-1.

#### Dependencies

To enable this port select the Output variable-size signals parameter and set Maximum output size source to `Dialog parameter`.

Data Types: `double`

Reference input signal, specified as a scalar, column vector.

#### Dependencies

To enable this port select the Output variable-size signals parameter and set Maximum output size source to `Inherit from reference input`.

Data Types: `double`

Reset signal, specified in one of these forms.

• When the output size is variable specify as a scalar.

• Otherwise, specify as a scalar or a 2-D column vector with a length equal to Samples per frame.

The output signal resets for nonzero Rst input values. For more information, see Reset Behavior

#### Dependencies

To enable this port, select the Reset on nonzero input parameter.

Data Types: `double`

### Output

expand all

Output signal, returned as a binary column vector. At least one element of the Initial states (1) or Initial states (2) vector must be nonzero in order for the block to generate a nonzero sequence.

Data Types: `double`

## Parameters

expand all

First sequence polynomial, specified in one of these forms.

• A polynomial character vector such as `'z^3 + z^2 + 1'`.

• A binary row vector that represents the coefficients of the generator polynomial in order of descending power. The length of this vector is (N+1), where N is the degree of the generator polynomial. For example, `[1 1 0 1]` represents the polynomial x3+ z2+ 1.

• An integer row vector containing the exponents of z for the nonzero terms in the polynomial in descending order. For example, `[3 2 0]` represents the polynomial z3 + z2 + 1.

For more information, see Character Representation of Polynomials and Preferred Pairs of Sequences.

Initial states of the shift register for first sequence polynomial of the preferred pair, specified as a binary vector with length equal to the degree of Preferred polynomial (1).

Second sequence polynomial, specified in one of these forms.

• A polynomial character vector such as `'z^3 + z^2 + 1'`.

• A binary row vector that represents the coefficients of the generator polynomial in order of descending power. The length of this vector is (N+1), where N is the degree of the generator polynomial. For example, `[1 1 0 1]` represents the polynomial x3+ z2+ 1.

• An integer row vector containing the exponents of z for the nonzero terms in the polynomial in descending order. For example, `[3 2 0]` represents the polynomial z3 + z2 + 1.

Initial states of the shift register for second sequence polynomial of the preferred pair, specified as a binary vector with length equal to the degree of Preferred polynomial (2).

Sequence index of the output sequence from the set of sequences, specified as an integer scalar in the range [–2, 2n–2]. n is the degree of the preferred polynomials.

Offset of Gold sequence from the initial time, specified as an integer scalar.

Select this parameter to permit variable length output sequences during simulation. When set to `off`, fixed-length sequences are output. When set to `on`, variable-length sequences can be output. For information about variable-size signals, see Variable-Size Signal Basics (Simulink).

Maximum output size source, which indicates how the maximum sequence output size is specified.

• `Dialog parameter` configures the block to use the Maximum output size parameter setting as the maximum permitted output sequence length. When you make this selection, the oSiz input port specifies the current size of the output signal and the block output inherits sample time from the input signal. The input value of oSiz must be less than or equal to the Maximum output size parameter.

• `Inherit from reference port` adds the `Ref` input port and configures the block to inherit the sample time, maximum size, and the current output size from the variable-sized signal at the `Ref` input port to set the maximum permitted output sequence length.

#### Dependencies

To enable this parameter, select Output variable-size signals.

Maximum output size, specified as a two-element row vector that denotes the maximum output size for the block. The second element of the vector must be `1`.

Example: `[10 1]` gives a 10-by-1 maximum sized output signal.

#### Dependencies

To enable this parameter select Output variable-size signals and set Maximum output size source to ```Dialog parameter```.

Data Types: `double`

Output sample time, specified as `-1` or a positive scalar that represents the time between each sample of the output signal. If Sample time is set to `-1`, the sample time is inherited from downstream. For information on the relationship between Sample time and Samples per frame, see Sample Timing.

#### Dependencies

To enable this parameter do not select Output variable-size signals.

Samples per frame, specified as a positive integer indicating the number of samples per frame in one channel of the output data. For information on the relationship between Sample time and Samples per frame, see Sample Timing.

#### Dependencies

To enable this parameter do not select Output variable-size signals.

Select this parameter to enable the Rst port. When a nonzero value is input at the Rst port, the internal shift registers are reset to the original values of the Initial states (1) and Initial states (2) parameters.

Output data type, specified as `boolean`, `double`, or `Smallest unsigned integer`.

When set to `Smallest unsigned integer`, the output data type is selected based on the settings used in the Hardware Implementation Pane (Simulink) of the Configuration Parameters dialog box of the model. If ASIC/FPGA is selected in the Hardware Implementation pane, the output data type is the ideal minimum one-bit size (ufix(1)). For all other selections, it is an unsigned integer with the smallest available word length large enough to fit one bit, usually corresponding to the size of a char (uint8).

## Block Characteristics

 Data Types `Boolean` | `double` | `fixed point` Multidimensional Signals `no` Variable-Size Signals `yes`

expand all

## Compatibility Considerations

expand all

Behavior changed in R2020a

## References

[1] Proakis, John G. Digital Communications. 3rd ed. New York: McGraw Hill, 1995.

[2] Gold, R. “Maximal Recursive Sequences with 3-Valued Recursive Cross-Correlation Functions (Corresp.).” IEEE Transactions on Information Theory 14, no. 1 (January 1968): 154–56. https://doi.org/10.1109/TIT.1968.1054106.

[3] Gold, R. “Optimal Binary Sequences for Spread Spectrum Multiplexing (Corresp.).” IEEE Transactions on Information Theory 13, no. 4 (October 1967): 619–21. https://doi.org/10.1109/TIT.1967.1054048.

[4] Sarwate, D.V., and M.B. Pursley, "Crosscorrelation Properties of Pseudorandom and Related Sequences," Proc. IEEE , Vol. 68, No. 5, May, 1980, pp. 583-619.

[5] Dixon, Robert C. Spread Spectrum Systems: With Commercial Applications. 3rd ed. New York: Wiley, 1994.

## Extended Capabilities

### Objects

Introduced before R2006a