Main Content

comm.OVSFCode

Generate OVSF code

Description

The comm.OVSFCode System object™ generates a code from an orthogonal variable spreading factor (OVSF) matrix. Use OVSF codes to preserve orthogonality between different channels in a spread spectrum communications system. For more information, see Algorithms.

To generate an OVSF code:

  1. Create the comm.OVSFCode object and set its properties.

  2. 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

ovsf = comm.OVSFCode creates a System object that generates orthogonal variable spreading factor (OVSF) codes.

ovsf = comm.OVSFCode(Name=Value) creates an OVSF code generator object with each specified property set to the specified value. For example, comm.OVSFCode(SpreadingFactor="128",SamplesPerFrame="10") outputs the first ten chips of a spreading factor length 128 OVSF code generator.

example

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Length of the generated code, specified as a positive integer power of 2. For more information, see Spread Spectrum.

The spreading factor is the length of the code selected from the OVSF code matrix. OVSF codes are defined as the rows of an N-by-N matrix, CN. The Index property specifies the row of the CN matrix as the code of interest. For more information, see Orthogonal Variable Spreading Factor Codes.

Row index of the OVSF code matrix, specified as a positive integer in the range [0, (N – 1)]. N is the code length, as specified by the SpreadingFactor property. OVSF codes are defined as the rows of an N-by-N matrix, CN. The value of this property specifies the row of the CN matrix as the code of interest. For more information, see Recovering and Reconstructing OVSF Codes.

Number of OVSF code chips output, specified as a positive integer. Each time the object runs, it outputs the first SamplesPerFrame chips of the OVSF code specified by the SpreadingFactor and Index property values. The OVSF code sequence repeats to fill the specified number of chips. For more information, see Spread Spectrum.

Output data type, specified as 'double' or 'int8'.

Usage

Description

Y = ovsf() outputs a frame of the OVSF code in a column vector.

example

Output Arguments

expand all

Frame of OVSF code samples, returned as a column vector. Specify the data type to output with the OutputDataType property.

Data Types: double | int8

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)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Generate 10 samples of an OVSF code with a spreading factor of 32.

ovsf = comm.OVSFCode( ...
    SpreadingFactor=32, ...
    Index=12, ...
    SamplesPerFrame=10);
seq = ovsf()
seq = 10×1

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

Algorithms

expand all

As discussed in [1], OVSF codes were first introduced for 3G communication systems and are primarily used to preserve orthogonality between different channels in a spread spectrum communications system.

References

[1] Kasapović, S. and N. Sarajlić. "OVSF code assignment in UMTS networks." 2010 20th International Crimean Conference "Microwave & Telecommunication Technology", 429–32. Sevastopol: IEEE®, 2010. https://doi.org/10.1109/CRMICO.2010.5632706.

Extended Capabilities

Version History

Introduced in R2012a