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
OSpectreOctave Class Reference

#include <spectre.h>

Inheritance diagram for OSpectreOctave:
Inheritance graph
[legend]
Collaboration diagram for OSpectreOctave:
Collaboration graph
[legend]

Public Member Functions

 OSpectreOctave ()
 
 OSpectreOctave (bool isValid, TYSpectreType type, TYSpectreEtat etat)
 
 OSpectreOctave (double defaultValue)
 
 OSpectreOctave (const double *valeurs, unsigned nbVal, unsigned decalage)
 
 OSpectreOctave (const OSpectreOctave &other)
 
 OSpectreOctave (const OSpectreAbstract &other)
 Copy constructor from OSpectreAbstract. More...
 
 OSpectreOctave (const OSpectre &other)
 
virtual ~OSpectreOctave ()
 
OSpectreOctaveoperator= (const OSpectreOctave &other)
 operators More...
 
OSpectreAbstractoperator= (const OSpectreAbstract &other) override
 operator= More...
 
bool operator== (const OSpectreOctave &other) const
 
bool operator!= (const OSpectreOctave &other) const
 
double * getTabValReel () override
 Get an array of the real values of the spectrum. More...
 
const double * getTabValReel () const override
 
OSpectreAbstractgetConcreteInstance () const override
 Return an instance of a concrete class of the same type as current. More...
 
void setValue (const double &freq, const double &reel=0.0)
 
- Public Member Functions inherited from OSpectreAbstract
 OSpectreAbstract ()
 Methods. More...
 
 OSpectreAbstract (TYSpectreForm form)
 
 OSpectreAbstract (bool isValid, TYSpectreType type, TYSpectreEtat etat, TYSpectreForm form)
 
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...
 
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 OSpectreOctave getEmptyLinSpectre (const double &valInit=1.0E-20)
 Create a physical quantity spectrum. More...
 
static OTabFreq getTabFreqExact ()
 
static OSpectreOctave pondA ()
 Build a weighted spectrum A. More...
 
static OSpectreOctave getLambda (const double &c)
 
static std::map< double, int > setMapFreqIndice ()
 Build frequency/index map. More...
 
- Static Public Member Functions inherited from OSpectreAbstract
static OSpectreAbstractmakeOctSpect ()
 Make a spectrum in Octave. More...
 

Protected Attributes

double _module [TY_SPECTRE_OCT_NB_ELMT]
 Real values array for module. More...
 
- Protected Attributes inherited from OSpectreAbstract
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 std::map< double, int > _mapFreqIndice = setMapFreqIndice()
 Mapping between frequency and array index. More...
 
static const double _freqNorm [TY_SPECTRE_OCT_NB_ELMT] = {31.5, 63.0, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0}
 Array of center frequencies (Hz) normalized in one-third Octave. More...
 
static const double _AWeighting [TY_SPECTRE_OCT_NB_ELMT] = {-39.5, -26.2, -16.1, -8.6, -3.2, 0.0, 1.2, 1.0, -1.1}
 A weighting for ponderation A computation. More...
 
- Static Protected Attributes inherited from OSpectreAbstract
static double _defaultValue = TY_SPECTRE_DEFAULT_VALUE
 Default value for the spectrum. More...
 

Detailed Description

Define an octave band spectrum

Definition at line 587 of file spectre.h.

Constructor & Destructor Documentation

◆ OSpectreOctave() [1/7]

OSpectreOctave::OSpectreOctave ( )

Definition at line 1422 of file spectre.cpp.

Here is the caller graph for this function:

◆ OSpectreOctave() [2/7]

OSpectreOctave::OSpectreOctave ( bool  isValid,
TYSpectreType  type,
TYSpectreEtat  etat 
)

Definition at line 1430 of file spectre.cpp.

◆ OSpectreOctave() [3/7]

OSpectreOctave::OSpectreOctave ( double  defaultValue)

Definition at line 1439 of file spectre.cpp.

◆ OSpectreOctave() [4/7]

OSpectreOctave::OSpectreOctave ( const double *  valeurs,
unsigned  nbVal,
unsigned  decalage 
)

Definition at line 1447 of file spectre.cpp.

◆ OSpectreOctave() [5/7]

OSpectreOctave::OSpectreOctave ( const OSpectreOctave other)

Definition at line 1463 of file spectre.cpp.

◆ OSpectreOctave() [6/7]

OSpectreOctave::OSpectreOctave ( const OSpectreAbstract other)

