Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

Signal Class Reference
[phyLayer - physical layer modules]

The signal class stores the physical representation of the signal of an AirFrame. More...

#include <Signal_.h>

Collaboration diagram for Signal:
Collaboration graph
[legend]

List of all members.

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 Signaloperator= (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.
ConstMappinggetTransmissionPower ()
 Returns the function representing the transmission power of the signal.
const ConstMappinggetTransmissionPower () const
 Returns the function representing the transmission power of the signal.
MappinggetBitrate ()
 Returns the function representing the bitrate of the signal.
const ConstMappingListgetAttenuation () const
 Returns a list of functions representing the attenuations of the signal.
MultipliedMappinggetReceivingPower ()
 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.
ConstMappingpower
 Stores the function which describes the power of the signal.
Mappingbitrate
 Stores the function which describes the bitrate of the signal.
MappingtxBitrate
 If propagation delay is not zero this stores the undelayed bitrate.
ConstMappingList attenuations
 Stores the functions describing the attenuations of the signal.
MultipliedMappingrcvPower
 Stores the mapping defining the receiving power of the signal.

Detailed Description

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.


Member Typedef Documentation

typedef ConcatConstMapping<std::multiplies<double> > Signal::MultipliedMapping

Shortcut type for a concatenated Mapping using multiply operator.

Used to define the receiving power mapping.

Definition at line 41 of file Signal_.h.


Member Function Documentation

void Signal::addAttenuation ( ConstMapping att  )  [inline]
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
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]

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 195 of file Signal_.h.

References power.

                                                   {
    return power;
  }

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;
}


The documentation for this class was generated from the following files: