Documentation

Walsh Code Generator

Generate Walsh code from orthogonal set of codes

Library

Sequence Generators sublibrary of Comm Sources

Description

Walsh codes are defined as a set ofNcodes, denotedWj, forj= 0, 1, ... ,N- 1, which have the following properties:

  • Wjtakes on the values +1 and -1.

  • Wj[0] = 1 for allj.

  • Wjhas exactlyjzero crossings, forj= 0, 1, ... ,N- 1.

  • W j W k T = { 0 j k N j = k

  • Each code Wjis either even or odd with respect to its midpoint.

Walsh codes are defined using a Hadamard matrix of orderN. The Walsh Code Generator block outputs a row of the Hadamard matrix specified by theWalsh code index,必须是一个整数范围(0…N- 1]. If you setWalsh code indexequal to an integerj, the output code has exactlyjzero crossings, forj= 0, 1, ... ,N- 1.

Note, however, that the indexing in the Walsh Code Generator block is different than the indexing in the Hadamard Code Generator block. If you set theWalsh code indexin the Walsh Code Generator block and theCode index parameterin the Hadamard Code Generator block, the two blocks output different codes.

Parameters

Code length

Integer scalar that is a power of 2 specifying the length of the output code.

Code index

Integer scalar in the range [0, 1, ... , N - 1], where N is theCode length, specifying the number of zero crossings in the output code.

Sample time

The time between each sample of the output signal. Specify as a nonnegative real scalar.

Samples per frame

The number of samples in one column of the output signal. IfSamples per frameis greater than theCode length, the code is cyclically repeated. Specify as a positive integer scalar.

Note

The time between output updates is equal to the product ofSamples per frameandSample time. For example, ifSample timeandSamples per frameequal one, the block outputs a sample every second. IfSamples per frameis increased to 10, then a 10-by-1 vector is output every 10 seconds. This ensures that the equivalent output rate is not dependent on theSamples per frameparameter.

Output data type

The output type of the block can be specified as anint8ordouble. By default, the block sets this todouble.

Extended Capabilities

Introduced before R2006a