Commit 92715358 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen Committed by Lucas Moesch

Applying ITABase namespaces

parent 6b66085d
...@@ -35,7 +35,7 @@ const float DEF_CENTER_FREQUENCY_THIRDS[ 31 ] = ...@@ -35,7 +35,7 @@ const float DEF_CENTER_FREQUENCY_THIRDS[ 31 ] =
1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000, 6300, 8000, 10000, 12500, 16000, 20000 1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000, 6300, 8000, 10000, 12500, 16000, 20000
}; };
void GetAirAbsorptionMagnitudes( CITAThirdOctaveFactorMagnitudeSpectrum& oMags, double dDistance, double dTemperature, double dPressure, double dHumidity ) void GetAirAbsorptionMagnitudes( ITABase::CThirdOctaveFactorMagnitudeSpectrum& oMags, double dDistance, double dTemperature, double dPressure, double dHumidity )
{ {
// ISO 9613-1 Acoustics - Attenuation of sound during propagation outdoors // ISO 9613-1 Acoustics - Attenuation of sound during propagation outdoors
...@@ -108,7 +108,7 @@ void GetAirAbsorptionMagnitudes( CITAThirdOctaveFactorMagnitudeSpectrum& oMags, ...@@ -108,7 +108,7 @@ void GetAirAbsorptionMagnitudes( CITAThirdOctaveFactorMagnitudeSpectrum& oMags,
} }
void CalculateAirAbsorptionAttenuation( CITAThirdOctaveFactorMagnitudeSpectrum& oAirAbsMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity ) void CalculateAirAbsorptionAttenuation( ITABase::CThirdOctaveFactorMagnitudeSpectrum& oAirAbsMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity )
{ {
std::vector< float > vfGains( oAirAbsMags.GetNumBands() ); std::vector< float > vfGains( oAirAbsMags.GetNumBands() );
GetAirAbsorptionMagnitudesThirdOctave( &vfGains[ 0 ], dDistance, dTemperature, dStaticPressure, dHumidity ); GetAirAbsorptionMagnitudesThirdOctave( &vfGains[ 0 ], dDistance, dTemperature, dStaticPressure, dHumidity );
......
...@@ -43,7 +43,7 @@ void GetAirAbsorptionAttenuationThirdOctaveDecibel( float* pfAirAbsCoeffs, // A ...@@ -43,7 +43,7 @@ void GetAirAbsorptionAttenuationThirdOctaveDecibel( float* pfAirAbsCoeffs, // A
* \param fStaticPressure Statischer Luftdruck [Pa] * \param fStaticPressure Statischer Luftdruck [Pa]
* \param fHumidity Luftfeuchtigkeit [%] * \param fHumidity Luftfeuchtigkeit [%]
*/ */
void CalculateAirAbsorptionAttenuation( CITAThirdOctaveFactorMagnitudeSpectrum& oAirAbsMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity ); void CalculateAirAbsorptionAttenuation( ITABase::CThirdOctaveFactorMagnitudeSpectrum& oAirAbsMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity );
//! Berechnung der Luftschall-Dmpfung in Terzen als Faktoren (von Jonas implementiert) //! Berechnung der Luftschall-Dmpfung in Terzen als Faktoren (von Jonas implementiert)
/** /**
...@@ -57,6 +57,6 @@ void CalculateAirAbsorptionAttenuation( CITAThirdOctaveFactorMagnitudeSpectrum& ...@@ -57,6 +57,6 @@ void CalculateAirAbsorptionAttenuation( CITAThirdOctaveFactorMagnitudeSpectrum&
* \param fStaticPressure Statischer Luftdruck [Pa] * \param fStaticPressure Statischer Luftdruck [Pa]
* \param fHumidity Luftfeuchtigkeit [%] * \param fHumidity Luftfeuchtigkeit [%]
*/ */
void GetAirAbsorptionMagnitudes( CITAThirdOctaveFactorMagnitudeSpectrum& oMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity ); void GetAirAbsorptionMagnitudes( ITABase::CThirdOctaveFactorMagnitudeSpectrum& oMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity );
#endif // IW_VACORE_ATMOSPHERE #endif // IW_VACORE_ATMOSPHERE
...@@ -989,26 +989,31 @@ const float VA_TEMPORALNOISE_DATA[ VA_TEMPORALNOISE_NUM_BANDS ][ VA_TEMPORALNOIS ...@@ -989,26 +989,31 @@ const float VA_TEMPORALNOISE_DATA[ VA_TEMPORALNOISE_NUM_BANDS ][ VA_TEMPORALNOIS
0.3668F, 0.2105F, 0.0884F, -0.0217F, -0.1162F, -0.2177F, -0.3251F, -0.3734F, -0.3437F, -0.2901F } 0.3668F, 0.2105F, 0.0884F, -0.0217F, -0.1162F, -0.2177F, -0.3251F, -0.3734F, -0.3437F, -0.2901F }
}; };
class CVAAtmosphericTemporalVariantions { class CVAAtmosphericTemporalVariantions
{
public: public:
CVAAtmosphericTemporalVariantions() { inline CVAAtmosphericTemporalVariantions()
{
m_fOffsetDecibel = 4.0; m_fOffsetDecibel = 4.0;
m_fStrengthDecibel = 3.0; m_fStrengthDecibel = 3.0;
m_iCursor = 0; m_iCursor = 0;
} };
double getSamplerate() const { return VA_TEMPORALNOISE_SAMPLINGRATE; } inline double getSamplerate() const
{
return VA_TEMPORALNOISE_SAMPLINGRATE;
};
inline void getNoiseMagnitudes( CITAThirdOctaveMagnitudeSpectrum& oDest ) inline void getNoiseMagnitudes( ITABase::CThirdOctaveMagnitudeSpectrum& oDest )
{ {
assert( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() == VA_TEMPORALNOISE_NUM_BANDS ); assert( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() == VA_TEMPORALNOISE_NUM_BANDS );
for( int i = 0; i < VA_TEMPORALNOISE_NUM_BANDS; i++ ) { for( int i = 0; i < VA_TEMPORALNOISE_NUM_BANDS; i++ ) {
oDest[ i ] = ( float ) db10_to_ratio( m_fStrengthDecibel*VA_TEMPORALNOISE_DATA[ i ][ m_iCursor ] ); oDest[ i ] = ( float ) db10_to_ratio( m_fStrengthDecibel*VA_TEMPORALNOISE_DATA[ i ][ m_iCursor ] );
} }
m_iCursor = ( ++m_iCursor ) % VA_TEMPORALNOISE_NUM_SAMPLES; m_iCursor = ( ++m_iCursor ) % VA_TEMPORALNOISE_NUM_SAMPLES;
} };
private: private:
float m_fOffsetDecibel; float m_fOffsetDecibel;
......
...@@ -1236,9 +1236,9 @@ void CVAAFFSoundPath::UpdateDir( bool bDIRAuraModeEnabled ) ...@@ -1236,9 +1236,9 @@ void CVAAFFSoundPath::UpdateDir( bool bDIRAuraModeEnabled )
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord ); pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord );
if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord ) if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord )
{ {
std::vector< float > vfMags( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() ); std::vector< float > vfMags( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] ); pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes; ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfMags ); oDirectivityMagnitudes.SetMagnitudes( vfMags );
pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes ); pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
} }
......
...@@ -135,17 +135,17 @@ public: ...@@ -135,17 +135,17 @@ public:
CSoundSourceDirectivityState oDirectivityStateCur; //!< Aktueller Status der Richtcharakteristik CSoundSourceDirectivityState oDirectivityStateCur; //!< Aktueller Status der Richtcharakteristik
CSoundSourceDirectivityState oDirectivityStateNew; //!< Neuer Status der Richtcharakteristik CSoundSourceDirectivityState oDirectivityStateNew; //!< Neuer Status der Richtcharakteristik
CITAThirdOctaveGainMagnitudeSpectrum oSoundSourceDirectivityMagnitudes; //!< Magnitudes for directivity ITABase::CThirdOctaveGainMagnitudeSpectrum oSoundSourceDirectivityMagnitudes; //!< Magnitudes for directivity
CVAAtmosphericTemporalVariantions oATVGenerator; //!< Generator for temporal variation magnitudes of the time signal by medium shifts during propagation CVAAtmosphericTemporalVariantions oATVGenerator; //!< Generator for temporal variation magnitudes of the time signal by medium shifts during propagation
CITAThirdOctaveGainMagnitudeSpectrum oTemporalVariationMagnitudes; //!< Magnitudes for temporal variation of the time signal by medium shifts during propagation ITABase::CThirdOctaveGainMagnitudeSpectrum oTemporalVariationMagnitudes; //!< Magnitudes for temporal variation of the time signal by medium shifts during propagation
CITAThirdOctaveGainMagnitudeSpectrum oAirAttenuationMagnitudes; //!< Magnitudes for air attenuation (damping) ITABase::CThirdOctaveGainMagnitudeSpectrum oAirAttenuationMagnitudes; //!< Magnitudes for air attenuation (damping)
CITAThirdOctaveGainMagnitudeSpectrum oGroundReflectionMagnitudes; //!< Ground reflection parameters (only for reflection paths) ITABase::CThirdOctaveGainMagnitudeSpectrum oGroundReflectionMagnitudes; //!< Ground reflection parameters (only for reflection paths)
CITAThirdOctaveFilterbank* pThirdOctaveFilterBank; //!< DSP-Element zur Filterung von Third-Octave Datenstzen der Richtcharakteristik CITAThirdOctaveFilterbank* pThirdOctaveFilterBank; //!< DSP-Element zur Filterung von Third-Octave Datenstzen der Richtcharakteristik
CITAThirdOctaveGainMagnitudeSpectrum oThirdOctaveFilterMagnitudes; //!< DSP magnitudes (third octave band resolution) ITABase::CThirdOctaveGainMagnitudeSpectrum oThirdOctaveFilterMagnitudes; //!< DSP magnitudes (third octave band resolution)
CSoundReceiverDirectivityState oSoundReceiverDirectivityStateCur; //!< Aktueller Status der HRIR CSoundReceiverDirectivityState oSoundReceiverDirectivityStateCur; //!< Aktueller Status der HRIR
CSoundReceiverDirectivityState oSoundReceiverDirectivityStateNew; //!< Neuer Status der HRIR CSoundReceiverDirectivityState oSoundReceiverDirectivityStateNew; //!< Neuer Status der HRIR
...@@ -1344,10 +1344,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity() ...@@ -1344,10 +1344,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oDirSoundPath.oRelations.dAzimuthS2L ), float( oDirSoundPath.oRelations.dElevationS2L ), oDirSoundPath.oDirectivityStateNew.iRecord ); pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oDirSoundPath.oRelations.dAzimuthS2L ), float( oDirSoundPath.oRelations.dElevationS2L ), oDirSoundPath.oDirectivityStateNew.iRecord );
if( oDirSoundPath.oDirectivityStateCur.iRecord != oDirSoundPath.oDirectivityStateNew.iRecord ) if( oDirSoundPath.oDirectivityStateCur.iRecord != oDirSoundPath.oDirectivityStateNew.iRecord )
{ {
std::vector< float > vfGains( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() ); std::vector< float > vfGains( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] ); pDirectivityDataNew->getMagnitudes( oDirSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes; ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfGains ); oDirectivityMagnitudes.SetMagnitudes( vfGains );
oDirSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes ); oDirSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
} }
...@@ -1379,10 +1379,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity() ...@@ -1379,10 +1379,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRefSoundPath.oRelations.dAzimuthS2L ), float( oRefSoundPath.oRelations.dElevationS2L ), oRefSoundPath.oDirectivityStateNew.iRecord ); pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRefSoundPath.oRelations.dAzimuthS2L ), float( oRefSoundPath.oRelations.dElevationS2L ), oRefSoundPath.oDirectivityStateNew.iRecord );
if( oRefSoundPath.oDirectivityStateCur.iRecord != oRefSoundPath.oDirectivityStateNew.iRecord ) if( oRefSoundPath.oDirectivityStateCur.iRecord != oRefSoundPath.oDirectivityStateNew.iRecord )
{ {
std::vector< float > vfGains( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() ); std::vector< float > vfGains( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oRefSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] ); pDirectivityDataNew->getMagnitudes( oRefSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes; ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfGains ); oDirectivityMagnitudes.SetMagnitudes( vfGains );
oRefSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes ); oRefSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
} }
...@@ -1603,7 +1603,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons ...@@ -1603,7 +1603,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "directivity_third_octaves" ) ) if( oUpdate.HasKey( "directivity_third_octaves" ) )
{ {
const CVAStruct& oFilterUpdate( oUpdate[ "directivity_third_octaves" ] ); const CVAStruct& oFilterUpdate( oUpdate[ "directivity_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oSoundSourceDirectivityMagnitudes ); ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oSoundSourceDirectivityMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ ) for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{ {
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) ); std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
...@@ -1615,7 +1615,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons ...@@ -1615,7 +1615,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "air_attenuation_third_octaves" ) ) if( oUpdate.HasKey( "air_attenuation_third_octaves" ) )
{ {
const CVAStruct& oFilterUpdate( oUpdate[ "air_attenuation_third_octaves" ] ); const CVAStruct& oFilterUpdate( oUpdate[ "air_attenuation_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oAirAttenuationMagnitudes ); ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oAirAttenuationMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ ) for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{ {
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) ); std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
...@@ -1627,7 +1627,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons ...@@ -1627,7 +1627,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "temporal_variation_third_octaves" ) ) if( oUpdate.HasKey( "temporal_variation_third_octaves" ) )
{ {
const CVAStruct& oFilterUpdate( oUpdate[ "temporal_variation_third_octaves" ] ); const CVAStruct& oFilterUpdate( oUpdate[ "temporal_variation_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oTemporalVariationMagnitudes ); ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oTemporalVariationMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ ) for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{ {
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) ); std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
...@@ -1639,7 +1639,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons ...@@ -1639,7 +1639,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "ground_reflection_third_octaves" ) ) if( oUpdate.HasKey( "ground_reflection_third_octaves" ) )
{ {
const CVAStruct& oFilterUpdate( oUpdate[ "ground_reflection_third_octaves" ] ); const CVAStruct& oFilterUpdate( oUpdate[ "ground_reflection_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oGroundReflectionMagnitudes ); ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oGroundReflectionMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ ) for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{ {
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) ); std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......
...@@ -1225,9 +1225,9 @@ void CVABFFSoundPath::UpdateDir( bool bDIRAuraModeEnabled ) ...@@ -1225,9 +1225,9 @@ void CVABFFSoundPath::UpdateDir( bool bDIRAuraModeEnabled )
pDirectivityDataNew->GetDAFFContent()->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord ); pDirectivityDataNew->GetDAFFContent()->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord );
if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord ) if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord )
{ {
std::vector< float > vfMags( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() ); std::vector< float > vfMags( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->GetDAFFContent()->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] ); pDirectivityDataNew->GetDAFFContent()->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes; ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfMags ); oDirectivityMagnitudes.SetMagnitudes( vfMags );
pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes ); pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
} }
......
...@@ -161,7 +161,7 @@ protected: ...@@ -161,7 +161,7 @@ protected:
pData = nullptr; pData = nullptr;
CVABasicMotionModel::Config oDefaultConfig; CVABasicMotionModel::Config oDefaultConfig;
oDefaultConfig.bLogEstimatedOutputEnabled = oConf.bMotionModelLogEstimatedEnabled;; oDefaultConfig.bLogEstimatedOutputEnabled = oConf.bMotionModelLogEstimatedEnabled;
oDefaultConfig.bLogInputEnabled = oConf.bMotionModelLogInputEnabled; oDefaultConfig.bLogInputEnabled = oConf.bMotionModelLogInputEnabled;
oDefaultConfig.dWindowDelay = oConf.dMotionModelWindowDelay; oDefaultConfig.dWindowDelay = oConf.dMotionModelWindowDelay;
oDefaultConfig.dWindowSize = oConf.dMotionModelWindowSize; oDefaultConfig.dWindowSize = oConf.dMotionModelWindowSize;
......
...@@ -577,10 +577,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity() ...@@ -577,10 +577,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oDirSoundPath.oRelations.dAzimuthS2L ), float( oDirSoundPath.oRelations.dElevationS2L ), oDirSoundPath.oDirectivityStateNew.iRecord ); pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oDirSoundPath.oRelations.dAzimuthS2L ), float( oDirSoundPath.oRelations.dElevationS2L ), oDirSoundPath.oDirectivityStateNew.iRecord );
if( oDirSoundPath.oDirectivityStateCur.iRecord != oDirSoundPath.oDirectivityStateNew.iRecord ) if( oDirSoundPath.oDirectivityStateCur.iRecord != oDirSoundPath.oDirectivityStateNew.iRecord )
{ {
std::vector< float > vfGains( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() ); std::vector< float > vfGains( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] ); pDirectivityDataNew->getMagnitudes( oDirSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes; ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfGains ); oDirectivityMagnitudes.SetMagnitudes( vfGains );
oDirSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes ); oDirSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
} }
...@@ -612,10 +612,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity() ...@@ -612,10 +612,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRefSoundPath.oRelations.dAzimuthS2L ), float( oRefSoundPath.oRelations.dElevationS2L ), oRefSoundPath.oDirectivityStateNew.iRecord ); pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRefSoundPath.oRelations.dAzimuthS2L ), float( oRefSoundPath.oRelations.dElevationS2L ), oRefSoundPath.oDirectivityStateNew.iRecord );
if( oRefSoundPath.oDirectivityStateCur.iRecord != oRefSoundPath.oDirectivityStateNew.iRecord ) if( oRefSoundPath.oDirectivityStateCur.iRecord != oRefSoundPath.oDirectivityStateNew.iRecord )
{ {
std::vector< float > vfGains( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() ); std::vector< float > vfGains( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oRefSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] ); pDirectivityDataNew->getMagnitudes( oRefSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes; ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfGains ); oDirectivityMagnitudes.SetMagnitudes( vfGains );
oRefSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes ); oRefSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
} }
...@@ -836,7 +836,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons ...@@ -836,7 +836,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "directivity_third_octaves" ) ) if( oUpdate.HasKey( "directivity_third_octaves" ) )
{ {
const CVAStruct& oFilterUpdate( oUpdate[ "directivity_third_octaves" ] ); const CVAStruct& oFilterUpdate( oUpdate[ "directivity_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oSoundSourceDirectivityMagnitudes ); ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oSoundSourceDirectivityMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ ) for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{ {
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) ); std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
...@@ -848,7 +848,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons ...@@ -848,7 +848,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "air_attenuation_third_octaves" ) ) if( oUpdate.HasKey( "air_attenuation_third_octaves" ) )
{ {
const CVAStruct& oFilterUpdate( oUpdate[ "air_attenuation_third_octaves" ] ); const CVAStruct& oFilterUpdate( oUpdate[ "air_attenuation_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oAirAttenuationMagnitudes ); ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oAirAttenuationMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ ) for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{ {
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) ); std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
...@@ -860,7 +860,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons ...@@ -860,7 +860,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "temporal_variation_third_octaves" ) ) if( oUpdate.HasKey( "temporal_variation_third_octaves" ) )
{ {
const CVAStruct& oFilterUpdate( oUpdate[ "temporal_variation_third_octaves" ] ); const CVAStruct& oFilterUpdate( oUpdate[ "temporal_variation_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oTemporalVariationMagnitudes ); ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oTemporalVariationMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ ) for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{ {
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) ); std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
...@@ -872,7 +872,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons ...@@ -872,7 +872,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "ground_reflection_third_octaves" ) ) if( oUpdate.HasKey( "ground_reflection_third_octaves" ) )
{ {
const CVAStruct& oFilterUpdate( oUpdate[ "ground_reflection_third_octaves" ] ); const CVAStruct& oFilterUpdate( oUpdate[ "ground_reflection_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oGroundReflectionMagnitudes ); ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oGroundReflectionMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ ) for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{ {
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) ); std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......
...@@ -475,9 +475,9 @@ public: ...@@ -475,9 +475,9 @@ public:
HRIRState oHRIRStateCur; //!< Aktueller Status der HRIR HRIRState oHRIRStateCur; //!< Aktueller Status der HRIR
HRIRState oHRIRStateNew; //!< Neuer Status der HRIR HRIRState oHRIRStateNew; //!< Neuer Status der HRIR
CITAThirdOctaveGainMagnitudeSpectrum oMagsSumCur; //!< Aktuelle Zusammensetzung des zusammengesetzten TO-Datensatzes (DIR, AA) ITABase::CThirdOctaveGainMagnitudeSpectrum oMagsSumCur; //!< Aktuelle Zusammensetzung des zusammengesetzten TO-Datensatzes (DIR, AA)
CITAThirdOctaveGainMagnitudeSpectrum oAirAbsMags; //!< Aktualle Zusammensetzung des TO-Datensatzes fr Luftschallabsorption ITABase::CThirdOctaveGainMagnitudeSpectrum oAirAbsMags; //!< Aktualle Zusammensetzung des TO-Datensatzes fr Luftschallabsorption
CITAThirdOctaveGainMagnitudeSpectrum oDirMags; //!< Aktualle Zusammensetzung des TO-Datensatzes fr Luftschallabsorption ITABase::CThirdOctaveGainMagnitudeSpectrum oDirMags; //!< Aktualle Zusammensetzung des TO-Datensatzes fr Luftschallabsorption
unsigned long int uiID; //!< Unique Identifier fr diesen Task unsigned long int uiID; //!< Unique Identifier fr diesen Task
...@@ -658,7 +658,7 @@ void ComplexSoundPath::UpdateDirectSound( const bool bDirectSoundAudible ) ...@@ -658,7 +658,7 @@ void ComplexSoundPath::UpdateDirectSound( const bool bDirectSoundAudible )
// Neue Luftschallabsorption Mags holen (oAirAbsMags) // Neue Luftschallabsorption Mags holen (oAirAbsMags)
UpdateAirAbsorption(); UpdateAirAbsorption();
CITAThirdOctaveGainMagnitudeSpectrum oMagsSumNew; ITABase::CThirdOctaveGainMagnitudeSpectrum oMagsSumNew;
oMagsSumNew.SetIdentity(); oMagsSumNew.SetIdentity();
if( iPathAuralizationMode & IVAInterface::VA_AURAMODE_SOURCE_DIRECTIVITY ) if( iPathAuralizationMode & IVAInterface::VA_AURAMODE_SOURCE_DIRECTIVITY )
...@@ -2253,7 +2253,7 @@ int CVARoomAcousticsAudioRenderer::PostTaskDiscarded( IRavenSimulationSchedulerI ...@@ -2253,7 +2253,7 @@ int CVARoomAcousticsAudioRenderer::PostTaskDiscarded( IRavenSimulationSchedulerI
} }
} }
void CVARoomAcousticsAudioRenderer::GenerateIRFromTOMags( const CITAThirdOctaveGainMagnitudeSpectrum& oMags, ITASampleBuffer& sbFilter ) void CVARoomAcousticsAudioRenderer::GenerateIRFromTOMags( const ITABase::CThirdOctaveGainMagnitudeSpectrum& oMags, ITASampleBuffer& sbFilter )
{ {
float* pfData = sbFilter.data(); float* pfData = sbFilter.data();
m_csFilterGenerator.enter(); m_csFilterGenerator.enter();
......
...@@ -165,7 +165,7 @@ public: ...@@ -165,7 +165,7 @@ public:
* Die lnge der Impulsantwort entspricht der Lnge des ITASampleFrame. * Die lnge der Impulsantwort entspricht der Lnge des ITASampleFrame.
* \note Reentrant (blocking wait) * \note Reentrant (blocking wait)
*/ */
void GenerateIRFromTOMags( const CITAThirdOctaveGainMagnitudeSpectrum& oMags, ITASampleBuffer& sbFilter ); void GenerateIRFromTOMags( const ITABase::CThirdOctaveGainMagnitudeSpectrum& oMags, ITASampleBuffer& sbFilter );
//! Gibt die Schallmediumsgeschwindigkeit zurck [m/s] //! Gibt die Schallmediumsgeschwindigkeit zurck [m/s]
float GetSpeedOfSound() const; float GetSpeedOfSound() const;
......
...@@ -1207,7 +1207,7 @@ void CVAPFFSoundPath::UpdateSoundSourceDirectivity( const bool bDIRAuraModeEnabl ...@@ -1207,7 +1207,7 @@ void CVAPFFSoundPath::UpdateSoundSourceDirectivity( const bool bDIRAuraModeEnabl
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord ); pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord );
if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord ) if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord )
{ {
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes; ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
std::vector< float > vfMags( oDirectivityMagnitudes.GetNumBands() ); std::vector< float > vfMags( oDirectivityMagnitudes.GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] ); pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] );
oDirectivityMagnitudes.SetMagnitudes( vfMags ); oDirectivityMagnitudes.SetMagnitudes( vfMags );
......
...@@ -1298,10 +1298,10 @@ void CVAPTHASoundPath::UpdateDir( bool bDIRAuraModeEnabled ) ...@@ -1298,10 +1298,10 @@ void CVAPTHASoundPath::UpdateDir( bool bDIRAuraModeEnabled )
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord ); pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord );
if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord ) if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord )
{ {
std::vector< float > vfMags( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() ); std::vector< float > vfMags( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] ); pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes; ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfMags ); oDirectivityMagnitudes.SetMagnitudes( vfMags );
pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes ); pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
} }
......
...@@ -121,43 +121,15 @@ CVAObjectInfo CVAHeadphonesReproduction::GetObjectInfo() const ...@@ -121,43 +121,15 @@ CVAObjectInfo CVAHeadphonesReproduction::GetObjectInfo() const
CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs ) CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs )
{ {
CVAStruct oReturn; SetParameters( oArgs );
return GetParameters( oArgs );
}
void CVAHeadphonesReproduction::SetParameters( const CVAStruct& oArgs )
{
const CVAStructValue* pStruct; const CVAStructValue* pStruct;
// Commands: print, get, set if( ( pStruct = oArgs.GetValue( "HpIRInvFile" ) ) != nullptr )
if( ( pStruct = oArgs.GetValue( "PRINT" ) ) != nullptr )
{
VA_PRINT( "Available commands for " +CVAObject::GetObjectName()+ ": print, set, get" );
VA_PRINT( "PRINT:" );
VA_PRINT( "\t'print', 'help'" );
VA_PRINT( "GET:" );
VA_PRINT( "\t'get', 'gain'" );
VA_PRINT( "SET:" );
VA_PRINT( "\t'set', 'gain', 'value', <number>" );
VA_PRINT( "\t'set', 'hpirinv', 'value', <path> (use something like '$(VADataDir)/path/to/ir.wav' )" );
oReturn["Return"] = true; // dummy return value, otherwise Problem with MATLAB
return oReturn;
}
else if( ( pStruct = oArgs.GetValue( "GET" ) ) != nullptr )
{
if( pStruct->GetDatatype() != CVAStructValue::STRING )
VA_EXCEPT2( INVALID_PARAMETER, "GET command must be a string" );
std::string sGetCommand = toUppercase( *pStruct );
if( sGetCommand == "GAIN" )
{
oReturn["RETURN"] = m_pHPEQStreamFilter->fGain;
return oReturn;
}
else
{
VA_EXCEPT2( INVALID_PARAMETER, "Unrecognized GET command " + sGetCommand );
}
}
else if( ( pStruct = oArgs.GetValue( "HpIRInvFile" ) ) != nullptr )
{ {
if( pStruct->GetDatatype() != CVAStructValue::STRING ) if( pStruct->GetDatatype() != CVAStructValue::STRING )
VA_EXCEPT2( INVALID_PARAMETER, "File path value must be a string" ); VA_EXCEPT2( INVALID_PARAMETER, "File path value must be a string" );
...@@ -170,7 +142,7 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs ) ...@@ -170,7 +142,7 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs )
VA_EXCEPT2( INVALID_PARAMETER, "Path to inverse impulse response file must be a string" ); VA_EXCEPT2( INVALID_PARAMETER, "Path to inverse impulse response file must be a string" );
std::string sFilePathRaw = std::string( *pHpIRinvPathValue ); std::string sFilePathRaw = std::string( *pHpIRinvPathValue );
std::string sFilePath = m_oParams.pCore->GetCoreConfig()->mMacros.SubstituteMacros( sFilePathRaw ); std::string sFilePath = m_oParams.pCore->FindFilePath( sFilePathRaw );
if( !doesPathExist( sFilePath ) ) if( !doesPathExist( sFilePath ) )
VA_ERROR( GetObjectName(), "Path '" << sFilePath << "' does not exist" ); VA_ERROR( GetObjectName(), "Path '" << sFilePath << "' does not exist" );
...@@ -207,10 +179,6 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs ) ...@@ -207,10 +179,6 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs )
double dGain = double( *pGainValue ); double dGain = double( *pGainValue );
m_pHPEQStreamFilter->fGain = float( dGain ); m_pHPEQStreamFilter->fGain = float( dGain );
oReturn[ "HPIRInvCalibrationGain" ] = dGain;
oReturn[ "HPIRInvCalibrationGainDecibel" ] = ratio_to_db20( dGain );
return oReturn;
} }
} }
...@@ -224,29 +192,60 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs ) ...@@ -224,29 +192,60 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs )