Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
OSpectreAbstract Class Referenceabstract

Store acoustic power values for different frequencies. More...

#include <spectre.h>

Inheritance diagram for OSpectreAbstract:
Inheritance graph
[legend]

Public Member Functions

 OSpectreAbstract ()
 Methods. More...
 
 OSpectreAbstract (TYSpectreForm form)
 
 OSpectreAbstract (bool isValid, TYSpectreType type, TYSpectreEtat etat, TYSpectreForm form)
 
virtual OSpectreAbstractoperator= (const OSpectreAbstract &other)
 operator= More...
 
virtual bool operator== (const OSpectreAbstract &other) const
 operator== More...
 
virtual bool operator!= (const OSpectreAbstract &other) const
 operator != More...
 
OSpectreAbstractoperator+ (const double &valeur) const
 Add a constant value to all the spectrum. More...
 
OSpectreAbstractoperator+ (const OSpectreAbstract &spectre) const
 Arithmetic sum of two spectrums in one-third Octave. More...
 
OSpectreAbstractoperator- (const OSpectreAbstract &spectre) const
 Arithmetic subtraction of two spectrums in one-third Octave. More...
 
OSpectreAbstractoperator* (const OSpectreAbstract &spectre) const
 Multiplication by a Spectre spectrum. More...
 
OSpectreAbstractoperator* (const double &coefficient) const
 Multiplication by a double coefficient. More...
 
OSpectreAbstractsumdB (const OSpectreAbstract &spectre) const
 Energetic sum of two spectrums. More...
 
virtual double * getTabValReel ()=0
 Get the array of real values - Pure virtual method. More...
 
virtual const double * getTabValReel () const =0
 
virtual OSpectreAbstractgetConcreteInstance () const =0
 Return an instance of a concrete class of the same type as current. More...
 
void setDefaultValue (const double &valeur=TY_SPECTRE_DEFAULT_VALUE)
 
bool isValid () const
 Check the spectrum validity. Invalidity is caused by: corrupted data, impossible calculation. More...
 
void setValid (const bool &valid=true)
 
TYSpectreType getType () const
 Get the spectrum type. More...
 
void setType (TYSpectreType type)
 Set the spectrum type. More...
 
TYSpectreEtat getEtat () const
 Get the spectrum state. More...
 
const TYSpectreEtat getEtat ()
 
void setEtat (TYSpectreEtat etat)
 Force the spectrum state (to use carefully ...) More...
 
TYSpectreForm getForm () const
 Get the spectrum form. More...
 
void setForm (TYSpectreForm form)
 Force the spectrum state (to use carefully ...) More...
 
unsigned int getNbValues () const
 Number of values in the spectrum. More...
 
void setDefaultValue (double module[], const unsigned int spectreNbElmt=TY_SPECTRE_DEFAULT_NB_ELMT, const double &valeur=TY_SPECTRE_DEFAULT_VALUE)
 
void getRangeValueReal (double *valeurs, const short &nbVal, const short &decalage)
 
OSpectreAbstractsum (const OSpectreAbstract &spectre) const
 Arithmetic sum of two spectrums in one-third Octave. More...
 
OSpectreAbstractsum (const double &value) const
 Arithmetic sum of a spectrum and a double scalar. More...
 
OSpectreAbstractmult (const OSpectreAbstract &spectre) const
 Multiplication of two spectrums. More...
 
OSpectreAbstractmult (const double &coefficient) const
 Multiply this spectrum par a double scalar. More...
 
OSpectreAbstractdiv (const OSpectreAbstract &spectre) const
 Division of two spectrums. More...
 
OSpectreAbstractdiv (const double &coefficient) const
 Division of this spectrum by a double scalar. More...
 
OSpectreAbstractsubst (const OSpectreAbstract &spectre) const
 Arithmetic subtraction of two spectrums in one-third Octave. More...
 
OSpectreAbstractsubst (const double &valeur) const
 Subtract a constant value to this spectrum. More...
 
OSpectreAbstractinvMult (const double &coefficient=1.0) const
 Division of a double constant by this spectrum. More...
 
OSpectreAbstractinv () const
 Division of one by this spectrum. More...
 
OSpectreAbstractpower (const double &puissance) const
 Return a spectrum as this spectrum raised to a double power. More...
 
OSpectreAbstractlog (const double &base=10.0) const
 Compute the log base n of this spectrum (n=10 by default). More...
 
OSpectreAbstractracine () const
 Compute the root square of this spectrum. More...
 
OSpectreAbstractexp (const double coef=1.0)
 Compute e^(coef * spectre) of this spectrum. More...
 
OSpectreAbstractsin () const
 Compute the sin of this spectrum. More...
 
OSpectreAbstractcos () const
 Compute the cos of this spectrum. More...
 
OSpectreAbstractabs () const
 Return the absolute value of this spectrum. More...
 
OSpectreAbstractsqrt () const
 Return the root square of a spectrum. More...
 
double valMax ()
 Return the maximum value of a spectrum. More...
 
OSpectreAbstractseuillage (const double &min=-200.0, const double max=200.0)
 Limit the spectrum values (min and max) More...
 
double sigma ()
 Sum the values of the spectrum. More...
 
const double sigma () const
 
OSpectreAbstracttoDB () const
 Converts to dB. More...
 
OSpectreAbstracttoGPhy () const
 Converts to physical quantity. More...
 
double valGlobDBLin () const
 Compute the global value dB[Lin] of a one-third Octave spectrum. More...
 
double valGlobDBA () const
 Compute the global value dB[A] of a one-third Octave spectrum. More...
 
OSpectreAbstracttoTOct () const
 Converts to one-third Octave. More...
 
OSpectreAbstracttoOct () const
 Converts to Octave. More...
 
OSpectreAbstractround ()
 
virtual void printme () const
 Print the spectrum. More...
 

Static Public Member Functions

static OSpectreAbstractmakeOctSpect ()
 Make a spectrum in Octave. More...
 

Protected Attributes

bool _valid
 Spectrum validity. More...
 
TYSpectreType _type
 Spectrum type. More...
 
TYSpectreEtat _etat
 Spectrum state (physical quantity or dB). More...
 
TYSpectreForm _form
 Representation of the spectrum: one-third Octave, Octave, constant delta f, unstructured. More...
 

Static Protected Attributes

static double _defaultValue = TY_SPECTRE_DEFAULT_VALUE
 Default value for the spectrum. More...
 

Detailed Description

Store acoustic power values for different frequencies.

Author
Projet_Tympan

Definition at line 81 of file spectre.h.

Constructor & Destructor Documentation

◆ OSpectreAbstract() [1/3]

OSpectreAbstract::OSpectreAbstract ( )
explicit

Methods.

Constructors

Definition at line 53 of file spectre.cpp.

◆ OSpectreAbstract() [2/3]

OSpectreAbstract::OSpectreAbstract ( TYSpectreForm  form)
explicit

Definition at line 58 of file spectre.cpp.

◆ OSpectreAbstract() [3/3]

OSpectreAbstract::OSpectreAbstract ( bool  isValid,
TYSpectreType  type,
TYSpectreEtat  etat,
TYSpectreForm  form 
)
explicit

Definition at line 63 of file spectre.cpp.

Member Function Documentation

◆ abs()

OSpectreAbstract & OSpectreAbstract::abs ( ) const

Return the absolute value of this spectrum.

Definition at line 493 of file spectre.cpp.

Here is the call graph for this function:

◆ cos()

OSpectreAbstract & OSpectreAbstract::cos ( ) const

Compute the cos of this spectrum.

Definition at line 478 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ div() [1/2]

OSpectreAbstract & OSpectreAbstract::div ( const double &  coefficient) const

Division of this spectrum by a double scalar.

Definition at line 294 of file spectre.cpp.

Here is the call graph for this function:

