The simplest way to get an orthogonal code dictionary is to generate a Hadamard/Walsh matrix. All the rows and columns of this matrix are mutually orthogonal. You can use a couple of its rows or columns as your codes. Please remember that the size of the matrix (and hence the length of the code) can only be a power of 2, for example N = 4, 8, 16, 32,64,....
The code is simple: for example for N=64-length codes:
C = hadamard(64);
code1 = C(: , 3); % the code will be a vertical column
The simplest way to get an orthogonal code dictionary is to generate a Hadamard/Walsh matrix. All the rows and columns of this matrix are mutually orthogonal. You can use a couple of its rows or columns as your codes. Please remember that the size of the matrix (and hence the length of the code) can only be a power of 2, for example N = 4, 8, 16, 32,64,....
The code is simple: for example for N=64-length codes:
C = hadamard(64);
code1 = C(: , 3); % the code will be a vertical column