World Ocean Simulation System (WOSS) library
woss::Transducer Class Reference

Transducer class. More...

#include <transducer-definitions.h>

Collaboration diagram for woss::Transducer:
Collaboration graph

Public Member Functions

 Transducer (long double beam_precision=BEAM_PATTERN_CUSTOM_BEAM_PRECISION, long double conduct_precison=CONDUCTANCE_CUSTOM_FREQUENCY_PRECISION, long double tvr_precision=TVR_CUSTOM_FREQUENCY_PRECISION, long double ocv_precision=OCV_CUSTOM_FREQUENCY_PRECISION)
 
 Transducer (const Transducer &copy)
 
 Transducer (BeamPowerMap &beam_map, ConductanceMap &conductance_map, TVRMap &tvr_map, OCVMap &ocv_map)
 
virtual Transducercreate (long double beam_precision=BEAM_PATTERN_CUSTOM_BEAM_PRECISION, long double conduct_precison=CONDUCTANCE_CUSTOM_FREQUENCY_PRECISION, long double tvr_precision=TVR_CUSTOM_FREQUENCY_PRECISION, long double ocv_precision=OCV_CUSTOM_FREQUENCY_PRECISION) const
 
virtual Transducercreate (BeamPowerMap &beam_map, ConductanceMap &conductance_map, TVRMap &tvr_map, OCVMap &ocv_map) const
 
virtual Transducercreate (const Transducer &copy) const
 
virtual Transducerclone () const
 
virtual bool isValid () const
 
Transducerbeampattern_rotate (double angle)
 
Transducerbeampattern_sum (double value)
 
Transducerbeampattern_multiply (double value)
 
virtual double getSPL (double frequency, double power) const
 
double getMaxSPL (double frequency) const
 
virtual double getPowerFromSPL (double frequency, double spl) const
 
bool beampattern_insert (double angle, double power)
 
Transducerbeampattern_replace (double angle, double power)
 
BPMCIter beampattern_find (double angle) const
 
Transducerbeampattern_erase (double angle)
 
int beampattern_size () const
 
bool beampattern_empty () const
 
Transducerbeampattern_clear ()
 
BPMCIter beampattern_begin () const
 
BPMCIter beampattern_end () const
 
BPMCRIter beampattern_rbegin () const
 
BPMCRIter beampattern_rend () const
 
BPMCIter beampattern_lower_bound (double angle) const
 
BPMCIter beampattern_upper_bound (double angle) const
 
bool conductance_insert (double frequency, double conductance)
 
bool conductance_insert (double frequency, const ::std::complex< double > &impedance)
 
Transducerconductance_replace (double frequency, double conductance)
 
Transducerconductance_replace (double frequency, const ::std::complex< double > &impedance)
 
CMCIter conductance_find (double frequency) const
 
Transducerconductance_erase (double frequency)
 
int conductance_size () const
 
bool conductance_empty () const
 
Transducerconductance_clear ()
 
CMCIter conductance_begin () const
 
CMCIter conductance_end () const
 
CMCRIter conductance_rbegin () const
 
CMCRIter conductance_rend () const
 
CMCIter conductance_lower_bound (double frequency) const
 
CMCIter conductance_upper_bound (double frequency) const
 
bool tvr_insert (double frequency, double tvr)
 
Transducertvr_replace (double frequency, double tvr)
 
TVRMCIter tvr_find (double frequency) const
 
Transducertvr_erase (double frequency)
 
int tvr_size () const
 
bool tvr_empty () const
 
Transducertvr_clear ()
 
TVRMCIter tvr_begin () const
 
TVRMCIter tvr_end () const
 
TVRMCRIter tvr_rbegin () const
 
TVRMCRIter tvr_rend () const
 
TVRMCIter tvr_lower_bound (double frequency) const
 
TVRMCIter tvr_upper_bound (double frequency) const
 
bool ocv_insert (double frequency, double ocv)
 
Transducerocv_replace (double frequency, double ocv)
 
OCVMCIter ocv_find (double frequency) const
 
Transducerocv_erase (double frequency)
 
int ocv_size () const
 
bool ocv_empty () const
 
Transducerocv_clear ()
 
OCVMCIter ocv_begin () const
 
OCVMCIter ocv_end () const
 
OCVMCRIter ocv_rbegin () const
 
OCVMCRIter ocv_rend () const
 
OCVMCIter ocv_lower_bound (double frequency) const
 
OCVMCIter ocv_upper_bound (double frequency) const
 
TransducerclearAll ()
 
virtual bool import (::std::istream &stream_in)
 
virtual bool importBinary (::std::fstream &stream_in)
 
bool writeVertBeamPattern (::std::ostream &stream_out, const CoordZ &tx, const CoordZ &rx, double init_bearing, double vert_rot=0, double horiz_rot=0, double mult_costant=1, double add_costant=0) const
 
bool writeSPL (::std::ostream &stream_out, double frequency_step, double power) const
 
virtual bool write (::std::ostream &stream_out) const
 
virtual bool writeBinary (::std::fstream &file_out) const
 
TransducersetMaxPower (double power)
 
TransducersetDutyCycle (double cycle)
 
TransducersetResonanceFrequency (double frequency)
 
TransducersetBandwith3dB (double frequency)
 
