Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JTransceiver.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JTRANSCEIVER__
2 #define __JACOUSTICS__JTRANSCEIVER__
3 
4 #include "JDB/JToAshort.hh"
5 
6 #include "JAcoustics/JEmitter.hh"
10 
11 
12 /**
13  * \file
14  *
15  * Acoustic transceiver.
16  * \author mdejong
17  */
18 namespace JACOUSTICS {}
19 namespace JPP { using namespace JACOUSTICS; }
20 
21 namespace JACOUSTICS {
22 
24 
25 
26  /**
27  * Acoustic transceiver.
28  */
29  struct JTransceiver :
30  public JEmitter,
31  public JReceiver
32  {
33  /**
34  * Default constructor.
35  */
37  emitter (),
38  receiver()
39  {}
40 
41 
42  /**
43  * Constructor.
44  *
45  * \param emitter emitter
46  * \param receiver receiver
47  */
49  const JReceiver& receiver) :
50  emitter (emitter),
51  receiver(receiver)
52  {}
53 
54 
55  /**
56  * Get transmission.
57  *
58  * \param data time-of-arrival
59  * \param V sound velocity
60  * \return transmission
61  */
63  const JAbstractSoundVelocity& V = getSoundVelocity) const
64  {
65  const double toa = data.UNIXTIMEBASE + receiver.getT(data.TOA_S);
66  const double t1 = V.getTime(this->getDistance(),
67  this->emitter .getZ(),
68  this->receiver.getZ());
69 
70  return JTransmission(this->receiver.getID(),
71  data.QUALITYFACTOR,
72  toa,
73  toa - t1);
74  }
75 
76 
77  /**
78  * Get distance between emitter and receiver.
79  *
80  * \return distance
81  */
82  inline double getDistance() const
83  {
85  }
86 
89  };
90 }
91 
92 #endif
Acoustic receiver.
Definition: JReceiver.hh:27
Sound velocity.
JTransceiver()
Default constructor.
Definition: JTransceiver.hh:36
Acoustic emitter.
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:269
static const JSoundVelocity getSoundVelocity(1541.0,-17.0e-3,-2000.0)
Function object for velocity of sound.
Acoustic transmission.
Acoustic emitter.
Definition: JEmitter.hh:27
int getID() const
Get identifier.
Definition: JObjectID.hh:55
Acoustic transceiver.
Definition: JTransceiver.hh:29
JTransceiver(const JEmitter &emitter, const JReceiver &receiver)
Constructor.
Definition: JTransceiver.hh:48
double getT(const double t_s) const
Get corrected time.
Definition: JReceiver.hh:87
Acoustic receiver.
JTransmission getTransmission(const JToAshort &data, const JAbstractSoundVelocity &V=getSoundVelocity) const
Get transmission.
Definition: JTransceiver.hh:62
Acoustic transmission.
Interface for velocity of sound.
double getDistance() const
Get distance between emitter and receiver.
Definition: JTransceiver.hh:82
double getZ() const
Get z position.
Definition: JVector3D.hh:114