World Ocean Simulation System (WOSS) library
uw-woss-channel-estimator.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 2025 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - WOSS@guerra-tlc.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation;
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
32#ifndef CHANNEL_ESTIMATOR_H
33#define CHANNEL_ESTIMATOR_H
34
35#include <map>
36#include <memory>
37#include <plugin.h>
40#include <uw-woss-position.h>
41
42
48class ChannelEstimator : public TclObject {
49
50 public:
51
52 using RxMap = std::map< woss::CoordZ, std::unique_ptr<woss::TimeArr>, woss::CoordComparator< ChannelEstimator, woss::CoordZ > >;
53 using RxMIter = RxMap::iterator;
54 using RxMCIter = RxMap::const_iterator;
55 using RxMRIter = RxMap::reverse_iterator;
56
57 using ChannelMap = std::map< woss::CoordZ, RxMap, woss::CoordComparator< ChannelEstimator, woss::CoordZ > >;
58 using ChMapIter = ChannelMap::iterator;
59 using ChMapRIter = ChannelMap::reverse_iterator;
60
61 using MacToPosMap = std::map< int, WossPosition* >;
62 using MacMapIter = MacToPosMap::iterator;
63 using MacMapRIter = MacToPosMap::reverse_iterator;
64
66
67 virtual ~ChannelEstimator() override = default;
68
69 virtual int command(int argc, const char*const* argv) override;
70
71 static double getSpaceSampling() { return space_sampling; }
72
80 virtual void updateEstimation( const woss::CoordZ& tx, const woss::CoordZ& rx, const woss::TimeArr& curr_channel );
81
89 std::unique_ptr<woss::TimeArr> getEstimation( const woss::CoordZ& tx, const woss::CoordZ& rx );
90
91 void addMacAddress( int addr, WossPosition* pos ) { mac_to_pos_map[addr] = pos; }
92
93 virtual WossPosition* findMacAddress( int addr );
94
95 virtual bool resetEstimator();
96
97 protected:
98
99 static double space_sampling;
100
102
104
105 double debug_;
106
107 double avg_coeff;
108
109};
110
117class ChEstimatorPlugIn : public PlugIn {
118
119 public:
120
122
123 virtual ~ChEstimatorPlugIn() override = default;
124
125 virtual int command(int argc, const char*const* argv) override;
126
127 virtual int recvSyncClMsg(ClMessage* m) override;
128
129 protected:
130
132
133 double debug_;
134
135};
136
137#endif // CHANNEL_ESTIMATOR_H
Service class for attaching a ChannelEstimator to the node bus.
Definition uw-woss-channel-estimator.h:117
virtual ~ChEstimatorPlugIn() override=default
virtual int recvSyncClMsg(ClMessage *m) override
Definition uw-woss-channel-estimator.cpp:214
ChEstimatorPlugIn()
Definition uw-woss-channel-estimator.cpp:165
ChannelEstimator * channel_estimator
Definition uw-woss-channel-estimator.h:131
virtual int command(int argc, const char *const *argv) override
Definition uw-woss-channel-estimator.cpp:172
double debug_
Definition uw-woss-channel-estimator.h:133
Class for channel estimation and averaging.
Definition uw-woss-channel-estimator.h:48
ChannelMap::reverse_iterator ChMapRIter
Definition uw-woss-channel-estimator.h:59
std::unique_ptr< woss::TimeArr > getEstimation(const woss::CoordZ &tx, const woss::CoordZ &rx)
Definition uw-woss-channel-estimator.cpp:112
ChannelMap::iterator ChMapIter
Definition uw-woss-channel-estimator.h:58
MacToPosMap mac_to_pos_map
Definition uw-woss-channel-estimator.h:103
virtual WossPosition * findMacAddress(int addr)
Definition uw-woss-channel-estimator.cpp:146
virtual int command(int argc, const char *const *argv) override
Definition uw-woss-channel-estimator.cpp:59
std::map< woss::CoordZ, std::unique_ptr< woss::TimeArr >, woss::CoordComparator< ChannelEstimator, woss::CoordZ > > RxMap
Definition uw-woss-channel-estimator.h:52
ChannelEstimator()
Definition uw-woss-channel-estimator.cpp:53
std::map< int, WossPosition * > MacToPosMap
Definition uw-woss-channel-estimator.h:61
virtual void updateEstimation(const woss::CoordZ &tx, const woss::CoordZ &rx, const woss::TimeArr &curr_channel)
Definition uw-woss-channel-estimator.cpp:71
MacToPosMap::reverse_iterator MacMapRIter
Definition uw-woss-channel-estimator.h:63
static double space_sampling
Definition uw-woss-channel-estimator.h:99
void addMacAddress(int addr, WossPosition *pos)
Definition uw-woss-channel-estimator.h:91
RxMap::iterator RxMIter
Definition uw-woss-channel-estimator.h:53
static double getSpaceSampling()
Definition uw-woss-channel-estimator.h:71
ChannelMap channel_map
Definition uw-woss-channel-estimator.h:101
double avg_coeff
Definition uw-woss-channel-estimator.h:107
RxMap::reverse_iterator RxMRIter
Definition uw-woss-channel-estimator.h:55
virtual bool resetEstimator()
Definition uw-woss-channel-estimator.cpp:139
MacToPosMap::iterator MacMapIter
Definition uw-woss-channel-estimator.h:62
std::map< woss::CoordZ, RxMap, woss::CoordComparator< ChannelEstimator, woss::CoordZ > > ChannelMap
Definition uw-woss-channel-estimator.h:57
double debug_
Definition uw-woss-channel-estimator.h:105
RxMap::const_iterator RxMCIter
Definition uw-woss-channel-estimator.h:54
virtual ~ChannelEstimator() override=default
Definition uw-woss-position.h:41
Function object for partial ordering of coordinates.
Definition coordinates-definitions.h:783
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:384
Channel power delay profile class.
Definition time-arrival-definitions.h:70
Provides the interface for the woss::Coord and woss::CoordZ classes.
Definitions and library for woss::TimeArr class.
Provides the interface for WossWpPosition class.