Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj) and y = obj() perform equivalent operations.

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

resetReset states of Walsh code generator object
stepGenerate Walsh code from orthogonal set of codes
Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

expand all

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

walsh = comm.WalshCode('SamplesPerFrame',16)
seq = walsh()
walsh = 

  comm.WalshCode with properties:

             Length: 64
              Index: 60
    SamplesPerFrame: 16
     OutputDataType: 'double'


seq =

     1
    -1
     1
    -1
     1
    -1
     1
    -1
     1
    -1
     1
    -1
     1
    -1
     1
    -1

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.

Extended Capabilities

Introduced in R2012a

Was this topic helpful?