Go to the documentation of this file.
58 out.set_size(symbols.length()*
N,
false);
60 for (
int i = 0;i < symbols.length();i++)
61 out.replace_mid(i*
N, symbols(i)*
code);
66 int nosymbols = (int)
std::floor(
double((rec_signal.length() - timing)) /
N);
67 out.set_size(nosymbols);
69 for (
int i = 0;i < nosymbols;i++)
70 out(i) = rec_signal.mid(i *
N + timing,
N) *
code;
93 it_assert(incodeI.length() == incodeQ.length(),
"Size of I and Q codes doesn't match");
123 for (
int i = 0; i <
L; i++)
135 int nomcsymbols = (int)
std::floor(
double(symbols.length() /
L));
136 vec temp(nomcsymbols*
N);
138 for (i = 0;i < nomcsymbols;i++) {
139 temp.replace_mid(i*
N,
codes.T() * symbols.mid(i*
L,
L));
148 int nosymbols = (int)
std::floor(
double((receivedsignal.length() - timing)) /
N);
149 vec temp(nosymbols*
L);
151 for (i = 0;i < nosymbols;i++) {
152 temp.replace_mid(i*
L,
codes*receivedsignal.mid(i*
N + timing,
N));
178 it_assert(incodesI.rows() == incodesQ.rows() && incodesI.cols() == incodesQ.cols(),
179 "Multicode_Spread_2d::set_codes(): dimension mismatch");
mat get_codesI()
Return the matrix containing the in-phase codes (as rows)
Multicode_Spread_2d()
Constructor.
Multicode_Spread_1d mcspreadQ
vec despread(const vec &receivedsignal, int timing)
Despreading of signal. timing is the start position of the first symbol, given in number of samples.
void set_code(const vec &incodeI, const vec &incodeQ)
Set the in-phase and the quadrature-phase spreading codes.
vec imag(const cvec &data)
Imaginary part of complex values.
void spread(const cvec &symbols, cvec &out)
Spreading of signal.
Multicode_Spread_1d()
Constructor.
vec spread(const vec &symbols)
Spreading function.
Definition of spread spectrum classes and functions.
void spread(const vec &symbols, vec &out)
Spreading of signal return i out.
void set_codes(const mat &incodesI, const mat &incodesQ)
Set the spreading codes.
vec get_code()
Returns the spreading code used.
Miscellaneous statistics functions and classes - header file.
mat get_codes()
Returns the matrix containing the spreading codes used as rows in the matrix.
mat get_codesQ()
Return the matrix containing the quadrature-phase codes (as rows)
void set_codes(const mat &incodes)
Set the spreading codes. Each row represent one spreading code. The spreading factor equals the numbe...
int L
The number of multi-codes.
vec code
The spreading code.
cvec to_cvec(const Vec< T > &v)
Converts a Vec<T> to cvec.
void despread(const cvec &rec_signal, cvec &out, int timing)
Despreading of signal. timing is the start position of the first symbol, given in number of samples.
vec floor(const vec &x)
Round to nearest lower integer.
cvec despread(const cvec &receivedsignal, int timing)
Despreading of signal. timing is the start position of the first symbol, given in number of samples.
void despread(const vec &rec_signal, vec &out, int timing)
Despreading of signal. timing is the start position of the first symbol, given in number of samples.
int N
The spreading factor.
double norm(const cvec &v)
Calculate the 2-norm: norm(v)=sqrt(sum(abs(v).^2))
int N
The spreading factor.
cvec spread(const cvec &symbols)
Spreading of signal.
vec get_codeI()
Returns the in-phase spreading code.
vec real(const cvec &data)
Real part of complex values.
mat codes
The spreading codes used size ( )
Multicode_Spread_1d mcspreadI
Definitions of converters between different vector and matrix types.
void set_code(const vec &incode)
Set the spreading code used for spreading.
vec get_codeQ()
Returns the quadrature-phase spreading code.
#define it_assert(t, s)
Abort if t is not true.
Generated on Mon Mar 23 2020 06:18:03 for IT++ by Doxygen 1.8.17