Jpp  19.0.0
the software that should make you happy
 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 "JAcoustics/JToA.hh"
5 #include "JAcoustics/JEmitter.hh"
9 
10 
11 /**
12  * \file
13  *
14  * Acoustic transceiver.
15  * \author mdejong
16  */
17 namespace JACOUSTICS {}
18 namespace JPP { using namespace JACOUSTICS; }
19 
20 namespace JACOUSTICS {
21 
22  /**
23  * Acoustic transceiver.
24  */
25  struct JTransceiver :
26  public JEmitter,
27  public JReceiver
28  {
29  /**
30  * Default constructor.
31  */
33  emitter (),
34  receiver()
35  {}
36 
37 
38  /**
39  * Constructor.
40  *
41  * \param emitter emitter
42  * \param receiver receiver
43  */
45  const JReceiver& receiver) :
46  emitter (emitter),
47  receiver(receiver)
48  {}
49 
50 
51  /**
52  * Get transmission.
53  *
54  * \param data time-of-arrival
55  * \param V sound velocity
56  * \return transmission
57  */
59  const JAbstractSoundVelocity& V) const
60  {
61  const double toa = receiver.getT(data.TOA_S());
62  const double t1 = V.getTime(this->getDistance(),
63  this->emitter .getZ(),
64  this->receiver.getZ());
65 
66  return JTransmission(data.RUN,
67  this->receiver.getID(),
68  data.QUALITYFACTOR,
70  toa,
71  toa - t1);
72  }
73 
74 
75  /**
76  * Get distance between emitter and receiver.
77  *
78  * \return distance
79  */
80  inline double getDistance() const
81  {
83  }
84 
87  };
88 }
89 
90 #endif
Acoustic receiver.
Definition: JReceiver.hh:27
Sound velocity.
JTransceiver()
Default constructor.
Definition: JTransceiver.hh:32
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn this
Time-of-arrival data from acoustic piezo sensor or hydrophone.
Definition: JToA.hh:25
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
Acoustic emitter.
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:270
Acoustic transmission.
Acoustic emitter.
Definition: JEmitter.hh:27
int32_t RUN
detector identifier
Definition: JToA.hh:31
virtual double getTime(const double D_m, const double z1, const double z2) const =0
Get propagation time of sound.
uint32_t QUALITYFACTOR
The ticks (16ns) part of the DAQ frame timestamp.
Definition: JToA.hh:37
Acoustic transceiver.
Definition: JTransceiver.hh:25
JTransceiver(const JEmitter &emitter, const JReceiver &receiver)
Constructor.
Definition: JTransceiver.hh:44
double TOA_S() const
Time of Arrival, expressed in seconds relative to Unix epoch (1 January 1970 00:00:00 UTC) ...
Definition: JToAImp.cc:40
uint32_t QUALITYNORMALISATION
A measure of how good the waveform match was to the signal.
Definition: JToA.hh:38
double getT(const double t_s) const
Get corrected time.
Definition: JReceiver.hh:72
Acoustic receiver.
Acoustic transmission.
Interface for depth dependend velocity of sound.
JTransmission getTransmission(const JToA &data, const JAbstractSoundVelocity &V) const
Get transmission.
Definition: JTransceiver.hh:58
Acoustic event.
double getDistance() const
Get distance between emitter and receiver.
Definition: JTransceiver.hh:80
double getZ() const
Get z position.
Definition: JVector3D.hh:115