The signal class stores the physical representation of the signal of an AirFrame. More...
#include <Signal_.h>
Public Types | |
typedef ConcatConstMapping < std::multiplies< double > > | MultipliedMapping |
Shortcut type for a concatenated Mapping using multiply operator. | |
typedef std::list< ConstMapping * > | ConstMappingList |
Shortcut type for a list of ConstMappings. | |
Public Member Functions | |
Signal (simtime_t start=-1.0, simtime_t length=-1.0) | |
Initializes a signal with the specified start and length. | |
Signal (const Signal &o) | |
Overwrites the copy constructor to make sure that the mappings are cloned correct. | |
const Signal & | operator= (const Signal &o) |
Overwrites the copy operator to make sure that the mappings are cloned correct. | |
~Signal () | |
Delete the functions of this signal. | |
simtime_t | getSignalStart () const |
Returns the point in time when the receiving of the Signal started. | |
Move | getMove () const |
Returns the movement of the sending host. | |
void | setMove (Move &move) |
Sets the movement of the sending host. | |
simtime_t | getSignalLength () const |
Returns the length of the signal transmission. | |
simtime_t | getPropagationDelay () const |
Returns the propagation delay of the signal. | |
void | setPropagationDelay (simtime_t delay) |
Sets the propagation delay of the signal. | |
void | setTransmissionPower (ConstMapping *power) |
Sets the function representing the transmission power of the signal. | |
void | setBitrate (Mapping *bitrate) |
Sets the function representing the bitrate of the signal. | |
void | addAttenuation (ConstMapping *att) |
Adds a function representing an attenuation of the signal. | |
ConstMapping * | getTransmissionPower () |
Returns the function representing the transmission power of the signal. | |
const ConstMapping * | getTransmissionPower () const |
Returns the function representing the transmission power of the signal. | |
Mapping * | getBitrate () |
Returns the function representing the bitrate of the signal. | |
const ConstMappingList & | getAttenuation () const |
Returns a list of functions representing the attenuations of the signal. | |
MultipliedMapping * | getReceivingPower () |
Calculates and returns the receiving power of this Signal. Ownership of the returned mapping belongs to this class. | |
Protected Member Functions | |
void | markRcvPowerOutdated () |
Deletes the rcvPower mapping member because it became out-dated. | |
Protected Attributes | |
simtime_t | signalStart |
The start of the signal transmission. | |
simtime_t | signalLength |
The length of the signal transmission. | |
simtime_t | propDelay |
The propagation delay of the transmission. | |
Move | senderMovement |
The movement of the sending host. | |
ConstMapping * | power |
Stores the function which describes the power of the signal. | |
Mapping * | bitrate |
Stores the function which describes the bitrate of the signal. | |
Mapping * | txBitrate |
If propagation delay is not zero this stores the undelayed bitrate. | |
ConstMappingList | attenuations |
Stores the functions describing the attenuations of the signal. | |
MultipliedMapping * | rcvPower |
Stores the mapping defining the receiving power of the signal. |
The signal class stores the physical representation of the signal of an AirFrame.
This includes start, duration and propagation delay of the signal, the sender hosts move pattern as well as Mappings which represent the transmission power, bitrate, attenuations caused by effects of the channel on the signal during its transmission and the receiving power.
Note: Although the Signal itself has a startTime parameter the Mappings it contains should use absolute time positions to store the values at (NOT relative to the start time of the signal).
The Signal is created at the senders MAC layer which has to define the TX-power- and the bitrate Mapping. The sender hosts move pattern as well as start and duration is added at the senders physical layer. Attenuation Mappings are added to the Signal by the AnalogueModels of the receivers physical layer. The RX-power Mapping is calculated on demand by multiplying the TX-power Mapping with every attenuation Mapping of the signal.
Definition at line 34 of file Signal_.h.
typedef ConcatConstMapping<std::multiplies<double> > Signal::MultipliedMapping |
void Signal::addAttenuation | ( | ConstMapping * | att | ) | [inline] |
Adds a function representing an attenuation of the signal.
The ownership of the passed pointer goes to the signal.
Definition at line 167 of file Signal_.h.
References ConcatConstMapping< Operator >::addMapping(), attenuations, and rcvPower.
Referenced by UWBIRStochasticPathlossModel::filterSignal(), UWBIRIEEE802154APathlossModel::filterSignal(), SimplePathlossModel::filterSignal(), PERModel::filterSignal(), LogNormalShadowing::filterSignal(), JakesFading::filterSignal(), IntensityModel::filterSignal(), BreakpointPathlossModel::filterSignal(), RandomFrequencyOnlyModel::filterSignal(), RandomFreqTimeModel::filterSignal(), and RadioStateAnalogueModel::filterSignal().
{ //assert the attenuation wasn't already added to the list before assert(std::find(attenuations.begin(), attenuations.end(), att) == attenuations.end()); attenuations.push_back(att); if(rcvPower) rcvPower->addMapping(att); }
MultipliedMapping* Signal::getReceivingPower | ( | ) | [inline] |
Calculates and returns the receiving power of this Signal. Ownership of the returned mapping belongs to this class.
The receiving power is calculated by multiplying the transmission power with the attenuation of every receiving phys AnalogueModel.
Definition at line 222 of file Signal_.h.
References attenuations, power, propDelay, and rcvPower.
Referenced by BaseDecider::calculateRSSIMapping(), BaseDecider::calculateSnrMapping(), SNRThresholdDecider::processNewSignal(), Decider80211::processNewSignal(), and BaseDecider::processNewSignal().
{ if(!rcvPower) { ConstMapping* tmp = power; if(propDelay != 0) { tmp = new ConstDelayedMapping(power, propDelay); } rcvPower = new MultipliedMapping(tmp, attenuations.begin(), attenuations.end(), false, 0.0); } return rcvPower; }
simtime_t Signal::getSignalStart | ( | ) | const |
Returns the point in time when the receiving of the Signal started.
Already includes the propagation delay.
Definition at line 111 of file Signal.cc.
References propDelay, and signalStart.
Referenced by BaseDecider::calculateRSSIMapping(), BaseDecider::calculateSnrMapping(), Decider80211::checkIfSignalOk(), UWBIRStochasticPathlossModel::filterSignal(), UWBIRIEEE802154APathlossModel::filterSignal(), SimplePathlossModel::filterSignal(), PERModel::filterSignal(), LogNormalShadowing::filterSignal(), JakesFading::filterSignal(), IntensityModel::filterSignal(), BreakpointPathlossModel::filterSignal(), RandomFrequencyOnlyModel::filterSignal(), RandomFreqTimeModel::filterSignal(), RadioStateAnalogueModel::filterSignal(), BasePhyLayer::handleAirFrameReceiving(), BasePhyLayer::handleAirFrameStartReceive(), ThresholdDecider::handleNewSignal(), SNRThresholdDecider::processNewSignal(), Decider802154Narrow::processNewSignal(), Decider80211::processNewSignal(), BaseDecider::processNewSignal(), SNRThresholdDecider::processSignalEnd(), Decider802154Narrow::processSignalEnd(), and Decider802154Narrow::processSignalHeader().
{ return signalStart + propDelay; }
ConstMapping* Signal::getTransmissionPower | ( | ) | [inline] |
Returns the function representing the transmission power of the signal.
Be aware that the transmission power mapping is not yet affected by the propagation delay!
Definition at line 184 of file Signal_.h.
References power.
Referenced by UWBIRIEEE802154APathlossModel::filterSignal(), and SimplePathlossModel::filterSignal().
{ return power; }
const ConstMapping* Signal::getTransmissionPower | ( | ) | const [inline] |
void Signal::markRcvPowerOutdated | ( | ) | [inline, protected] |
Deletes the rcvPower mapping member because it became out-dated.
This happens when transmission power or propagation delay changes.
Definition at line 79 of file Signal_.h.
References ConcatConstMapping< Operator >::getRefMapping(), power, propDelay, and rcvPower.
Referenced by operator=(), setPropagationDelay(), and setTransmissionPower().
{ if(rcvPower){ if(propDelay != 0) { assert(rcvPower->getRefMapping() != power); delete rcvPower->getRefMapping(); } delete rcvPower; rcvPower = 0; } }
void Signal::setBitrate | ( | Mapping * | bitrate | ) |
Sets the function representing the bitrate of the signal.
The ownership of the passed pointer goes to the signal.
Definition at line 147 of file Signal.cc.
References txBitrate.
Referenced by SimpleMacLayer::createMacPkt(), Mac80211::createSignal(), and BaseMacLayer::createSignal().
{ assert(!txBitrate); if(this->bitrate) delete this->bitrate; this->bitrate = bitrate; }
void Signal::setPropagationDelay | ( | simtime_t | delay | ) |
Sets the propagation delay of the signal.
This should be only set by the sending physical layer.
Definition at line 123 of file Signal.cc.
References bitrate, markRcvPowerOutdated(), propDelay, and txBitrate.
Referenced by BasePhyLayer::handleAirFrameStartReceive().
void Signal::setTransmissionPower | ( | ConstMapping * | power | ) |
Sets the function representing the transmission power of the signal.
The ownership of the passed pointer goes to the signal.
Definition at line 137 of file Signal.cc.
References markRcvPowerOutdated().
Referenced by SimpleMacLayer::createMacPkt(), Mac80211::createSignal(), BaseMacLayer::createSignal(), and UWBIRIEEE802154APathlossModel::filterSignal().
{ if(this->power){ markRcvPowerOutdated(); delete this->power; } this->power = power; }