Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

signals.h File Reference

Declaration of the signals to exchange information between interfaces. More...

#include <iostream>
#include <vector>
#include <stdexcept>
#include <simthetic/misc.h>
#include <simthetic/array.h>
#include <simthetic/checkedvector.h>

Go to the source code of this file.

Namespaces

namespace  simth

Sequence types with builtin-type names.

typedef SignalSequence< bool > BoolSeq
typedef SignalSequence< int > IntSeq
typedef SignalSequence< double > DoubleSeq
typedef SignalSequence< ComplexComplexSeq
typedef simth::Array< ComplexComplexArray

Sequence types with transmission system names.

typedef BoolSeq BitSeq
typedef IntSeq ModIndSeq
typedef DoubleSeq PhaseSeq
typedef ComplexSeq ModSeq
typedef ComplexArray SignalSym
typedef SignalSequence< SignalSymSymSeq
typedef double LlrType
typedef double LlvType
typedef simth::checkedVector<
LlvType
Llv
typedef SignalSequence< LlrTypeLlrSeq
typedef SignalSequence< Complex,
TimeSignalAttributes > 
TimeSignal
typedef SignalSequence< Complex,
FreqSignalAttributes > 
FreqSignal

Declarations for LoadingInfoSeq

typedef simth::SignalSequence<
LoadingInfo > 
LoadingInfoSeq
enum  ModType {
  UNMOD, PSK_2, PSK_4, PSK_8,
  RAM_8, QAM_4, QAM_16, QAM_32,
  RAM_32, QAM_64, QAM_128, RAM_128,
  QAM_256
}

Defines

#define DLLIMPORT

Enumerations

enum  SequenceType { LLV_SEQ, LLR_SEQ }
enum  ConversionFlag { CUT, FILL, FIT }

Functions

SequenceType string2SequenceType (const std::string &s)
template<class Val, class Attr, class Cont, class Stor, class Accs>
std::ostream & operator<< (std::ostream &os, const SignalSequenceBase< Val, Attr, Cont, Stor, Accs > &seq)
template<class T, class A, class Cont>
std::ostream & operator<< (std::ostream &os, const SignalSequenceStorage< T, A, Cont > &seq)
std::ostream & operator<< (std::ostream &os, const BitSeq &bits)
unsigned bits2value (BitSeq::const_iterator first, BitSeq::const_iterator behindLast)
bool value2bit (unsigned index, size_t bitPos)
void value2bits (unsigned index, BitSeq::iterator first, BitSeq::iterator behindLast)
double llrValue2llvValue (LlrType llrValue, bool bitValue)
bool llrValue2bit (LlrType llrValue)
LlvType bit2llvValue (bool bit, bool index)
LlrType bit2llrValue (bool bit)
void bitSeq2llvSeq (const BitSeq &bits, LlvSeq &llv)
void bitSeq2llvSeq (const BitSeq &bits, LlvSeq *llv)
void llrSeq2bitLlvSeq (const LlrSeq &llr, LlvSeq &llv)
void llrSeq2bitLlvSeq (const LlrSeq &llr, LlvSeq *llv)
void llrSeq2bitSeq (const LlrSeq &from, BitSeq &bits)
void llrSeq2bitSeq (const LlrSeq &from, BitSeq *bits)
void llvSeq2bitLlvSeq (const LlvSeq &from, LlvSeq &bitLlv)
void llvSeq2bitLlvSeq (const LlvSeq &from, LlvSeq *bitLlv)
void llvSeq2llrSeq (const LlvSeq &from, LlrSeq &to, size_t outputLength=0)
void llvSeq2llrSeq (const LlvSeq &from, LlrSeq *to, size_t outputLength=0)
void bitLlvSeq2llvSeq (const LlvSeq &from, LlvSeq &to, unsigned bitsPerState=0)
void bitLlvSeq2llvSeq (const LlvSeq &from, LlvSeq *to, unsigned bitsPerState=0)
void bitSeq2IntSeq (const simth::BitSeq &bs, simth::checkedVector< int > &IntSeq, int numBits)
size_t getSymSeqLength (size_t bitSeqLen, unsigned bitsPerSym, ConversionFlag flag=FIT)

Variables

const double HIGH_METRIC = 1e9


Detailed Description

Declaration of the signals to exchange information between interfaces.

Note:
Why is it necessary to have complex classes here? Because the task of storing the signal samples is non-trivial. Because Simthetic tries to avoid unnecessary copying of samples as much as possible. Because it matters whether your simulation runs 6 hours or 18 hours. Because we still want to use C++'s type system to make sure your program code for new devices is still correct.
In this header file, sequences/signals are defined that are used to exchange the processed information between devices. More precisley, these sequences/signals exchange information between interfaces that are connected. In order to speed up the simulation program, these classes are used as template arguments by the interface and not as a polymorph pointer to a base class.

Beside the elements ("signal samples") itself, a sequence can hold additional information in its attributes class. For example, a simth::TimeSignal stores the time distance between two samples in the attributes class. The attributes can be accessed by mySequenceObj.rAttributes() and mySequenceObj.wAttributes() for read-only mode and for read-and-write mode, respectivley. Before using the wAttributes() and hence using the read-and-write mode, one should make sure that the attributes are not locked by the owner of the sequence/signal. This can be checked by the function rAttributes().isAttributesLocked(). As with the sequences, the attributes classes are not derived by a common base class, but they are plainly implemented as seperate classes that have to provide certain functions to be used as template argument of signal sequences.

Some sequences that are frequently used are

A sequence is available as two classes: One class that holds actual storage (simth::SignalSequenceStorage<T> or equivalently simth::SignalSequence<T>::storage_type), and the other one only holding a shallow copy (i.e. pointers; SignalSequenceAccess<T> or equivalently SignalSequence<T>::access_type) to another SignalSequence<T>::storage_type object. It is always possible and cheap to create a shallow copy object of an existing SignalSequence<T>::storage_type or SignalSequence<T>::access_type using the access_type. Creating a SignalSequence::storage_type (as deep copy), however, may be an expensive operation.

All the above mentioned sequences are included as typedefs in this file, where e.g. BitSeq::access_type stands for the shallow-copy object, and BitSeq::storage_type stands for the actual storage (deep-copy) object. For these typedef'd sequences, the templates are explicitly instantiated inside the simthetic program, so you don't need to include signalsequence_impl.h, which will speed up your compile time considerably.

To convert a sequence type to another, use the functions provided at the end of this file (see convertfunctions). E.g. to convert a LlvSeq to a LlrSeq use llvSeq2llrSeq();

AGAIN NOTE: This is *not* the full definition of the template classes. If you *need* the full definition (because e.g. you are using your own template argument to SignalSequence<YourClass>), you additionally have to include the file signalsequence_impl.h.


Define Documentation

#define DLLIMPORT
 


Typedef Documentation

typedef SignalSequence<bool> simth::BoolSeq
 

SignalSequence of booleans.

typedef SignalSequence<int> simth::IntSeq
 

SignalSequence of integers

typedef SignalSequence<double> simth::DoubleSeq
 

SignalSequence of doubles

typedef SignalSequence<Complex> simth::ComplexSeq
 

SignalSequence of Complex values

typedef simth::Array<Complex> simth::ComplexArray
 

An array of Complex values.

typedef BoolSeq simth::BitSeq
 

SignalSequence of bits.

typedef IntSeq simth::ModIndSeq
 

SignalSequence of bits which are mapped to integer values. The number of bits which are mapped for each integer value is not known by the sequence itself. This means, that from this point of view this sequence is just a sequence of integers.

typedef DoubleSeq simth::PhaseSeq
 

SignalSequence of phase values.

typedef ComplexSeq simth::ModSeq
 

SignalSequence of complex modulation symbols.

typedef ComplexArray simth::SignalSym
 

Represents the samples of one complex symbol (e.g. ofdm symbol) to be transmitted.

