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)=default
 Transducer (Transducer &&tmp)=default
 Transducer (BeamPowerMap &beam_map, ConductanceMap &conductance_map, TVRMap &tvr_map, OCVMap &ocv_map)
virtual ~Transducer ()=default
virtual std::unique_ptr< 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 std::unique_ptr< Transducercreate (BeamPowerMap &beam_map, ConductanceMap &conductance_map, TVRMap &tvr_map, OCVMap &ocv_map) const
virtual std::unique_ptr< 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 &copy)=default
Transduceroperator= (Transducer &&tmp)=default

Static Public Member Functions

static void setDebug (bool flag)

Protected Types

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

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)
std::ostream & operator<< (std::ostream &os, const Transducer &instance)
std::ostream & operator>> (std::istream &is, const Transducer &instance)

Detailed Description

Member Typedef Documentation

◆ BeamPowerMap

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

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

◆ BPMCIter

using woss::Transducer::BPMCIter = BeamPowerMap::const_iterator
protected

◆ BPMCRIter

using woss::Transducer::BPMCRIter = BeamPowerMap::const_reverse_iterator
protected

◆ BPMIter

using woss::Transducer::BPMIter = BeamPowerMap::iterator
protected

◆ BPMRIter

using woss::Transducer::BPMRIter = BeamPowerMap::reverse_iterator
protected

◆ CMCIter

using woss::Transducer::CMCIter = ConductanceMap::const_iterator
protected

◆ CMCRIter

using woss::Transducer::CMCRIter = ConductanceMap::const_reverse_iterator
protected

◆ CMIter

using woss::Transducer::CMIter = ConductanceMap::iterator
protected

◆ CMRIter

using woss::Transducer::CMRIter = ConductanceMap::reverse_iterator
protected

◆ ConductanceMap

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

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

◆ OCVMap

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

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

◆ OCVMCIter

using woss::Transducer::OCVMCIter = OCVMap::const_iterator
protected

◆ OCVMCRIter

using woss::Transducer::OCVMCRIter = OCVMap::const_reverse_iterator
protected

◆ OCVMIter

using woss::Transducer::OCVMIter = OCVMap::iterator
protected

◆ OCVMRIter

using woss::Transducer::OCVMRIter = OCVMap::reverse_iterator
protected

◆ TVRMap

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

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

◆ TVRMCIter

using woss::Transducer::TVRMCIter = TVRMap::const_iterator
protected

◆ TVRMCRIter

using woss::Transducer::TVRMCRIter = TVRMap::const_reverse_iterator
protected

◆ TVRMIter

using woss::Transducer::TVRMIter = TVRMap::iterator
protected

◆ TVRMRIter

using woss::Transducer::TVRMRIter = TVRMap::reverse_iterator
protected

Constructor & Destructor Documentation

◆ Transducer() [1/4]

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() [2/4]

woss::Transducer::Transducer ( const Transducer & copy)
default

References Transducer().

Here is the call graph for this function:

◆ Transducer() [3/4]

woss::Transducer::Transducer ( Transducer && tmp)
default

References conductance_map, ocv_map, Transducer(), and tvr_map.

Here is the call graph for this function:

◆ Transducer() [4/4]

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 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, tvr_precision, and type_name.

◆ ~Transducer()

virtual woss::Transducer::~Transducer ( )
virtualdefault

References beam_precision, conductance_map, ocv_map, ocv_precision, Transducer(), tvr_map, and tvr_precision.

Here is the call graph for this function:

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, and Transducer().

Here is the call graph for this function:

◆ 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.

Referenced by WossUnitTest::testTransducer().

◆ 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, and Transducer().

Here is the call graph for this function:

◆ 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.

Referenced by WossUnitTest::testTransducer().

◆ 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().

Referenced by WossUnitTest::testTransducer(), and WossUnitTest::testTransducerHandler().

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, beampattern_multiply(), and Transducer().

Referenced by beampattern_multiply(), WossUnitTest::testTransducer(), 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, normalizeAngle(), and Transducer().

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, beampattern_rotate(), and Transducer().

Referenced by beampattern_rotate(), WossUnitTest::testTransducer(), and writeVertBeamPattern().

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, debug, 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.

Referenced by WossUnitTest::testTransducer().

◆ 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, beampattern_sum(), and Transducer().

Referenced by beampattern_sum(), WossUnitTest::testTransducer(), 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, Transducer(), and tvr_map.

Here is the call graph for this function:

◆ clone()

std::unique_ptr< Transducer > Transducer::clone ( ) const
virtual

Transducer virtual factory method

Returns
a std::unique_ptr to a heap-created copy of this instance

Referenced by woss::TransducerHandler::insertValue(), woss::TransducerHandler::replaceValue(), and WossUnitTest::testTransducer().

◆ 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, and Transducer().

Here is the call graph for this function:

◆ 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, and Transducer().

Here is the call graph for this function:

◆ 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, conductance_precision, and Transducer().

Here is the call graph for this function:

◆ 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, conductance_precision, and Transducer().

Here is the call graph for this function:

◆ 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/2]

std::unique_ptr< 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 std::unique_ptr to a heap-created Transducer object

◆ create() [2/2]

std::unique_ptr< 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 std::unique_ptr to a heap-created Transducer object

Referenced by WossUnitTest::testTransducer().

◆ 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.

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:

◆ getSymmetryString()

const std::string & Transducer::getSymmetryString ( ) const
protectedvirtual

◆ 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(), getSPL(), and writeVertBeamPattern().

◆ hasConicalSymmetry()

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

Returns beam patter's conical symmetry

Returns
true if the beam patter has conical symmetry, false otherwise

References has_conical_symmetry.

◆ hasToroidalSymmetry()

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

Returns beam patter's toroidal symmetry

Returns
true if the beam patter has toroidal symmetry, false otherwise

References has_conical_symmetry.

◆ import() [1/2]

bool 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

References bandwith_3db, beam_power_map, beam_precision, conductance_map, conductance_precision, conical_string, debug, duty_cycle, getSymmetryString(), has_conical_symmetry, max_power, ocv_map, ocv_precision, resonance_frequency, toroidal_string, tvr_map, tvr_precision, and type_name.

Referenced by woss::operator>>().

Here is the call graph for this function:

◆ 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]

bool 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

References bandwith_3db, beam_power_map, beam_precision, conductance_map, conductance_precision, conical_string, debug, duty_cycle, getSymmetryString(), has_conical_symmetry, importBinary(), max_power, ocv_map, ocv_precision, resonance_frequency, toroidal_string, tvr_map, tvr_precision, and type_name.

Referenced by importBinary().

Here is the call graph for this function:

◆ 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 WossUnitTest::testTransducer().

◆ 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, and Transducer().

Here is the call graph for this function:

◆ 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, and Transducer().

Here is the call graph for this function:

◆ 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.

Referenced by WossUnitTest::testTransducer().

◆ 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.

Referenced by WossUnitTest::testTransducer().

◆ 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, ocv_precision, and Transducer().

Here is the call graph for this function:

◆ 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=() [1/2]

Transducer & woss::Transducer::operator= ( const Transducer & copy)
default

References Transducer().

Here is the call graph for this function:

◆ operator=() [2/2]

Transducer & woss::Transducer::operator= ( Transducer && tmp)
default

References Transducer().

Here is the call graph for this function:

◆ setBandwith3dB()

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

Sets the tranduscer's 3dB bandwith

Parameters
frequencybandwith [hZ]
Returns
reference to *this

References bandwith_3db, and Transducer().

Here is the call graph for this function:

◆ 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, beam_precision, and Transducer().

Here is the call graph for this function:

◆ 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, conductance_precision, and Transducer().

Here is the call graph for this function:

◆ setDebug()

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

Sets debug flag for all instances

Parameters
flagdebug bool

References debug.

◆ setDutyCycle()

Transducer & woss::Transducer::setDutyCycle ( double cycle)
inline

Sets the tranduscer's max power

Parameters
doublemax power in [W]
Returns
reference to *this

References duty_cycle, and Transducer().

Here is the call graph for this function:

◆ setMaxPower()

Transducer & woss::Transducer::setMaxPower ( double power)
inline

Sets the tranduscer's max power

Parameters
doublemax power in [W]
Returns
reference to *this

References max_power, and Transducer().

Here is the call graph for this function:

◆ 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, ocv_map, and Transducer().

Here is the call graph for this function:

◆ setResonanceFrequency()

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

Sets the tranduscer's resonance frequency

Parameters
frequencyfrequency [hZ]
Returns
reference to *this

References resonance_frequency, and Transducer().

Here is the call graph for this function:

◆ 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 Transducer(), tvr_map, and tvr_precision.

Here is the call graph for this function:

◆ setTypeName()

Transducer & woss::Transducer::setTypeName ( const std::string & name)
inline

Sets the tranduscer's type name

Parameters
nametype name
Returns
reference to *this

References Transducer(), and type_name.

Referenced by WossUnitTest::testTransducerHandler().

Here is the call graph for this function:

◆ 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 Transducer(), and tvr_map.

Here is the call graph for this function:

◆ 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 Transducer(), and tvr_map.

Here is the call graph for this function:

◆ 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.

Referenced by WossUnitTest::testTransducer().

◆ 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.

Referenced by WossUnitTest::testTransducer().

◆ 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 Transducer(), tvr_map, and tvr_precision.

Here is the call graph for this function:

◆ 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, getSymmetryString(), max_power, ocv_map, ocv_precision, resonance_frequency, tvr_map, tvr_precision, type_name, and write().

Referenced by operator<<, write(), and writeVertBeamPattern().

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, getSymmetryString(), 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 beam_power_map, beam_precision, beampattern_multiply(), beampattern_rotate(), beampattern_sum(), woss::convCart2Spher(), woss::convSpher2Cart(), woss::crossProd(), debug, woss::CoordZ::getCartX(), woss::CoordZ::getCartY(), woss::CoordZ::getCartZ(), woss::CoordZ::getSphericalPhi(), woss::CoordZ::getSphericalTheta(), getValue(), has_conical_symmetry, woss::normCart(), woss::rotCartXY(), woss::rotCartXZ(), woss::scalarProd(), Transducer(), and write().

Here is the call graph for this function:

◆ 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

References beam_power_map, conductance_map, ocv_map, Transducer(), and tvr_map.

◆ operator<<

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

<< operator

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

References Transducer(), and write().

◆ 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

References beam_power_map, conductance_map, ocv_map, Transducer(), and tvr_map.

◆ operator>>

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

operator

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

References Transducer().

Member Data Documentation

◆ bandwith_3db

double woss::Transducer::bandwith_3db
protected

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

Referenced by getBandwith3dB(), import(), importBinary(), isValid(), setBandwith3dB(), Transducer(), Transducer(), write(), and writeBinary().

◆ beam_power_map

◆ beam_precision

◆ conductance_map

◆ conductance_precision

◆ conical_string

const std::string Transducer::conical_string = "CONICAL"
staticprotected

◆ debug

bool Transducer::debug = false
staticprotected

◆ duty_cycle

double woss::Transducer::duty_cycle
protected

recommended duty cycle [between 0 and 1]

Referenced by getDutyCycle(), import(), importBinary(), isValid(), setDutyCycle(), Transducer(), Transducer(), 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 getSymmetryString(), hasConicalSymmetry(), hasToroidalSymmetry(), import(), importBinary(), Transducer(), Transducer(), and writeVertBeamPattern().

◆ 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

◆ toroidal_string

const std::string Transducer::toroidal_string = "TOROIDAL"
staticprotected

◆ tvr_map

◆ tvr_precision

◆ type_name

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

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