TransducersetTypeName (const ::std::string &name)
 
virtual TransducersetBeamPrecision (long double prec)
 
virtual TransducersetTVRPrecision (long double prec)
 
virtual TransducersetOCVPrecision (long double prec)
 
virtual TransducersetConductancePrecision (long double prec)
 
bool hasToroidalSymmetry () const
 
bool hasConicalSymmetry () const
 
double getMaxPower () const
 
double getDutyCycle () const
 
double getResonanceFrequency () const
 
double getBandwith3dB () const
 
::std::string getTypeName () const
 
long double getBeamPrecision () const
 
long double getTVRPrecision () const
 
long double getOCVPrecision () const
 
long double getConductancePrecision () const
 
Transduceroperator= (const Transducer &x)
 
friend::std::ostream & operator<< (::std::ostream &os, const Transducer &instance)
 
friend::std::ostream & operator>> (::std::istream &is, const Transducer &instance)
 

Static Public Member Functions

static void setDebug (bool flag)
 

Protected Types

typedef ::std::map< PDouble, double > BeamPowerMap
 
typedef BeamPowerMap::iterator BPMIter
 
typedef BeamPowerMap::reverse_iterator BPMRIter
 
typedef BeamPowerMap::const_iterator BPMCIter
 
typedef BeamPowerMap::const_reverse_iterator BPMCRIter
 
typedef ::std::map< PDouble, double > ConductanceMap
 
typedef ConductanceMap::iterator CMIter
 
typedef ConductanceMap::reverse_iterator CMRIter
 
typedef ConductanceMap::const_iterator CMCIter
 
typedef ConductanceMap::const_reverse_iterator CMCRIter
 
typedef ::std::map< PDouble, double > TVRMap
 
typedef TVRMap::iterator TVRMIter
 
typedef TVRMap::reverse_iterator TVRMRIter
 
typedef TVRMap::const_iterator TVRMCIter
 
typedef TVRMap::const_reverse_iterator TVRMCRIter
 
typedef ::std::map< PDouble, double > OCVMap
 
typedef OCVMap::iterator OCVMIter
 
typedef OCVMap::reverse_iterator OCVMRIter
 
typedef OCVMap::const_iterator OCVMCIter
 
typedef OCVMap::const_reverse_iterator OCVMCRIter
 

Protected Member Functions

virtual double normalizeAngle (double angle) const
 
virtual double getValue (double frequency, const ::std::map< PDouble, double > &map, long double precision, bool use_linear=false, double costant=20.0) const
 
virtual void beampattern_sum (double value, BeamPowerMap &map)
 
virtual void beampattern_multiply (double value, BeamPowerMap &map)
 
virtual void beampattern_rotate (double angle, BeamPowerMap &map)
 
virtual bool import (::std::istream &stream_in, ::std::map< PDouble, double > &map, long double precision, bool is_angle=false)
 
virtual bool importBinary (::std::fstream &file_in, ::std::map< PDouble, double > &map, long double precision, bool is_angle=false)
 
virtual bool write (::std::ostream &stream_out, const ::std::map< PDouble, double > &map) const
 
virtual bool writeBinary (::std::fstream &file_out, const ::std::map< PDouble, double > &map) const
 
virtual const ::std::string & getSymmetryString () const
 

Protected Attributes

bool has_conical_symmetry
 
double resonance_frequency
 
double bandwith_3db
 
double max_power
 
double duty_cycle
 
long double beam_precision
 
long double conductance_precision
 
long double tvr_precision
 
long double ocv_precision
 
::std::string type_name
 
BeamPowerMap beam_power_map
 
ConductanceMap conductance_map
 
TVRMap tvr_map
 
OCVMap ocv_map
 

Static Protected Attributes

static const ::std::string conical_string = "CONICAL"
 
static const ::std::string toroidal_string = "TOROIDAL"
 
static bool debug = false
 

Friends

bool operator== (const Transducer &left, const Transducer &right)
 
bool operator!= (const Transducer &left, const Transducer &right)
 

Detailed Description

Member Typedef Documentation

◆ BeamPowerMap

typedef ::std::map< PDouble, double > woss::Transducer::BeamPowerMap
protected

Map that links a angle with its precision to a signed power gain in decibel [db re uPa @ 1m]

◆ ConductanceMap

typedef ::std::map< PDouble, double > woss::Transducer::ConductanceMap
protected

Map that links a frequency with its precision to a conductance value [uS]

◆ OCVMap

typedef ::std::map< PDouble, double > woss::Transducer::OCVMap
protected

Map that links a frequency with its precision to an OCV value [db re 1V/uPa]

◆ TVRMap

typedef ::std::map< PDouble, double > woss::Transducer::TVRMap
protected

Map that links a frequency with its precision to a TVR value [db re uPa/V @ 1m]

Constructor & Destructor Documentation

◆ Transducer() [1/3]

Transducer::Transducer ( long double  beam_precision = BEAM_PATTERN_CUSTOM_BEAM_PRECISION,
long double  conduct_precison = CONDUCTANCE_CUSTOM_FREQUENCY_PRECISION,
long double  tvr_precision = TVR_CUSTOM_FREQUENCY_PRECISION,
long double  ocv_precision = OCV_CUSTOM_FREQUENCY_PRECISION 
)

