50 memory.set_size(N,
true);
58 memory.set_size(N,
true);
107 it_error(
"This degree of Gold sequence is not available");
154 bmat codes(N + 2, N);
159 codes.set_row(0, mseq1.
shift(N));
160 codes.set_row(1, mseq2.
shift(N));
162 for (
int i = 0;
i < N;
i++) {
163 codes.set_row(
i + 2, codes.get_row(0) +
concat((codes.get_row(1)).right(
i), (codes.get_row(1)).left(N -
i)));
170 it_assert((
SF == 1) || (
SF == 2) || (
SF == 4) || (
SF == 8) || (
SF == 16) || (
SF == 32) || (
SF == 64) || (
SF == 128) || (
SF == 256) || (
SF == 512),
171 "wcdma_spreading_codes: SF must equal 1, 2, 4, 8, 16, 32, 64, 128, 256, or 512");
174 codes(0, 0) =
short(1);
180 for (
i = 0;
i <
SF / 2;
i++) {
int size() const
Returns the number of data elements in the array object.
int length() const
Returns the number of data elements in the array object.
Array< T > right(int n) const
Get n right elements of the array.
Gold(int degree)
Class constructor.
void set_state(const bvec &state1, const bvec &state2)
Set state (contents in the shift registers) in bvec format.
bin shift(void)
Shift one step and output binary symbol.
bmat get_family(void)
Returns the code family.
void set_connections(const bvec &connections)
Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in bvec format [g0,g1,...,gr].
void set_state(const bvec &state)
Set state (contents in the shift registers) in bvec format.
int get_length(void)
Return length of shift register.
bin shift(void)
Shift one step and output binary symbol.
Definitions of converters between different vector and matrix types.
#define it_error(s)
Abort unconditionally.
#define it_assert(t, s)
Abort if t is not true.
int pow2i(int x)
Calculate two to the power of x (2^x); x is integer.
smat wcdma_spreading_codes(int SF)
Generates the OVSF (orthogonal variable spreading factor) spreading codes used in WCDMA.
Logarithmic and exponenential functions - header file.
Mat< bin > bmat
bin matrix
ITPP_EXPORT bvec oct2bin(const ivec &octalindex, short keepzeros=0)
Convert ivec of octal form to bvec.
const Array< T > concat(const Array< T > &a, const T &e)
Append element e to the end of the Array a.
ITPP_EXPORT bvec dec2bin(int length, int index)
Convert a decimal int index to bvec using length bits in the representation.
Definitions of binary sequence classes and functions.