comm.WalshCode
Generate bipolar Walsh code
Description
The comm.WalshCode
System object™ generates a bipolar Walsh code from an orthogonal set of codes.
To generate a Walsh code:
Create the
comm.WalshCode
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Creation
Description
creates a Walsh
code generator System object. This object generates a Walsh code from a set of orthogonal codes.walshCode
= comm.WalshCode
sets properties using one or more name-value arguments. For example,
walshCode
= comm.WalshCode(Name
=Value
)Length=11
specifies a Walsh code of length 11.
Properties
Usage
Syntax
Description
outputs a bipolar Walsh code
frame as a column vector. If the frame length exceeds the Walsh code length, the object
fills the frame by repeating the Walsh code. For more information, see the Algorithms
section.y
= walshCode
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
Examples
Algorithms
Walsh codes are defined as a set of N codes, denoted Wj, for j = 0, 1, ... , N - 1, which have the following properties:
Wj takes on the values +1 and -1.
Wj[0] = 1 for all j.
Wj has exactly j zero crossings, for j = 0, 1, ... , N - 1.
Each code Wj is either even or odd with respect to its midpoint.
Walsh codes are defined using a Hadamard matrix of order N, where
N is a nonnegative power of 2 that you specify in the
Length property. The
comm.WalshCode
System object outputs a row of the Hadamard matrix. Use the Index property to choose the row of the Hadamard matrix. If you set the
Index property equal to an integer
j, the output code has exactly j zero crossings,
for j = 0, 1, ... , N - 1.
Note, however, that the indexing in Walsh code is different from the indexing in Hadamard code.
Extended Capabilities
Version History
Introduced in R2012a