Transducer default constructor. The object created is not valid

Parameters
beam_precisionprecision of woss::PDouble objects representing angles
conduct_precisonprecision of woss::PDouble objects representing frequency
tvr_precisionprecision of woss::PDouble objects representing frequency
ocv_precisionprecision of woss::PDouble objects representing frequency

Referenced by clone(), and create().

◆ Transducer() [2/3]

Transducer::Transducer ( const Transducer copy)

Transducer copy constructor

Parameters
copyconst reference a Transducer

◆ Transducer() [3/3]

Transducer::Transducer ( BeamPowerMap beam_map,
ConductanceMap conductance_map,
TVRMap tvr_map,
OCVMap ocv_map 
)

Transducer constructor.

Parameters
beam_mapmap linking a woss::PDouble angle [dec degrees] (with precision beam_precision) to a signed power gain [decibel]
conductance_mapmap linking a woss::PDouble frequency [hz] (with precision conductance_precision) to conductance value
tvr_mapmap linking a woss::PDouble frequency [hz] (with precision tvr_precision) to a TVR value [db re 1 uPa/V @ 1m]
ocv_mapmap linking a woss::PDouble frequency [hz] (with precision ocv_precision) to a OCV value [db re 1V/uPa]

References beam_power_map, beam_precision, conductance_map, conductance_precision, ocv_map, ocv_precision, tvr_map, and tvr_precision.

Member Function Documentation

◆ beampattern_begin()

Transducer::BPMCIter woss::Transducer::beampattern_begin ( ) const
inline

Returns a const iterator to the beginning of the beam pattern map

Returns
const iterator

References beam_power_map.

◆ beampattern_clear()

Transducer & woss::Transducer::beampattern_clear ( )
inline

Clears all values

Returns
reference to *this

References beam_power_map.

◆ beampattern_empty()

bool woss::Transducer::beampattern_empty ( ) const
inline

Checks if the instance has stored values

Returns
true if condition applies, false otherwise

References beam_power_map.

◆ beampattern_end()

Transducer::BPMCIter woss::Transducer::beampattern_end ( ) const
inline

Returns a const iterator to the end of the beam pattern map

Returns
const iterator

References beam_power_map.

◆ beampattern_erase()

Transducer & woss::Transducer::beampattern_erase ( double  angle)
inline

Erase the power gain with key == of angle parameter

Parameters
angleconst reference to a double angle value
Returns
reference to *this

References beam_power_map.

◆ beampattern_find()

Transducer::BPMCIter woss::Transducer::beampattern_find ( double  angle) const
inline

Returns a const iterator to the signed power gain with key == of angle parameter

Parameters
angleconst reference to a double angle value
Returns
const iterator to end() if angle is not found

References beam_power_map.

◆ beampattern_insert()

bool woss::Transducer::beampattern_insert ( double  angle,
double  power 
)
inline

Inserts and doesn't replace a signed power gain at given angle

Parameters
angleangle value [dec degrees]. The corresponding PDouble will take SSP::beam_precision as precision
powersigned power gain [db re uPa]
Returns
true if inserted, false otherwise

References beam_power_map, beam_precision, and normalizeAngle().

Here is the call graph for this function:

◆ beampattern_lower_bound()

Transducer::BPMCIter woss::Transducer::beampattern_lower_bound ( double  angle) const
inline

Returns a const iterator to the signed power gain with key >= of angle parameter

Parameters
angleangle [dec degrees]
Returns
const iterator to end() if angle is not found

References beam_power_map, and beam_precision.

◆ beampattern_multiply() [1/2]

Transducer & woss::Transducer::beampattern_multiply ( double  value)
inline

Multiplies the beam pattern by given value

Parameters
valuevalue
Returns
reference to *this

References beam_power_map, and beampattern_multiply().

Referenced by beampattern_multiply(), and writeVertBeamPattern().

Here is the call graph for this function:

◆ beampattern_multiply() [2/2]

void Transducer::beampattern_multiply ( double  value,
BeamPowerMap map 
)
protectedvirtual

The current beam pattern is multiplied by given value

Parameters
valuevalue

◆ beampattern_rbegin()

Transducer::BPMCRIter woss::Transducer::beampattern_rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the beam pattern map

Returns
const reverse iterator

References beam_power_map.

◆ beampattern_rend()

Transducer::BPMCRIter woss::Transducer::beampattern_rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the beam pattern map

Returns
const reverse iterator

References beam_power_map.

◆ beampattern_replace()

Transducer & woss::Transducer::beampattern_replace ( double  angle,
double  power 
)
inline

Replaces a signed power gain at given angle

Parameters
angleangle value [dec degrees]. The corresponding PDouble will take SSP::beam_precision as precision
powersigned power gain [db re uPa]
Returns
reference to *this

References beam_power_map, beam_precision, and normalizeAngle().

Here is the call graph for this function:

◆ beampattern_rotate() [1/2]

Transducer & woss::Transducer::beampattern_rotate ( double  angle)
inline

Rotate the beam pattern

Parameters
angleangle [dec degrees]
Returns
reference to *this

References beam_power_map, and beampattern_rotate().

Referenced by beampattern_rotate().

Here is the call graph for this function:

◆ beampattern_rotate() [2/2]