typedef SignalSequence<SignalSym> simth::SymSeq
 

SignalSequence of signal symbols to be transmitted, or in other words: A sequence of ComplexArrays.

typedef double simth::LlrType
 

Data type of the LLR (log-likelihood ratio) value

typedef double simth::LlvType
 

Data type of the LLV (log-likelihood value) value

typedef simth::checkedVector<LlvType> simth::Llv
 

Log-likelihood value of an M-ary decision. E.g: myLLV[0]=ln P(decision 0 is correct), myLLV[1]=ln P(decision 1 is correct), ...

See also:
LlvSeq LlrSeq Functions to convert sequences

typedef SignalSequence<LlrType> simth::LlrSeq
 

SignalSequence of log likelihood ratios (LLR). LLR values represent both the probability of a bit decision u and the decision itself.

They are defined by: ln p(u=0)/p(u=1). (This means that a negative LLR-value belongs to u=1!). LLR values can be stored in 2-ary LLV values with myLlv[0]=myllr/2 and myLlv[1]=-myllr/2. Hence, LLr sequences can be converted to 2-ary LLV sequences and vice versa.

See also:
LlvSeq Functions to convert sequences

typedef SignalSequence<Complex,TimeSignalAttributes> simth::TimeSignal
 

Class that represents a sequence of time samples.

The time distance between two samples can no longer be set by a constructor argument or by the function setDeltaT() -- instead, you have to use mysequence.wAttributes().setDeltaT() !

typedef SignalSequence<Complex,FreqSignalAttributes> simth::FreqSignal
 

Class that represents a sequence of frequency samples.

Note: The frequence distance between two samples can no longer be set by a constructor argument or by the function setDeltaF() -- instead, you have to use mysequence.wAttributes().setDeltaF() as a separate function call!

typedef simth::SignalSequence<LoadingInfo> simth::LoadingInfoSeq
 

A sequence of LoadingInfo objects which contains the information about the modulation scheme for particular subcarriers. Used by the simthlib::AdaptiveModulator and related classes.

The declarations of LoadingInfo and LoadingInfoSeq have been moved to simthetic/signals.h because otherwise these types are not usable across different libraries.


Enumeration Type Documentation

enum simth::SequenceType
 

DEPRECATED. Auxiliary type flag for a demodulator/decoder to decide whether they exchage LLV or LLR values. Use string2SequenceType to convert from strings to this type.

This type flag is not nice. You should find a different way in your class to decide which data type is being used -- maybe simply a Property, or rather a template argument.

Enumeration values:
LLV_SEQ 
LLR_SEQ 

enum simth::ModType
 

A type to distinguish between the different available modulation techniques. Used by the simthlib::AdaptiveModulator and related classes, and the more detailed information is in class simthlib::ModInfo.

The declarations of LoadingInfo and LoadingInfoSeq have been moved to simthetic/signals.h because otherwise these types are not usable across different libraries.

Enumeration values:
UNMOD 
PSK_2 
PSK_4 
PSK_8 
RAM_8 
QAM_4 
QAM_16 
QAM_32 
RAM_32 
QAM_64 
QAM_128 
RAM_128 
QAM_256 


Function Documentation

SequenceType string2SequenceType const std::string &  s  ) 
 

DEPRECATED. Conversion function from string to the SequenceType type flag.

template<class Val, class Attr, class Cont, class Stor, class Accs>
std::ostream& operator<< std::ostream &  os,
const SignalSequenceBase< Val, Attr, Cont, Stor, Accs > &  seq
 

template<class T, class A, class Cont>
std::ostream& operator<< std::ostream &  os,
const SignalSequenceStorage< T, A, Cont > &  seq
 

std::ostream& operator<< std::ostream &  os,
const BitSeq bits
 


Variable Documentation

const double simth::HIGH_METRIC = 1e9
 

Constant value that can be used when an incredibly good metric is needed.


Generated on Mon Aug 15 13:54:28 2005 for simthetic by  doxygen 1.4.1