comm.WalshCode System object

Package: comm

Generate Walsh code from orthogonal set of codes

Description

The WalshCode object generates a Walsh code from an orthogonal set of codes.

To generate a Walsh code:

  1. Define and set up your Walsh code object. See Construction.

  2. Call step to encode the input signal according to the properties of comm.WalshCode. The behavior of step is specific to each object in the toolbox.

Construction

H = comm.WalshCode creates a Walsh code generator System object™, H. This object generates a Walsh code from a set of orthogonal codes.

H = comm.WalshCode(Name,Value) creates a Walsh code 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

Length

Length of generated code

Specify the length of the generated code as a numeric, integer scalar value that is a power of two. The default is 64.

Index

Index of code of interest

Specify the index of the desired code from the available set of codes as a numeric, integer scalar value in the range [0, 1, ... , N-1]. N is the value of the Length property. The default is 60. The number of zero crossings in the generated code equals the value of the specified index.

SamplesPerFrame

Number of output samples per frame

Specify the number of Walsh code samples that the step method outputs as a numeric, positive, integer scalar value . The default is 1. If you set this property to a value of M, then the step method outputs M samples of a Walsh code of length N. N is the length of the code that you specify in the Length property.

OutputDataType

Data type of output

Specify the output data type as double | int8. The default is double.

Methods

cloneCreate Walsh code generator object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset states of Walsh code generator object
stepGenerate Walsh code from orthogonal set of codes

Examples

Generate 10 samples of a length-64 Walsh code sequence.

    hwc = comm.WalshCode('SamplesPerFrame', 10);
    seq = step(hwc)

Algorithms

This object implements the algorithm, inputs, and outputs described on the Walsh Code 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.

Was this topic helpful?