void Transducer::beampattern_rotate ( double  angle,
BeamPowerMap map 
)
protectedvirtual

Rotates the current beam pattern of a given angle

Parameters
valueangle [decimal degrees]

References beam_precision, and normalizeAngle().

Here is the call graph for this function:

◆ beampattern_size()

int woss::Transducer::beampattern_size ( ) const
inline

Returns the number of angles stored

Returns
number of angles stored

References beam_power_map.

◆ beampattern_sum() [1/2]

Transducer & woss::Transducer::beampattern_sum ( double  value)
inline

Adds given value to the beam pattern

Parameters
valuesum costant
Returns
reference to *this

References beam_power_map, and beampattern_sum().

Referenced by beampattern_sum(), and writeVertBeamPattern().

Here is the call graph for this function:

◆ beampattern_sum() [2/2]

void Transducer::beampattern_sum ( double  value,
BeamPowerMap map 
)
protectedvirtual

Adds a value to the current beam pattern

Parameters
valuevalue to be added

◆ beampattern_upper_bound()

Transducer::BPMCIter woss::Transducer::beampattern_upper_bound ( double  angle) const
inline

Returns a const iterator to the signed power gain with key > of angle parameter

Parameters
angleangle [dec degrees]
Returns
const iterator to end() if angle is not found

References beam_power_map, and beam_precision.

◆ clearAll()

Transducer & woss::Transducer::clearAll ( )
inline

Clears all maps

Returns
reference to *this

References beam_power_map, conductance_map, ocv_map, and tvr_map.

◆ clone()

Transducer * Transducer::clone ( ) const
virtual

Transducer virtual factory method

Returns
a heap-created copy of this instance

References Transducer().

Referenced by woss::DefHandler::operator=().

Here is the call graph for this function:

◆ conductance_begin()

Transducer::CMCIter woss::Transducer::conductance_begin ( ) const
inline

Returns a const iterator to the beginning of the conductance map

Returns
const iterator

References conductance_map.

◆ conductance_clear()

Transducer & woss::Transducer::conductance_clear ( )
inline

Clears all values

Returns
reference to *this

References conductance_map.

◆ conductance_empty()

bool woss::Transducer::conductance_empty ( ) const
inline

Checks if the instance has stored conductance values

Returns
true if condition applies, false otherwise

References conductance_map.

◆ conductance_end()

Transducer::CMCIter woss::Transducer::conductance_end ( ) const
inline

Returns a const iterator to the end of the conductance map

Returns
const iterator

References conductance_map.

◆ conductance_erase()

Transducer & woss::Transducer::conductance_erase ( double  frequency)
inline

Erase the power gain with key == of angle parameter

Parameters
frequencyfrequency [hz]
Returns
reference to *this

References conductance_map.

◆ conductance_find()

Transducer::CMCIter woss::Transducer::conductance_find ( double  frequency) const
inline

Returns a const iterator to the conductance with key == of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if frequency is not found

References conductance_map.

◆ conductance_insert() [1/2]

bool woss::Transducer::conductance_insert ( double  frequency,
const ::std::complex< double > &  impedance 
)
inline

Inserts and doesn't replace a complex impedance value at given frequency

Parameters
anglefrequency [hz]. The corresponding PDouble will take Transducer::conductance_precision as precision
conductancecomplex impedance [uS + j uF]
Returns
true if inserted, false otherwise

References conductance_map, and conductance_precision.

◆ conductance_insert() [2/2]

bool woss::Transducer::conductance_insert ( double  frequency,
double  conductance 
)
inline

Inserts and doesn't replace a conductance value at given frequency

Parameters
anglefrequency [hz]. The corresponding PDouble will take Transducer::conductance_precision as precision
conductanceconductance value [uS]
Returns
true if inserted, false otherwise

References conductance_map, and conductance_precision.

◆ conductance_lower_bound()

Transducer::CMCIter woss::Transducer::conductance_lower_bound ( double  frequency) const
inline

Returns a const iterator to the conductance with key >= of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if angle is not found

References conductance_map, and conductance_precision.

◆ conductance_rbegin()

Transducer::CMCRIter woss::Transducer::conductance_rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the conductance map

Returns
const reverse iterator

References conductance_map.

◆ conductance_rend()

Transducer::CMCRIter woss::Transducer::conductance_rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the conductance map

Returns
const reverse iterator

References conductance_map.

◆ conductance_replace() [1/2]

Transducer & woss::Transducer::conductance_replace ( double  frequency,
const ::std::complex< double > &  impedance 
)
inline

Replaces a conductance at given frequency

Parameters
anglefrequency [hz]. The corresponding PDouble will take Transducer::conductance_precision as precision
conductancecomplex impedance [uS + j uF]
Returns
reference to *this

References conductance_map, and conductance_precision.

◆ conductance_replace() [2/2]

Transducer & woss::Transducer::conductance_replace ( double  frequency,
double  conductance 
)
inline

Replaces a conductance at given frequency

Parameters
anglefrequency [hz]. The corresponding PDouble will take Transducer::conductance_precision as precision
conductanceconductance value [uS]
Returns
reference to *this

References conductance_map, and conductance_precision.

◆ conductance_size()

int woss::Transducer::conductance_size ( ) const
inline

Returns the number of frequencies stored

Returns
number of frequencies stored

References conductance_map.

◆ conductance_upper_bound()

Transducer::CMCIter woss::Transducer::conductance_upper_bound ( double  frequency) const
inline

Returns a const iterator to the conductance with key > of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if angle is not found

References conductance_map, and conductance_precision.

◆ create() [1/3]

Transducer * Transducer::create ( BeamPowerMap beam_map,
ConductanceMap conductance_map,
TVRMap tvr_map,
OCVMap ocv_map 
) const
virtual

Transducer virtual factory method

Parameters
beam_mapmap linking a woss::PDouble angle [dec degrees] (with precision beam_precision) to a signed power gain [decibel]
conductance_mapmap linking a woss::PDouble frequency [hz] (with precision conductance_precision) to conductance value
tvr_mapmap linking a woss::PDouble frequency [hz] (with precision tvr_precision) to a TVR value [db re 1 uPa/V @ 1m]
ocv_mapmap linking a woss::PDouble frequency [hz] (with precision ocv_precision) to a OCV value [db re 1V/uPa]
Returns
a heap-created Transducer object

References Transducer().

Here is the call graph for this function:

◆ create() [2/3]

Transducer * Transducer::create ( const Transducer copy) const
virtual

Transducer virtual factory method

Parameters
copyTransducer to be copied
Returns
a heap-created Transducer object

References Transducer().

Here is the call graph for this function:

◆ create() [3/3]

Transducer * Transducer::create ( long double  beam_precision = BEAM_PATTERN_CUSTOM_BEAM_PRECISION,
long double  conduct_precison = CONDUCTANCE_CUSTOM_FREQUENCY_PRECISION,
long double  tvr_precision = TVR_CUSTOM_FREQUENCY_PRECISION,
long double  ocv_precision = OCV_CUSTOM_FREQUENCY_PRECISION 
) const
virtual

Transducer virtual factory method

Parameters
beam_mapmap linking a woss::PDouble angle [dec degrees] (with precision beam_precision) to a signed power gain [decibel]
conductance_mapmap linking a woss::PDouble frequency [hz] (with precision conductance_precision) to conductance value
tvr_mapmap linking a woss::PDouble frequency [hz] (with precision tvr_precision) to a TVR value [db re 1 uPa/V @ 1m]
ocv_mapmap linking a woss::PDouble frequency [hz] (with precision ocv_precision) to a OCV value [db re 1V/uPa]
Returns
a heap-created Transducer object

References Transducer().

Here is the call graph for this function:

◆ getBandwith3dB()

double woss::Transducer::getBandwith3dB ( ) const
inline

Returns the bandwith at -3db around the resonance frequency

Returns
bandwith [hz]

References bandwith_3db.

◆ getBeamPrecision()

long double woss::Transducer::getBeamPrecision ( ) const
inline

Returns the beam pattern beam precision

Returns
beam precision [decimal degrees]

References beam_precision.

◆ getConductancePrecision()

long double woss::Transducer::getConductancePrecision ( ) const
inline

Returns the conductance frequency precision

Returns
precision [hz]

References conductance_precision.

◆ getDutyCycle()

double woss::Transducer::getDutyCycle ( ) const
inline

Returns the recommended duty cycle

Returns
duty cycle [between 0 and 1]

References duty_cycle.

◆ getMaxPower()

double woss::Transducer::getMaxPower ( ) const
inline

Returns max allowed input Power for this transducer

Returns
power [W]

References max_power.

◆ getMaxSPL()

double woss::Transducer::getMaxSPL ( double  frequency) const
inline

Returns the max SPL (Sound Pressure Level) for given frequency

Parameters
frequencyfrequency [hz]
Returns
reference to *this

References getSPL(), and max_power.

Referenced by WossMPhyBpsk::getTxPower().

Here is the call graph for this function:

◆ getOCVPrecision()

long double woss::Transducer::getOCVPrecision ( ) const
inline

Returns the OCV frequency precision

Returns
precision [hz]

References ocv_precision.

◆ getPowerFromSPL()

double Transducer::getPowerFromSPL ( double  frequency,
double  spl 
) const
virtual

Returns the input power for given frequency and SPL

Parameters
frequencyfrequency [hz]
spl[db re uPa]
Returns
power [W]

References conductance_map, conductance_precision, debug, getValue(), max_power, tvr_map, and tvr_precision.

Here is the call graph for this function:

◆ getResonanceFrequency()

double woss::Transducer::getResonanceFrequency ( ) const
inline

Returns the resonance frequency of the transducer

Returns
frequency [hz]

References resonance_frequency.

◆ getSPL()

double Transducer::getSPL ( double  frequency,
double  power 
) const
virtual

Returns the SPL (Sound Pressure Level) for given frequency and input power

Parameters
frequencyfrequency [hz]
powerinput power [W]
Returns
reference to *this

References conductance_map, conductance_precision, debug, getValue(), max_power, tvr_map, and tvr_precision.

Referenced by getMaxSPL(), and writeSPL().

Here is the call graph for this function:

◆ getTVRPrecision()

long double woss::Transducer::getTVRPrecision ( ) const
inline

Returns the TVR frequency precision

Returns
precision [hz]

References tvr_precision.

◆ getTypeName()

std::string woss::Transducer::getTypeName ( ) const
inline

Returns the transducer typename

Returns
name

References type_name.

◆ getValue()

double Transducer::getValue ( double  frequency,
const ::std::map< PDouble, double > &  map,
long double  precision,
bool  use_linear = false,
double  costant = 20.0 
) const
protectedvirtual

Returns a value for given frequency in the given map and with given precision.

Parameters
frequencyfrequency [decimal degrees]
mapone of the transducer's map
mapprecision
Returns
value found

References debug, and tvr_map.

Referenced by getPowerFromSPL(), and getSPL().

◆ import() [1/2]

virtual bool woss::Transducer::import ( ::std::istream &  stream_in)
virtual

Imports values in from the given stream

Parameters
stream_inconst reference to an istream instance
Returns
true if method was successful, false otherwise

Referenced by woss::TransducerHandler::importValueAscii().

◆ import() [2/2]

bool Transducer::import ( ::std::istream &  stream_in,
::std::map< PDouble, double > &  map,
long double  precision,
bool  is_angle = false 
)
protectedvirtual

Imports values in the given map with given precision from the given stream

Parameters
stream_inconst reference to an istream instance
mapany of the transducer's map
precisionmap PDouble keys precision
is_angleflag to signal if the input map is a beam pattern map
Returns
true if method was successful, false otherwise

References debug, and normalizeAngle().

Here is the call graph for this function:

◆ importBinary() [1/2]

bool Transducer::importBinary ( ::std::fstream &  file_in,
::std::map< PDouble, double > &  map,
long double  precision,
bool  is_angle = false 
)
protectedvirtual

Imports values in the given map with given precision from the given binary stream

Parameters
stream_inconst reference to an istream instance
mapany of the transducer's map
precisionmap PDouble keys precision
is_angleflag to signal if the input map is a beam pattern map
Returns
true if method was successful, false otherwise

References debug, and normalizeAngle().

Here is the call graph for this function:

◆ importBinary() [2/2]

virtual bool woss::Transducer::importBinary ( ::std::fstream &  stream_in)
virtual

Imports values in from the given binary stream

Parameters
stream_inconst reference to an istream instance
Returns
true if method was successful, false otherwise

Referenced by woss::TransducerHandler::importValueBinary().

◆ isValid()

bool Transducer::isValid ( ) const
virtual

Checks the validity of the object

Returns
true if it has at least one value, false otherwise

References bandwith_3db, beam_power_map, conductance_map, duty_cycle, max_power, ocv_map, resonance_frequency, and tvr_map.

Referenced by WossMPhyBpsk::getTxPower(), and woss::BellhopWoss::writeRayOptions().

◆ normalizeAngle()

double Transducer::normalizeAngle ( double  angle) const
protectedvirtual

Returns an angle in [-180.0 , 180.0]

Parameters
angleangle [decimal degrees]
Returns
angle [decimal degrees]

Referenced by beampattern_insert(), beampattern_replace(), beampattern_rotate(), import(), and importBinary().

◆ ocv_begin()

Transducer::CMCIter woss::Transducer::ocv_begin ( ) const
inline

Returns a const iterator to the beginning of the OCV map

Returns
const iterator

References ocv_map.

◆ ocv_clear()

Transducer & woss::Transducer::ocv_clear ( )
inline

Clears all OCV values

Returns
reference to *this

References ocv_map.

◆ ocv_empty()

bool woss::Transducer::ocv_empty ( ) const
inline

Checks if the instance has any OCV stored values

Returns
true if condition applies, false otherwise

References ocv_map.

◆ ocv_end()

Transducer::CMCIter woss::Transducer::ocv_end ( ) const
inline

Returns a const iterator to the end of the OCV map

Returns
const iterator

References ocv_map.

◆ ocv_erase()

Transducer & woss::Transducer::ocv_erase ( double  frequency)
inline

Erase the OCV with key == of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
reference to *this

References ocv_map.

◆ ocv_find()

Transducer::CMCIter woss::Transducer::ocv_find ( double  frequency) const
inline

Returns a const iterator to the OCV with key == of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if frequency is not found

References ocv_map.

◆ ocv_insert()

bool woss::Transducer::ocv_insert ( double  frequency,
double  ocv 
)
inline

Inserts and doesn't replace an OCV value at given frequency

Parameters
frequencyfrequency value [hz]. The corresponding PDouble will take Transducer::ocv_precision as precision
ocvOCV [db re 1V/uPa]
Returns
true if inserted, false otherwise

References ocv_map, and ocv_precision.

◆ ocv_lower_bound()

Transducer::CMCIter woss::Transducer::ocv_lower_bound ( double  frequency) const
inline

Returns a const iterator to the OCV with key >= of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if angle is not found

References ocv_map, and ocv_precision.

◆ ocv_rbegin()

Transducer::CMCRIter woss::Transducer::ocv_rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the OCV map

Returns
const reverse iterator

References ocv_map.

◆ ocv_rend()

Transducer::CMCRIter woss::Transducer::ocv_rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the OCV map

Returns
const reverse iterator

References ocv_map.

◆ ocv_replace()

Transducer & woss::Transducer::ocv_replace ( double  frequency,
double  ocv 
)
inline

Replaces an OCV value at given frequency

Parameters
frequencyfrequency value [hz]. The corresponding PDouble will take Transducer::ocv_precision as precision
ocvOCV [db re 1V/uPa]
Returns
reference to *this

References ocv_map, and ocv_precision.

◆ ocv_size()

int woss::Transducer::ocv_size ( ) const
inline

Returns the number of OCV value stored

Returns
number of angles stored

References ocv_map.

◆ ocv_upper_bound()

Transducer::CMCIter woss::Transducer::ocv_upper_bound ( double  frequency) const
inline

Returns a const iterator to the OCV with key > of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if angle is not found

References ocv_map, and ocv_precision.

◆ operator<<()

friend::std::ostream & woss::Transducer::operator<< ( ::std::ostream &  os,
const Transducer instance 
)

<< operator

Parameters
osleft operand ostream reference
instanceright operand const Transducer reference
Returns
os reference after the operation

◆ operator=()

Transducer & Transducer::operator= ( const Transducer x)

Assignment operator

Parameters
copyconst reference to a Transducer object to be copied
Returns
Transducer reference to this

References bandwith_3db, beam_power_map, beam_precision, conductance_map, conductance_precision, duty_cycle, has_conical_symmetry, max_power, ocv_map, ocv_precision, resonance_frequency, tvr_map, and tvr_precision.

◆ operator>>()

friend::std::ostream & woss::Transducer::operator>> ( ::std::istream &  is,
const Transducer instance 
)

‍operator

Parameters
osleft operand ostream reference
instanceright operand const Transducer reference
Returns
os reference after the operation

◆ setBeamPrecision()

Transducer & Transducer::setBeamPrecision ( long double  prec)
virtual

Sets the beam pattern precision for all PDouble angle values. If the given precision is different from current value, the profile will be modified accordingly

Parameters
precbeam precision [decimal degrees]

References beam_power_map, and beam_precision.

◆ setConductancePrecision()

Transducer & Transducer::setConductancePrecision ( long double  prec)
virtual

Sets the conductance precision for all PDouble frequency values. If the given precision is different from current value, the profile will be modified accordingly

Parameters
precfrequency [hz]

References conductance_map, and conductance_precision.

◆ setDebug()

static void woss::Transducer::setDebug ( bool  flag)
inlinestatic

Sets debug flag for all instances

Parameters
flagdebug bool

References debug.

◆ setOCVPrecision()

Transducer & Transducer::setOCVPrecision ( long double  prec)
virtual

Sets the OCV precision for all PDouble frequency values. If the given precision is different from current value, the profile will be modified accordingly

Parameters
precfrequency [hz]

References beam_precision, and ocv_map.

◆ setTVRPrecision()

Transducer & Transducer::setTVRPrecision ( long double  prec)
virtual

Sets the TVR precision for all PDouble frequency values. If the given precision is different from current value, the profile will be modified accordingly

Parameters
precfrequency [hz]

References tvr_map, and tvr_precision.

◆ tvr_begin()

Transducer::CMCIter woss::Transducer::tvr_begin ( ) const
inline

Returns a const iterator to the beginning of the tvr map

Returns
const iterator

References tvr_map.

◆ tvr_clear()

Transducer & woss::Transducer::tvr_clear ( )
inline

Clears all values

Returns
reference to *this

References tvr_map.

◆ tvr_empty()

bool woss::Transducer::tvr_empty ( ) const
inline

Checks if the instance has any stored tvr values

Returns
true if condition applies, false otherwise

References tvr_map.

◆ tvr_end()

Transducer::CMCIter woss::Transducer::tvr_end ( ) const
inline

Returns a const iterator to the end of the tvr map

Returns
const iterator

References tvr_map.

◆ tvr_erase()

Transducer & woss::Transducer::tvr_erase ( double  frequency)
inline

Erase the tvr with key == to frequency parameter

Parameters
frequencyfrequency [hz]
Returns
reference to *this

References tvr_map.

◆ tvr_find()

Transducer::CMCIter woss::Transducer::tvr_find ( double  frequency) const
inline

Returns a const iterator to the tvr with key == to frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if angle is not found

References tvr_map.

◆ tvr_insert()

bool woss::Transducer::tvr_insert ( double  frequency,
double  tvr 
)
inline

Inserts and doesn't replace a tvr at given frequency

Parameters
frequencyfrequency value [hz]. The corresponding PDouble will take Transducer::tvr_precision as precision
tvrtvr [db re uPa/V @ 1m]
Returns
true if inserted, false otherwise

References tvr_map, and tvr_precision.

◆ tvr_lower_bound()

Transducer::CMCIter woss::Transducer::tvr_lower_bound ( double  frequency) const
inline

Returns a const iterator to the signed power gain with key >= of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if frequency is not found

References tvr_map, and tvr_precision.

◆ tvr_rbegin()

Transducer::CMCRIter woss::Transducer::tvr_rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the tvr map

Returns
const reverse iterator

References tvr_map.

◆ tvr_rend()

Transducer::CMCRIter woss::Transducer::tvr_rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the tvr map

Returns
const reverse iterator

References tvr_map.

◆ tvr_replace()

Transducer & woss::Transducer::tvr_replace ( double  frequency,
double  tvr 
)
inline

Replaces a tvr at given frequency

