With the advancement in the cellular technology and convergence of wireless technologies, now it is the need to combine two messages having different data rates in an orthogonal manner. Take an example, the date rate of user 1 is *r*_{1} and of user 2 is *r*_{2} and we have to spread the user 1 message by spreading factor *s*_{1} and that of user 2 by *s*_{2}, so that we can produce and overall chip rate of ρ. we can use Walsh Hadamard sequences if the spreading factors are powers of 2. The result so obtained is referred to as *Orthogonal Variable Spreading factor* and is showed in figure 1.

Orthogonal Variable Spreading Factor - An Illustration

For OVSF the orthogonality requirement can be stated mathematically as (for the given figure)

ovsf orthogonality requirement

This is, code 1, of duration *T*_{1} is orthogonal to all subsequences of code 2, of the same length, and offset by a multiple of *T*_{1}, the length of code 1.

Now, as we know, OVSF is important in terms of WCDMA and LTE, the question is how we will generate OVSF codes? We can generate OVSF codes by following algorithm.

Suppose we want to generate OVSF codes of length *n*_{1} and *n*_{2}, where *n*_{1} < *n*_{2}, then:

- Construct
*H*_{n1} by usual Walsh-Hadamard algorithm.

- Choose one row of matrix
*H*_{n1} as the code length of 2^{n1}. Let *H*_{n1}‘ represent the Hadamard matrix with the selected row removed.

- Continue the Walsh- Hadamard algorithm with
*H*_{n1}‘: that is

Modified Matrix for OVSF

Then continue until desired *H*_{n2}‘ is constructed.

- Choose any row of
*H*_{n2}‘ as the spreading code of length 2n2

- If a third code is needed, then continue in a similar manner.

A matlab function can be downloaded from the given below links. The usage is given below.

Usage

% x = ovsf(y,z)

%x, the output cell array having required OVSF codes

%y, number of codes required

%z, array having length of each code to the base 2 i.e. 2.^2 = 4

%example y = 3 z = [4 2 3]

%this will give a cell array with [1x4] [1x8] [1x16]

%length = 2.^n , enter n in length of array

%The code is not optimized yet, user is free to optimize

%do not forget to leave a comment

Download Links:

Resource Center

Matlab File Exchange

================

Author : Ashwini Patankar

### Like this:

Like Loading...

*Related*

Pingback: Cellular-Technology » Ericsson will replace Ugly Cell Phone Towers. | Taranfx ...

hey ashwini,

the ovsf function works gr8.. but i’ve tried to optimise it to generate the codes sequentially, so code{1} will be the first code in the respective SF tree

and so on..but with no success… help??!!

Hi Santosh,

I did not get much time to look into the code and run it with modification. But i think, you want to generate say 3 codes of length [5 8 4], and want to get the out put matrix say X, having first row of length 5, second of 8 and 3rd of 4, I hope i am stating your problem correctly, if it is so then just comment line 24 i.e. len_codes = sort (len_codes);

I hope this will produce the desired results. else mention your problem with any small example, i.e. what will be the input and what will be the desired out put.

Thanks and Regards,

Ashwini Shankar Patankar

I want matlab coding for efficient channelization code management in WCDMA using ovsf codes to reduce code blocking problem and increasing the efficiency

Dear Dhivya,

check matlab file exchange

All the best,

Ashwini for WirelessCafe !!