Copy constructor from OSpectreAbstract.

Definition at line 1468 of file spectre.cpp.

◆ OSpectreOctave() [7/7]

OSpectreOctave::OSpectreOctave ( const OSpectre other)

Constructor from a OSpectre

Definition at line 1473 of file spectre.cpp.

Here is the call graph for this function:

◆ ~OSpectreOctave()

OSpectreOctave::~OSpectreOctave ( )
virtual

Definition at line 1485 of file spectre.cpp.

Member Function Documentation

◆ getConcreteInstance()

OSpectreAbstract * OSpectreOctave::getConcreteInstance ( ) const
overridevirtual

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

Implements OSpectreAbstract.

Definition at line 1562 of file spectre.cpp.

Here is the call graph for this function:

◆ getEmptyLinSpectre()

OSpectreOctave OSpectreOctave::getEmptyLinSpectre ( const double &  valInit = 1.0E-20)
static

Create a physical quantity spectrum.

Definition at line 1616 of file spectre.cpp.

Here is the caller graph for this function:

◆ getLambda()

OSpectreOctave OSpectreOctave::getLambda ( const double &  c)
static

Return a spectrum representating the wavelength associated to each frequency

Parameters
cWave propagating speed
Returns
An OSpectreOctave

Definition at line 1591 of file spectre.cpp.

Here is the caller graph for this function:

◆ getTabFreqExact()

OTabFreq OSpectreOctave::getTabFreqExact ( )
static

Return the array of exact frequencies. The calling method should free the allocated memory for this array.

Returns
The array of exact frequencies.

Definition at line 1575 of file spectre.cpp.

◆ getTabValReel() [1/2]

const double* OSpectreOctave::getTabValReel ( ) const
inlineoverridevirtual

Implements OSpectreAbstract.

Definition at line 618 of file spectre.h.

◆ getTabValReel() [2/2]

double* OSpectreOctave::getTabValReel ( )
inlineoverridevirtual

Get an array of the real values of the spectrum.

Implements OSpectreAbstract.

Definition at line 613 of file spectre.h.

Here is the caller graph for this function:

◆ operator!=()

bool OSpectreOctave::operator!= ( const OSpectreOctave other) const

Definition at line 1557 of file spectre.cpp.

Here is the call graph for this function:

◆ operator=() [1/2]

OSpectreAbstract & OSpectreOctave::operator= ( const OSpectreAbstract other)
overridevirtual

operator=

Reimplemented from OSpectreAbstract.

Definition at line 1500 of file spectre.cpp.

Here is the call graph for this function:

◆ operator=() [2/2]

OSpectreOctave & OSpectreOctave::operator= ( const OSpectreOctave other)

operators

Definition at line 1487 of file spectre.cpp.

Here is the call graph for this function:

◆ operator==()

bool OSpectreOctave::operator== ( const OSpectreOctave other) const

Definition at line 1538 of file spectre.cpp.

Here is the caller graph for this function:

◆ pondA()

OSpectreOctave OSpectreOctave::pondA ( )
static

Build a weighted spectrum A.

Definition at line 1586 of file spectre.cpp.

◆ setMapFreqIndice()

std::map< double, int > OSpectreOctave::setMapFreqIndice ( )
static

Build frequency/index map.

Definition at line 1604 of file spectre.cpp.

◆ setValue()

void OSpectreOctave::setValue ( const double &  freq,
const double &  reel = 0.0 
)

Set a new value to the frequencies array.

Parameters
freqFrequency to which a new value is given.
reelValue.

Definition at line 1567 of file spectre.cpp.

Member Data Documentation

◆ _AWeighting

const double OSpectreOctave::_AWeighting = {-39.5, -26.2, -16.1, -8.6, -3.2, 0.0, 1.2, 1.0, -1.1}
staticprotected

A weighting for ponderation A computation.

Definition at line 672 of file spectre.h.

◆ _freqNorm

const double OSpectreOctave::_freqNorm = {31.5, 63.0, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0}
staticprotected

Array of center frequencies (Hz) normalized in one-third Octave.

Definition at line 669 of file spectre.h.

◆ _mapFreqIndice

std::map< double, int > OSpectreOctave::_mapFreqIndice = setMapFreqIndice()
staticprotected

Mapping between frequency and array index.

Definition at line 666 of file spectre.h.

◆ _module

double OSpectreOctave::_module[TY_SPECTRE_OCT_NB_ELMT]
protected

Real values array for module.

Definition at line 677 of file spectre.h.


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