◆ div() [2/2]

OSpectreAbstract & OSpectreAbstract::div ( const OSpectreAbstract spectre) const

Division of two spectrums.

Definition at line 273 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exp()

OSpectreAbstract & OSpectreAbstract::exp ( const double  coef = 1.0)

Compute e^(coef * spectre) of this spectrum.

Definition at line 449 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConcreteInstance()

virtual OSpectreAbstract* OSpectreAbstract::getConcreteInstance ( ) const
pure virtual

Return an instance of a concrete class of the same type as current.

Implemented in OSpectreOctave, and OSpectre.

Here is the caller graph for this function:

◆ getEtat() [1/2]

const TYSpectreEtat OSpectreAbstract::getEtat ( )
inline

Definition at line 162 of file spectre.h.

◆ getEtat() [2/2]

TYSpectreEtat OSpectreAbstract::getEtat ( ) const
inline

Get the spectrum state.

Definition at line 158 of file spectre.h.

Here is the caller graph for this function:

◆ getForm()

TYSpectreForm OSpectreAbstract::getForm ( ) const
inline

Get the spectrum form.

Definition at line 174 of file spectre.h.

Here is the caller graph for this function:

◆ getNbValues()

unsigned int OSpectreAbstract::getNbValues ( ) const

Number of values in the spectrum.

Definition at line 182 of file spectre.cpp.

Here is the caller graph for this function:

◆ getRangeValueReal()

void OSpectreAbstract::getRangeValueReal ( double *  valeurs,
const short &  nbVal,
const short &  decalage 
)

Get an interval of real values from the frequencies/complex array

Parameters
[out]valeursValues array. It should be allocated before.
[in]nbValNumber of values to retrieve from the spectrum
[in]decalageIndex of the first value to retrieve

Definition at line 211 of file spectre.cpp.

Here is the call graph for this function:

◆ getTabValReel() [1/2]

virtual const double* OSpectreAbstract::getTabValReel ( ) const
pure virtual

Implemented in OSpectreOctave, and OSpectre.

◆ getTabValReel() [2/2]

virtual double* OSpectreAbstract::getTabValReel ( )
pure virtual

Get the array of real values - Pure virtual method.

Implemented in OSpectreOctave, and OSpectre.

Here is the caller graph for this function:

◆ getType()

TYSpectreType OSpectreAbstract::getType ( ) const
inline

Get the spectrum type.

Definition at line 147 of file spectre.h.

Here is the caller graph for this function:

◆ inv()

OSpectreAbstract & OSpectreAbstract::inv ( ) const

Division of one by this spectrum.

Definition at line 367 of file spectre.cpp.

Here is the call graph for this function:

◆ invMult()

OSpectreAbstract & OSpectreAbstract::invMult ( const double &  coefficient = 1.0) const

Division of a double constant by this spectrum.

Definition at line 345 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValid()

bool OSpectreAbstract::isValid ( ) const
inline

Check the spectrum validity. Invalidity is caused by: corrupted data, impossible calculation.

Returns
Spectrum state (valid = true / non valid = false).

Definition at line 133 of file spectre.h.

Here is the caller graph for this function:

◆ log()

OSpectreAbstract & OSpectreAbstract::log ( const double &  base = 10.0) const

Compute the log base n of this spectrum (n=10 by default).

Definition at line 404 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeOctSpect()

OSpectreAbstract & OSpectreAbstract::makeOctSpect ( )
static

Make a spectrum in Octave.

Definition at line 832 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mult() [1/2]

OSpectreAbstract & OSpectreAbstract::mult ( const double &  coefficient) const

Multiply this spectrum par a double scalar.

Definition at line 257 of file spectre.cpp.

Here is the call graph for this function:

◆ mult() [2/2]

OSpectreAbstract & OSpectreAbstract::mult ( const OSpectreAbstract spectre) const

Multiplication of two spectrums.

Definition at line 243 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

bool OSpectreAbstract::operator!= ( const OSpectreAbstract other) const
virtual

operator !=

Definition at line 104 of file spectre.cpp.

Here is the call graph for this function:

◆ operator*() [1/2]

OSpectreAbstract & OSpectreAbstract::operator* ( const double &  coefficient) const

Multiplication by a double coefficient.

Definition at line 158 of file spectre.cpp.

Here is the call graph for this function:

◆ operator*() [2/2]

OSpectreAbstract & OSpectreAbstract::operator* ( const OSpectreAbstract spectre) const

Multiplication by a Spectre spectrum.

Definition at line 146 of file spectre.cpp.

Here is the call graph for this function:

◆ operator+() [1/2]

OSpectreAbstract & OSpectreAbstract::operator+ ( const double &  valeur) const

Add a constant value to all the spectrum.

Definition at line 109 of file spectre.cpp.

Here is the call graph for this function:

◆ operator+() [2/2]

OSpectreAbstract & OSpectreAbstract::operator+ ( const OSpectreAbstract spectre) const

Arithmetic sum of two spectrums in one-third Octave.

Definition at line 122 of file spectre.cpp.

Here is the call graph for this function:

◆ operator-()

OSpectreAbstract & OSpectreAbstract::operator- ( const OSpectreAbstract spectre) const

Arithmetic subtraction of two spectrums in one-third Octave.

Definition at line 134 of file spectre.cpp.

Here is the call graph for this function:

◆ operator=()

OSpectreAbstract & OSpectreAbstract::operator= ( const OSpectreAbstract other)
virtual

operator=

Reimplemented in OSpectreOctave, OSpectreComplex, OSpectre, and TYSpectre.

Definition at line 68 of file spectre.cpp.

Here is the caller graph for this function:

◆ operator==()

bool OSpectreAbstract::operator== ( const OSpectreAbstract other) const
virtual

operator==

Definition at line 80 of file spectre.cpp.

Here is the caller graph for this function:

◆ power()

OSpectreAbstract & OSpectreAbstract::power ( const double &  puissance) const

Return a spectrum as this spectrum raised to a double power.

Definition at line 389 of file spectre.cpp.

Here is the call graph for this function:

◆ printme()

void OSpectreAbstract::printme ( ) const
virtual

Print the spectrum.

Definition at line 822 of file spectre.cpp.

Here is the call graph for this function:

◆ racine()

OSpectreAbstract & OSpectreAbstract::racine ( ) const

Compute the root square of this spectrum.

Definition at line 427 of file spectre.cpp.

Here is the call graph for this function:

◆ round()

OSpectreAbstract & OSpectreAbstract::round ( )

Rounds the spectrum values to two digits.

This method is used to round Lw spectrum values to avoid precision issues when testing 17534-3 conformity.

Definition at line 573 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDefaultValue() [1/2]

void OSpectreAbstract::setDefaultValue ( const double &  valeur = TY_SPECTRE_DEFAULT_VALUE)

Initialize a spectrum to a default value.

Parameters
valeurValue by default.

Definition at line 197 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDefaultValue() [2/2]

void OSpectreAbstract::setDefaultValue ( double  module[],
const unsigned int  spectreNbElmt = TY_SPECTRE_DEFAULT_NB_ELMT,
const double &  valeur = TY_SPECTRE_DEFAULT_VALUE 
)

Definition at line 202 of file spectre.cpp.

◆ setEtat()

void OSpectreAbstract::setEtat ( TYSpectreEtat  etat)
inline

Force the spectrum state (to use carefully ...)

Definition at line 168 of file spectre.h.

Here is the caller graph for this function:

◆ setForm()

void OSpectreAbstract::setForm ( TYSpectreForm  form)
inline

Force the spectrum state (to use carefully ...)

Definition at line 180 of file spectre.h.

◆ setType()

void OSpectreAbstract::setType ( TYSpectreType  type)
inline

Set the spectrum type.

Definition at line 152 of file spectre.h.

Here is the caller graph for this function:

◆ setValid()

void OSpectreAbstract::setValid ( const bool &  valid = true)
inline

Force the validity state of the spectrum.

Definition at line 141 of file spectre.h.

Here is the caller graph for this function:

◆ seuillage()

OSpectreAbstract & OSpectreAbstract::seuillage ( const double &  min = -200.0,
const double  max = 200.0 
)

Limit the spectrum values (min and max)

Definition at line 532 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sigma() [1/2]

double OSpectreAbstract::sigma ( )

Sum the values of the spectrum.

Definition at line 553 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sigma() [2/2]

const double OSpectreAbstract::sigma ( ) const

Definition at line 563 of file spectre.cpp.

Here is the call graph for this function:

◆ sin()

OSpectreAbstract & OSpectreAbstract::sin ( ) const

Compute the sin of this spectrum.

Definition at line 464 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sqrt()

OSpectreAbstract & OSpectreAbstract::sqrt ( ) const

Return the root square of a spectrum.

Definition at line 507 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subst() [1/2]

OSpectreAbstract & OSpectreAbstract::subst ( const double &  valeur) const

Subtract a constant value to this spectrum.

Definition at line 330 of file spectre.cpp.

Here is the call graph for this function:

◆ subst() [2/2]

OSpectreAbstract & OSpectreAbstract::subst ( const OSpectreAbstract spectre) const

Arithmetic subtraction of two spectrums in one-third Octave.

Definition at line 316 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sum() [1/2]

OSpectreAbstract & OSpectreAbstract::sum ( const double &  value) const

Arithmetic sum of a spectrum and a double scalar.

Definition at line 234 of file spectre.cpp.

Here is the call graph for this function:

◆ sum() [2/2]

OSpectreAbstract & OSpectreAbstract::sum ( const OSpectreAbstract spectre) const

Arithmetic sum of two spectrums in one-third Octave.

Definition at line 219 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sumdB()

OSpectreAbstract & OSpectreAbstract::sumdB ( const OSpectreAbstract spectre) const

Energetic sum of two spectrums.

Definition at line 171 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toDB()

OSpectreAbstract & OSpectreAbstract::toDB ( ) const

Converts to dB.

Definition at line 590 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toGPhy()

OSpectreAbstract & OSpectreAbstract::toGPhy ( ) const

Converts to physical quantity.

Definition at line 634 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toOct()

OSpectreAbstract & OSpectreAbstract::toOct ( ) const

Converts to Octave.

Definition at line 768 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toTOct()

OSpectreAbstract & OSpectreAbstract::toTOct ( ) const

Converts to one-third Octave.

Definition at line 701 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valGlobDBA()

double OSpectreAbstract::valGlobDBA ( ) const

Compute the global value dB[A] of a one-third Octave spectrum.

Definition at line 683 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valGlobDBLin()

double OSpectreAbstract::valGlobDBLin ( ) const

Compute the global value dB[Lin] of a one-third Octave spectrum.

Definition at line 671 of file spectre.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valMax()

double OSpectreAbstract::valMax ( )

Return the maximum value of a spectrum.

Definition at line 522 of file spectre.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _defaultValue

double OSpectreAbstract::_defaultValue = TY_SPECTRE_DEFAULT_VALUE
staticprotected

Default value for the spectrum.

Definition at line 307 of file spectre.h.

◆ _etat

TYSpectreEtat OSpectreAbstract::_etat
protected

Spectrum state (physical quantity or dB).

Definition at line 318 of file spectre.h.

◆ _form

TYSpectreForm OSpectreAbstract::_form
protected

Representation of the spectrum: one-third Octave, Octave, constant delta f, unstructured.

Definition at line 321 of file spectre.h.

◆ _type

TYSpectreType OSpectreAbstract::_type
protected

Spectrum type.

Definition at line 315 of file spectre.h.

◆ _valid

bool OSpectreAbstract::_valid
protected

Spectrum validity.

Definition at line 312 of file spectre.h.


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