Parameters
frequencyfrequency value [hz]. The corresponding PDouble will take Transducer::tvr_precision as precision
tvrtvr [db re uPa/V @ 1m]
Returns
reference to *this

References tvr_map, and tvr_precision.

◆ tvr_size()

int woss::Transducer::tvr_size ( ) const
inline

Returns the number of frequencies stored

Returns
number of frequencies stored

References tvr_map.

◆ tvr_upper_bound()

Transducer::CMCIter woss::Transducer::tvr_upper_bound ( double  frequency) const
inline

Returns a const iterator to the signed power gain with key > of frequency parameter

Parameters
frequencyfrequency [hz]
Returns
const iterator to end() if frequency is not found

References tvr_map, and tvr_precision.

◆ write() [1/2]

bool Transducer::write ( ::std::ostream &  stream_out) const
virtual

Write values out to the given stream

Parameters
stream_outconst reference to an ostream instance
Returns
true if method was successful, false otherwise

References bandwith_3db, beam_power_map, beam_precision, conductance_map, conductance_precision, duty_cycle, max_power, ocv_map, ocv_precision, resonance_frequency, tvr_map, tvr_precision, type_name, and write().

Referenced by write().

Here is the call graph for this function:

◆ write() [2/2]

bool Transducer::write ( ::std::ostream &  stream_out,
const ::std::map< PDouble, double > &  map 
) const
protectedvirtual

Writes values in the given map with given precision to the given stream

Parameters
stream_outconst reference to an ostream instance
mapany of the transducer's map
Returns
true if method was successful, false otherwise

◆ writeBinary() [1/2]

bool Transducer::writeBinary ( ::std::fstream &  file_out) const
virtual

Write values out to the given binary stream

Parameters
stream_outconst reference to an ostream instance
Returns
true if method was successful, false otherwise

References bandwith_3db, beam_power_map, beam_precision, conductance_map, conductance_precision, duty_cycle, max_power, ocv_map, ocv_precision, resonance_frequency, tvr_map, tvr_precision, type_name, and writeBinary().

Referenced by writeBinary().

Here is the call graph for this function:

◆ writeBinary() [2/2]

bool Transducer::writeBinary ( ::std::fstream &  file_out,
const ::std::map< PDouble, double > &  map 
) const
protectedvirtual

Writes values in the given map with given precision to the given binary stream

Parameters
stream_outconst reference to an ostream instance
mapany of the transducer's map
Returns
true if method was successful, false otherwise

◆ writeSPL()

bool Transducer::writeSPL ( ::std::ostream &  stream_out,
double  frequency_step,
double  power 
) const

Write SPL values for all frequencies to the given steram

Parameters
stream_outconst reference to an ostream instance
Returns
true if method was successful, false otherwise

References conductance_map, getSPL(), max_power, and tvr_map.

Here is the call graph for this function:

◆ writeVertBeamPattern()

bool Transducer::writeVertBeamPattern ( ::std::ostream &  stream_out,
const CoordZ tx,
const CoordZ rx,
double  init_bearing,
double  vert_rot = 0,
double  horiz_rot = 0,
double  mult_costant = 1,
double  add_costant = 0 
) const

Writes the beam pattern to the given stream

Parameters
stream_outconst reference to an ostream instance
rotationbeam pattern rotation [decimal degrees]
mult_costantvalue to be added
add_costantvalue to be multiplied by
Returns
true if method was successful, false otherwise

References beampattern_multiply(), beampattern_sum(), debug, woss::CoordZ::getCartX(), woss::CoordZ::getCartY(), and woss::CoordZ::getCartZ().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Transducer left,
const Transducer right 
)
friend

Inequality operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left == right, false otherwise

◆ operator==

bool operator== ( const Transducer left,
const Transducer right 
)
friend

Equality operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left == right, false otherwise

Member Data Documentation

◆ bandwith_3db

double woss::Transducer::bandwith_3db
protected

the bandwith @ -3dB around the resonance frequency [hz]

Referenced by getBandwith3dB(), isValid(), operator=(), write(), and writeBinary().

◆ beam_power_map

◆ beam_precision

◆ conductance_map

◆ conductance_precision

◆ debug

bool Transducer::debug = false
staticprotected

◆ duty_cycle

double woss::Transducer::duty_cycle
protected

recommended duty cycle [between 0 and 1]

Referenced by getDutyCycle(), isValid(), operator=(), write(), and writeBinary().

◆ has_conical_symmetry

bool woss::Transducer::has_conical_symmetry
protected

set to true if transducer has conical symmetry along axis through angle = 0°

Referenced by operator=().

◆ max_power

double woss::Transducer::max_power
protected

◆ ocv_map

◆ ocv_precision

long double woss::Transducer::ocv_precision
protected

◆ resonance_frequency

double woss::Transducer::resonance_frequency
protected

resonance frequency of the transducer [hz]

Referenced by getResonanceFrequency(), isValid(), operator=(), write(), and writeBinary().

◆ tvr_map

◆ tvr_precision

long double woss::Transducer::tvr_precision
protected

◆ type_name

::std::string woss::Transducer::type_name
protected

transducer's model name

Referenced by getTypeName(), write(), and writeBinary().


The documentation for this class was generated from the following files: