Skip to content

Commit

Permalink
Added physical layer 'passthrough' noise mode. When configured for
Browse files Browse the repository at this point in the history
passthrough noise, the physical layer will send all over-the-air
messages, provided they have at least one frequency segment above the
receiver sensitivity, to the radio model for processing. Spectrum
monitor energy recording (signal and noise) does not occur in the
physical layer when in passthrough mode.

Removed unused boolean flag in SpectrumFilterWindow.
  • Loading branch information
sgalgano committed Mar 23, 2020
1 parent 5fb9905 commit 93cd8c5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
3 changes: 0 additions & 3 deletions include/emane/spectrumserviceprovider.h
Expand Up @@ -73,15 +73,12 @@ namespace EMANE
* @param TimePoint Time corresponding to the first bin
* @param Microseconds The bin duration
* @param double The receiver sensitivity in mW
* @param bool Flag indicating whether the in-band signal
* is contained in the binned power values
* @param size_t Number of subband binned signal energy per time bin
*/
using SpectrumFilterWindow = std::tuple<std::vector<double>,
TimePoint,
Microseconds,
double,
bool,
size_t>;

/**
Expand Down
8 changes: 6 additions & 2 deletions src/libemane/frameworkphy.cc
Expand Up @@ -175,10 +175,10 @@ void EMANE::FrameworkPHY::initialize(Registrar & registrar)
EMANE::ConfigurationProperties::DEFAULT,
{"all"},
"Defines the noise processing mode of operation:"
" none, all or outofband.",
" none, all, outofband or passthrough.",
1,
1,
"^(none|all|outofband)$");
"^(none|all|outofband|passthrough)$");


configRegistrar.registerNumeric<std::uint64_t>("noisebinsize",
Expand Down Expand Up @@ -380,6 +380,10 @@ void EMANE::FrameworkPHY::configure(const ConfigurationUpdate & update)
{
noiseMode_ = SpectrumMonitor::NoiseMode::NONE;
}
else if(sNoiseMode == "passthrough")
{
noiseMode_ = SpectrumMonitor::NoiseMode::PASSTHROUGH;
}
else
{
noiseMode_ = SpectrumMonitor::NoiseMode::OUTOFBAND;
Expand Down
10 changes: 7 additions & 3 deletions src/libemane/spectrummonitor.cc
Expand Up @@ -178,15 +178,20 @@ EMANE::SpectrumMonitor::update(const TimePoint & now,

// if noise processing is disabled just check in-band updates for
// frequencies of interest
if(mode_ == NoiseMode::NONE || (mode_ == NoiseMode::OUTOFBAND && bInBand))
if(mode_ == NoiseMode::NONE ||
mode_ == NoiseMode::PASSTHROUGH ||
(mode_ == NoiseMode::OUTOFBAND && bInBand))
{
size_t i{};

bReportAsInBand = true;

for(const auto & segment : segments)
{
if(noiseRecorderMap_.find(segment.getFrequencyHz()) != noiseRecorderMap_.end())
// in passthrough mode, you do not need an exact frequency
// match for processing like you would for inband messages
if(mode_ == NoiseMode::PASSTHROUGH ||
noiseRecorderMap_.find(segment.getFrequencyHz()) != noiseRecorderMap_.end())
{
if(rxPowersMilliWatt[i] >= dReceiverSensitivityMilliWatt_)
{
Expand Down Expand Up @@ -564,7 +569,6 @@ EMANE::SpectrumMonitor::requestFilter(FilterIndex filterIndex,

return std::tuple_cat(std::move(ret),std::make_tuple(binSize_,
dReceiverSensitivityMilliWatt_,
false,
std::get<2>(iter->second)->getSubBandBinCount()));
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/libemane/spectrummonitor.h
Expand Up @@ -55,7 +55,7 @@ namespace EMANE
SpectrumMonitor();


enum class NoiseMode {NONE, ALL, OUTOFBAND};
enum class NoiseMode {NONE, ALL, OUTOFBAND, PASSTHROUGH};

void initialize(uint16_t u16SubId,
const FrequencySet & foi,
Expand Down
2 changes: 1 addition & 1 deletion src/models/mac/tdma/basemodelimpl.cc
Expand Up @@ -470,7 +470,7 @@ void EMANE::Models::TDMA::BaseModel::Implementation::processUpstreamPacket(const


packetStatusPublisher_.inbound(pktInfo.getSource(),
pktInfo.getSource(),
pktInfo.getDestination(),
pktInfo.getPriority(),
pkt.length(),
PacketStatusPublisher::InboundAction::DROP_REGISTRATION_ID);
Expand Down

0 comments on commit 93cd8c5

Please sign in to comment.