
CollisionDetector |
ptolemy.domains.wireless.lib.CollisionDetector |
This actor models a typical physical layer front end of a wireless
receiver. It models a receiver where messages have a non-zero duration
and messages can collide with one another, causing a failure to receive.
A message is provided to this actor at the time corresponding to the
start of its transmission. Along with the message (an arbitrary
token), the inputs must provide the duration of the message and its
power. The message spans an interval of time starting when it is
provided to this actor and ending at that time plus the duration.
If another message overlaps with a given message and has sufficient
power, then the given message will be sent to the <i>collided</i>
output. Otherwise it is sent to the <i>received</i> output. In both
cases, the message appears at the corresponding output at the time
it is received plus the duration (i.e. the time at which the message
has been completed).
<p>
The inputs are:
<ul>
<li> <i>message</i>: The message carried by each transmission.
<li> <i>power</i>: The power of the received signal at the
location of this receiver.
<li> <i>duration</i>: The time duration of the transmission.
</ul>
The power and duration are typically delivered by the channel
in the "properties" field of the transmission. The power
is usually given as a power density (per unit area) so that
a receiver can multiply it by its antenna area to determine
the received power. It is in a linear scale (vs. DB), typically with
units such as watts per square meter. The duration is a
non-negative double, and the message is an arbitrary token.
<p>
The outputs are:
<ul>
<li> <i>received</i>: The message received. This port produces
an output only if the received power is sufficient
and there are no collisions. The output is produced at a
time equal to the time this actor receives the message plus
the value received on the <i>duration</i> input.
<li> <i>collided</i>: The message discarded. This port produces
an output only if the received message collides with another
message of sufficient power. The output is produced at a
time equal to the time this actor receives the message plus
the value received on the <i>duration</i> input. The value
of the output is the message that cannot be received.
</ul>
<p>
This actor is typically used with a channel that delivers a properties
record token that contains <i>power</i> and <i>duration</i> fields.
These fields can be extracted by using a GetProperties actor followed
by a RecordDisassembler. The PowerLossChannel, for example, can be used.
However, in order for the type constraints to be satisfied, the
PowerLossChannel's <i>defaultProperties</i> parameter must be
augmented with a default value for the <i>duration</i>.
Each transmitter can override that default with its own message
duration and transmit power.
<p>
Any message whose power (as specified at the <i>power</i> input)
is less than the value of the <i>powerThreshold</i> parameter
is ignored. It will not cause collisions and is not produced
at the <i>collided</i> output. The <i>powerThreshold</i> parameter
thus specifies the power level at which the receiver simply fails
to detect the signal. It is given in a linear scale (vs. DB) with
the same units as the <i>power</i> input. The default value is zero,
i.e. by default it won't ignore any received signal.
<p>
Any message whose power exceeds <i>powerThreshold</i> has the
potential of being successfully received, of failing to be
received due to a collision, and of causing a collision.
A message is successfully received if throughout its duration,
its power exceeds the sum of all other message powers
by at least <i>SNRThresholdInDB</i> (which as the name
suggests, is given in decibels, rather than in a linear
scale, as is customary for power ratios). Formally, let the
message power for the <i>i</i>-th message be
<i>p</i><sub><i>i</i></sub>(<i>t</i>) at time <i>t</i>.
Before the message is received and after its duration
expires, this power is zero. The <i>i</i>-th message
is successfully received if
<quote>
<i>p</i><sub><i>i</i></sub>(<i>t</i>) >= <i>P</i>
<font face="Symbol">S</font><sub>(<i>j</i> != <i>i</i>)</sub>
<i>p</i><sub><i>j</i></sub>(<i>t</i>)
</quote>
for all <i>t</i> where <i>p</i><sub><i>i</i></sub>(<i>t</i>) > 0,
where
<quote>
<i>P</i> = 10^(<i>SNRThresholdInDB</i>/10)
</quote>
which is the signal to interference ratio in a linear scale.
<p>
The way this actor works is that each input that has sufficient power
is recorded in a hash table indexed by the time at which its duration
expires. In addition, the director is requested to fire this actor at
that time. Any time a message arrives, the actor checks for collisions,
and marks any message subjected to a collision by this arrival.
When the duration expires, the message is produced on one of the
two outputs depending on whether it is marked as having encountered
a collision, and it is removed from the hash table.
<p>
NOTE: This actor assumes that the duration of messages is short
relative to the rate at which the actors move. That is, the received
power (and whether a receiver is in range) is determined once, at the
time the message starts, and remains constant throughout the transmission.
It also requires that all three inputs have tokens when fired.
Author(s): Yang Zhao, Xiaojun Liu, Edward Lee
Version:$Id: CollisionDetector.doc.html,v 1.1 2006/02/22 18:40:26 mangal Exp $
Pt.Proposed Rating:Green (cxh)
Pt.Accepted Rating:Yellow (cxh)
message
The input port for the message. This has undeclared type.
power
The input port for power. This has type double, and is typically
a power density, in units such as watts per square meter.
duration
The input port for the time that a message transmission takes.
This has type double.
received
The output port that produces messages that are successfully
received. This has the same type as the message input.
collided
The output port that produces messages that cannot be
received because of a collision. This has the same type as the
message input.
SNRThresholdInDB
The threshold for the signal to be recognized from interference.
It is specified in decibels (10 * log<sub>10</sub>(<i>r</i>),
where <i>r</i> is the power ratio. This is a double that
defaults to Infinity, which indicates that all overlapping
messages are lost to collisions.
powerThreshold
The power threshold above which the signal can be
detected at the receiver. Any message with a received power
below this number is ignored. This has type double
and defaults to 0.0, which indicates that all messages
(with nonzero power) will be received.