World Ocean Simulation System (WOSS) library
|
Complex attenuated pressure class. More...
#include <pressure-definitions.h>
Public Member Functions | |
Pressure (double real=0.0, double imag=0.0) | |
Pressure (const ::std::complex< double > &complex_press) | |
Pressure (const TimeArr &time_arr) | |
Pressure (const Pressure ©) | |
virtual Pressure * | create (double real=0.0, double imag=0.0) const |
virtual Pressure * | create (const ::std::complex< double > &complex_press) const |
virtual Pressure * | create (const TimeArr &time_arr) const |
virtual Pressure * | create (const Pressure ©) const |
virtual Pressure * | clone () const |
virtual Pressure * | createArray (unsigned int array_size) const |
operator::std::complex () const | |
double | real () const |
double | imag () const |
double | abs () const |
double | phase () const |
Pressure | sqrt () const |
virtual bool | isValid () const |
double | getTxLossDb () const |
virtual bool | checkAttenuation (double distance, double frequency) |
Pressure & | operator= (const Pressure &x) |
friend::std::ostream & | operator<< (::std::ostream &os, const Pressure &instance) |
Static Public Member Functions | |
static const ::std::complex< double > | createNotValid () |
static double | getTxLossDb (const ::std::complex< double > &val) |
static void | setDebug (bool flag) |
Protected Member Functions | |
virtual double | getAttenuation (double dist, double freq) |
double | getThorpAtt (double frequency) |
Protected Attributes | |
::std::complex< double > | complex_pressure |
Static Protected Attributes | |
static bool | debug = false |
Friends | |
const Pressure | operator+ (const Pressure &left, const Pressure &right) |
const Pressure | operator- (const Pressure &left, const Pressure &right) |
const Pressure | operator/ (const Pressure &left, const Pressure &right) |
const Pressure | operator* (const Pressure &left, const Pressure &right) |
Pressure & | operator+= (Pressure &left, const Pressure &right) |
Pressure & | operator-= (Pressure &left, const Pressure &right) |
Pressure & | operator/= (Pressure &left, const Pressure &right) |
Pressure & | operator*= (Pressure &left, const Pressure &right) |
bool | operator== (const Pressure &left, const Pressure &right) |
bool | operator!= (const Pressure &left, const Pressure &right) |
Complex attenuated pressure class.
The Pressure class stores a complex<double> acoustic pressure value for attenuation purposes. Pressure values are adimensional: complex pressure represented has to be considered in conjunction with transmitted pressure. Pressure also provides full arithmetic capability and a attenuation coherency check
Pressure::Pressure | ( | double | real = 0.0 , |
double | imag = 0.0 |
||
) |
Pressure constructor
real | real part |
imag | imaginary part |
woss::Pressure::Pressure | ( | const ::std::complex< double > & | complex_press | ) |
Pressure constructor
complex_press | complex<double> value |
Pressure::Pressure | ( | const TimeArr & | time_arr | ) |
Constructs a Pressure from a TimeArr
time_arr | valid TimeArr const reference |
References woss::TimeArr::begin(), complex_pressure, createNotValid(), woss::TimeArr::end(), and woss::TimeArr::isValid().
Pressure::Pressure | ( | const Pressure & | copy | ) |
|
inline |
Gets the absolute value
References complex_pressure.
Referenced by WossMPropagation::computeGain(), getTxLossDb(), and WossMPhyBpsk::getTxPower().
|
virtual |
Checks if the attuenuation provided by the complex pressure is truly an attenuation, e.g. if abs < 1. If not, replace the pressure with the attenuation provided by Thorp absorption process at given frequency along the given distance
distance | distance value in meters |
frequency | frequency value in hertz |
References complex_pressure, debug, getAttenuation(), and phase().
Referenced by woss::TimeArr::checkPressureAttenuation(), and WossMPropagation::computeGain().
|
inlinevirtual |
Pressure virtual factory method
Referenced by woss::DefHandler::operator=().
|
inlinevirtual |
|
inlinevirtual |
Pressure virtual factory method
real | real part |
imag | imaginary part |
References imag(), and real().
Referenced by WossMPhyBpsk::getTxPower(), woss::WossManagerResDb::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), woss::ArrAscResReader::readAvgPressure(), woss::ArrBinResReader::readAvgPressure(), woss::ShdResReader::readAvgPressure(), and woss::ShdResReader::readPressure().
|
inlinevirtual |
Pressure virtual factory method
array_size | size of array |
|
inlinestatic |
Creates an instance not valid
Referenced by woss::TimeArr::createNotValid(), woss::WossManagerResDb::dbGetPressure(), woss::WossDbManager::getPressure(), woss::ResPressureTxtDb::getValue(), woss::WossManager::getWossPressure(), woss::TimeArr::isValid(), Pressure(), woss::ArrAscResReader::readAvgPressure(), woss::ArrBinResReader::readAvgPressure(), woss::ShdResReader::readAvgPressure(), woss::ResPressureTxtDb::readMap(), woss::ShdResReader::readPressure(), woss::ShdResReader::readTimeArr(), and woss::TimeArr::TimeArr().
|
protectedvirtual |
Gets the linear acoustic attenuation incurred at given frequency along the given distance
dist | distance in meters |
freq | frequency in hertz |
References getThorpAtt().
Referenced by checkAttenuation(), and WossMPropagation::computeGain().
|
protected |
Gets the acoustic attenuation (in db re uPa / m ) given by Thorp absorption process incurred at given frequency
freq | frequency in hertz |
Referenced by getAttenuation().
|
inline |
Returns the Transmission Loss measured in db
References abs(), complex_pressure, and isValid().
Referenced by WossMPropagation::computeGain(), woss::ArrAscResReader::getArrAscFile(), woss::ArrBinResReader::getArrBinFile(), woss::ShdResReader::getShdFile(), and woss::TimeArr::lowerBoundTxLoss().
|
inlinestatic |
Returns the Transmission Loss measured in db
|
inline |
Gets the imaginary part
References complex_pressure.
Referenced by create().
|
inlinevirtual |
Checks the validity of complex pressure provided
References complex_pressure.
Referenced by getTxLossDb(), woss::WossManagerResDb::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), woss::TimeArr::insertValue(), woss::TimeArr::sumValue(), and woss::TimeArr::TimeArr().
|
inline |
complex<double> operator for implicit casting
friend::std::ostream & woss::Pressure::operator<< | ( | ::std::ostream & | os, |
const Pressure & | instance | ||
) |
<< operator
os | left operand ostream reference |
instance | right operand const Pressure reference |
Assignment operator
copy | const reference to a Pressure object to be copied |
References complex_pressure.
|
inline |
Gets the phase (arg) value
References complex_pressure.
Referenced by checkAttenuation().
|
inline |
|
inlinestatic |
|
inline |
Gets the square root of a complex number
References complex_pressure.
Inequality operator
left | left operand const reference |
right | right operand const reference |
Multiplication operator
left | left operand const reference |
right | right operand const reference |
Compound assignment multiplication operator
left | left operand reference |
right | right operand const reference |
Sum operator
left | left operand const reference |
right | right operand const reference |
Compound assignment sum operator
left | left operand reference |
right | right operand const reference |
Subtraction operator
left | left operand const reference |
right | right operand const reference |
Compound assignment subtraction operator
left | left operand reference |
right | right operand const reference |
Division operator
left | left operand const reference |
right | right operand const reference |
Compound assignment division operator
left | left operand reference |
right | right operand const reference |
Equality operator
left | left operand const reference |
right | right operand const reference |
|
protected |
Complex acoustic pressure
Referenced by abs(), checkAttenuation(), getTxLossDb(), imag(), isValid(), operator=(), phase(), Pressure(), Pressure(), real(), and sqrt().
|
staticprotected |
Debug flag
Referenced by checkAttenuation(), and setDebug().