#include <AdditiveScrambler.h>
inet::physicallayer::AdditiveScrambler::AdditiveScrambler |
( |
const AdditiveScrambling * |
scrambling | ) |
|
BitVector scramblingSequence
Definition: AdditiveScrambler.h:39
const AdditiveScrambling * scrambling
Definition: AdditiveScrambler.h:40
const ShortBitVector & getGeneratorPolynomial() const
Definition: AdditiveScrambling.h:39
const ShortBitVector & getSeed() const
Definition: AdditiveScrambling.h:40
BitVector generateScramblingSequence(const ShortBitVector &generatorPolynomial, const ShortBitVector &seed) const
Definition: AdditiveScrambler.cc:47
BitVector inet::physicallayer::AdditiveScrambler::descramble |
( |
const BitVector & |
bits | ) |
const |
|
inlineoverridevirtual |
bool inet::physicallayer::AdditiveScrambler::eXOR |
( |
bool |
alpha, |
|
|
bool |
beta |
|
) |
| const |
|
inlineprotected |
Referenced by AdditiveScrambler().
50 int sequenceLength = (int)pow(2, seed.getSize()) - 1;
51 ShortBitVector shiftRegisters = seed;
52 for (
int i = 0; i < sequenceLength; i++) {
53 bool registerSum =
false;
54 for (
unsigned int j = 0; j < generatorPolynomial.getSize(); j++) {
55 if (generatorPolynomial.getBit(j))
56 registerSum =
eXOR(shiftRegisters.getBit(j), registerSum);
58 shiftRegisters.leftShift(1);
59 shiftRegisters.setBit(0, registerSum);
60 scramblingSequence.appendBit(registerSum);
bool eXOR(bool alpha, bool beta) const
Definition: AdditiveScrambler.h:43
BitVector scramblingSequence
Definition: AdditiveScrambler.h:39
const BitVector& inet::physicallayer::AdditiveScrambler::getScramblingSequcene |
( |
| ) |
const |
|
inline |
BitVector scramblingSequence
Definition: AdditiveScrambler.h:39
std::ostream & inet::physicallayer::AdditiveScrambler::printToStream |
( |
std::ostream & |
stream, |
|
|
int |
level |
|
) |
| const |
|
overridevirtual |
Prints this object to the provided output stream.
Function calls to operator<< with pointers or references either const or not are all forwarded to this function.
Reimplemented from inet::physicallayer::IPrintableObject.
Referenced by inet::physicallayer::AdditiveScramblerModule::printToStream().
27 stream <<
"AdditiveScrambler";
std::string printObjectToString(const IPrintableObject *object, int level)
Definition: IPrintableObject.h:73
const AdditiveScrambling * scrambling
Definition: AdditiveScrambler.h:40
Definition: IPrintableObject.h:34
BitVector inet::physicallayer::AdditiveScrambler::scramble |
( |
const BitVector & |
bits | ) |
const |
|
overridevirtual |
Implements inet::physicallayer::IScrambler.
Referenced by inet::physicallayer::AdditiveScramblerModule::scramble().
35 EV_DEBUG <<
"Scrambling the following bits: " << bits << endl;
36 BitVector scrambledBits;
38 for (
unsigned int i = 0; i < bits.getSize(); i++) {
39 int scramblingIndex = i % sequenceLength;
41 scrambledBits.appendBit(scrambledBit);
43 EV_DEBUG <<
"The scrambled bits are: " << scrambledBits << endl;
unsigned int getSize() const
Definition: BitVector.h:53
bool eXOR(bool alpha, bool beta) const
Definition: AdditiveScrambler.h:43
BitVector scramblingSequence
Definition: AdditiveScrambler.h:39
bool getBit(int pos) const
Definition: BitVector.cc:82
BitVector inet::physicallayer::AdditiveScrambler::scramblingSequence |
|
protected |
The documentation for this class was generated from the following files: