sequence.h
Go to the documentation of this file.
#ifndef SEQUENCE_H
#define SEQUENCE_H
#include <itpp/base/vec.h>
#include <itpp/base/mat.h>
#include <itpp/itexports.h>
namespace itpp
{
class ITPP_EXPORT LFSR
{
public:
LFSR(void) {};
LFSR(const bvec &connections);
LFSR(const ivec &connections);
void set_connections(const bvec &connections);
void set_connections(const ivec &connections);
void set_state(const bvec &state);
void set_state(const ivec &state);
bin shift(void);
bvec shift(int no_shifts);
int get_length(void);
bvec get_state(void);
private:
bvec memory, Connections;
};
class ITPP_EXPORT Gold
{
public:
Gold(int degree);
Gold(const bvec &mseq1_connections, const bvec &mseq2_connections);
Gold(const ivec &mseq1_connections, const ivec &mseq2_connections);
void set_state(const bvec &state1, const bvec &state2);
void set_state(const ivec &state1, const ivec &state2);
bin shift(void);
bvec shift(int no_shifts);
int get_sequence_length(void);
bmat get_family(void);
private:
int N;
LFSR mseq1, mseq2;
};
// --------------- Inlines ---------------------
inline bin LFSR::shift(void) {bin temp = memory * Connections;memory.shift_right(temp);return temp;}
inline int LFSR::get_length(void) {return memory.size();}
inline bvec LFSR::get_state(void) {return memory;}
inline bin Gold::shift(void) {return (mseq1.shift() + mseq2.shift());}
inline int Gold::get_sequence_length(void) {return N;}
// --------------- Functions ---------------------
ITPP_EXPORT smat wcdma_spreading_codes(int SF);
} // namespace itpp
#endif // #ifndef SEQUENCE_H
itpp::Array
General array class.
Definition array.h:105
itpp::Gold
Gold Sequences.
Definition sequence.h:87
itpp::Gold::get_sequence_length
int get_sequence_length(void)
Returns the length (period) of a Gold-sequence.
Definition sequence.h:130
itpp::Gold::shift
bin shift(void)
Shift one step and output binary symbol.
Definition sequence.h:129
itpp::LFSR
Binary Linear Feedback Shift Register (LFSR)
Definition sequence.h:54
itpp::LFSR::LFSR
LFSR(void)
Constructor.
Definition sequence.h:57
itpp::LFSR::get_length
int get_length(void)
Return length of shift register.
Definition sequence.h:126
itpp::LFSR::get_state
bvec get_state(void)
Returns the state of the shift register.
Definition sequence.h:127
itpp::LFSR::shift
bin shift(void)
Shift one step and output binary symbol.
Definition sequence.h:125
itpp::bin
Binary arithmetic (boolean) class.
Definition binary.h:57
itpp::wcdma_spreading_codes
smat wcdma_spreading_codes(int SF)
Generates the OVSF (orthogonal variable spreading factor) spreading codes used in WCDMA.
Definition sequence.cpp:168
mat.h
Matrix Class Definitions.
bmat
Mat< bin > bmat
bin matrix
Definition mat.h:508
itpp
itpp namespace
Definition itmex.h:37
vec.h
Templated Vector Class Definitions.

Generated on Mon Jun 10 2024 11:49:22 for IT++ by Doxygen 1.9.8