Starting to fix some problems in air traffic noise renderer

parent 818d1899
......@@ -283,7 +283,7 @@ RecordOutputBaseFolder = recordings/$(ProjectName)/renderer/MyImageSourceRendere
Class = BinauralAirTrafficNoise
Enabled = false
Reproductions = MyTalkthroughHeadphones
FilterBankType = IIR
[Renderer:MyVBAPFreefield]
Class = VBAPFreeField
......
......@@ -231,7 +231,7 @@ private:
CVABATNSoundPath();
//! Konstruktor
CVABATNSoundPath( double dSamplerate, int iBlocklength, int iHRIRFilterLength, int iDirFilterLength );
CVABATNSoundPath( double dSamplerate, int iBlocklength, int iHRIRFilterLength, int iDirFilterLength, int iFilterBankType = CITAThirdOctaveFilterbank::IIR_BIQUADS_ORDER10 );
ITASampleFrame m_sfHRIRTemp; //!< Intern verwendeter Zwischenspeicher fr HRIR Datentze
int m_iDefaultVDLSwitchingAlgorithm; //!< Umsetzung der Verzgerungsnderung
......@@ -247,16 +247,17 @@ class CVABATNSoundPathFactory : public IVAPoolObjectFactory
{
public:
inline CVABATNSoundPathFactory( double dSamplerate, int iBlocklength, int iHRIRFilterLength, int iDirFilterLength )
inline CVABATNSoundPathFactory( double dSamplerate, int iBlocklength, int iHRIRFilterLength, int iDirFilterLength, int iFilterBankType = CITAThirdOctaveFilterbank::IIR_BIQUADS_ORDER10 )
: m_dSamplerate( dSamplerate )
, m_iBlocklength( iBlocklength )
, m_iHRIRFilterLength( iHRIRFilterLength )
, m_iDirFilterLength( iDirFilterLength )
, m_iFilterBankType( iFilterBankType )
{};
inline CVAPoolObject* CreatePoolObject()
{
return new CVABATNSoundPath( m_dSamplerate, m_iBlocklength, m_iHRIRFilterLength, m_iDirFilterLength );
return new CVABATNSoundPath( m_dSamplerate, m_iBlocklength, m_iHRIRFilterLength, m_iDirFilterLength, m_iFilterBankType );
};
private:
......@@ -264,6 +265,7 @@ private:
int m_iBlocklength; //!< Blocklnge
int m_iHRIRFilterLength; //!< Filterlnge der HRIR
int m_iDirFilterLength; //!< Filterlnge der Richtcharakteristik
int m_iFilterBankType; //!< Filter bank type (FIR, IIR)
};
class CVABATNSoundReceiverPoolFactory : public IVAPoolObjectFactory
......@@ -328,7 +330,7 @@ CVABinauralAirTrafficNoiseAudioRenderer::CVABinauralAirTrafficNoiseAudioRenderer
IVAPoolObjectFactory* pSourceFactory = new CVABATNSourcePoolFactory( m_oDefaultSourceConf );
m_pSourcePool = IVAObjectPool::Create( 16, 2, pSourceFactory, true );
m_pSoundPathFactory = new CVABATNSoundPathFactory( GetSampleRate(), GetBlocklength(), m_iHRIRFilterLength, 128 );
m_pSoundPathFactory = new CVABATNSoundPathFactory( GetSampleRate(), GetBlocklength(), m_iHRIRFilterLength, 128, m_iFilterBankType );
m_pSoundPathPool = IVAObjectPool::Create( 64, 8, m_pSoundPathFactory, true );
......@@ -361,6 +363,14 @@ void CVABinauralAirTrafficNoiseAudioRenderer::Init( const CVAStruct& oArgs )
conf.OptBool( "SpreadingLossExternalSimulation", m_bSpreadingLossExternalSimulation, false );
conf.OptBool( "TemporalVariationsExternalSimulation", m_bTemporalVariationsExternalSimulation, false );
std::string sFilterBankType;
conf.OptString( "FilterBankType", sFilterBankType, "IIR" );
if( sFilterBankType == "FIR" )
m_iFilterBankType = CITAThirdOctaveFilterbank::FIR_SPLINE_LINEAR_PHASE;
else if( sFilterBankType == "IIR" )
m_iFilterBankType = CITAThirdOctaveFilterbank::IIR_BIQUADS_ORDER10;
else
ITA_EXCEPT1( INVALID_PARAMETER, "Unrecognized filter bank switch '" + sFilterBankType + "', use 'FIR' (spline linear phase) or 'IIR' (10th order biquads)" );
std::string sVLDInterpolationAlgorithm;
conf.OptString( "SwitchingAlgorithm", sVLDInterpolationAlgorithm, "linear" );
......@@ -1237,15 +1247,12 @@ void CVABinauralAirTrafficNoiseAudioRenderer::UpdateGlobalAuralizationMode( int
// Klasse ATNSoundPath
CVABATNSoundPath::CVABATNSoundPath( double dSamplerate, int iBlocklength, int iHRIRFilterLength, int iDirFilterLength )
CVABATNSoundPath::CVABATNSoundPath( double dSamplerate, int iBlocklength, int iHRIRFilterLength, int iDirFilterLength, int iFilterBankType )
: dGroundReflectionPlanePosition( 0 )
{
oDirSoundPath.pThirdOctaveFilterBank = CITAThirdOctaveFilterbank::Create( dSamplerate, iBlocklength,
CITAThirdOctaveFilterbank::FIR_SPLINE_LINEAR_PHASE );
//CITAThirdOctaveFilterbank::IIR_BIQUADS_ORDER10 );
oRefSoundPath.pThirdOctaveFilterBank = CITAThirdOctaveFilterbank::Create( dSamplerate, iBlocklength,
CITAThirdOctaveFilterbank::FIR_SPLINE_LINEAR_PHASE );
//CITAThirdOctaveFilterbank::IIR_BIQUADS_ORDER10 );
oDirSoundPath.pThirdOctaveFilterBank = CITAThirdOctaveFilterbank::Create( dSamplerate, iBlocklength, iFilterBankType );
oRefSoundPath.pThirdOctaveFilterBank = CITAThirdOctaveFilterbank::Create( dSamplerate, iBlocklength, iFilterBankType );
oDirSoundPath.pThirdOctaveFilterBank->SetIdentity();
oRefSoundPath.pThirdOctaveFilterBank->SetIdentity();
......@@ -1328,6 +1335,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
oDirSoundPath.oDirectivityStateNew.bDirectivityEnabled = true;
// Noo, this need an update! Values should only be requested but DSP should not be set directly!
oDirSoundPath.oSoundSourceDirectivityMagnitudes.SetIdentity();
return;
if( pDirectivityDataNew == nullptr )
{
// Directivity removed
......@@ -1412,8 +1423,11 @@ void CVABATNSoundPath::UpdateTemporalVariation()
void CVABATNSoundPath::UpdateAirAttenuation( const double dTemperatur, const double dPressure, const double dHumidity )
{
ITABase::ISO9613::AtmosphericAbsorption( oDirSoundPath.oAirAttenuationMagnitudes, oDirSoundPath.oRelations.dDistance, dTemperatur, dPressure, dHumidity );
ITABase::ISO9613::AtmosphericAbsorption( oRefSoundPath.oAirAttenuationMagnitudes, oRefSoundPath.oRelations.dDistance, dTemperatur, dPressure, dHumidity );
ITABase::ISO9613::AtmosphericAbsorption( oDirSoundPath.oAirAttenuationMagnitudes, oDirSoundPath.oRelations.dDistance, dTemperatur, dHumidity, dPressure );
ITABase::ISO9613::AtmosphericAbsorption( oRefSoundPath.oAirAttenuationMagnitudes, oRefSoundPath.oRelations.dDistance, dTemperatur, dHumidity, dPressure );
assert( false );
// @todo implement: oDirSoundPath.oAirAttenuationMagnitudes.Invert();
}
void CVABATNSoundPath::CalculateInverseDistanceDecrease()
......
......@@ -240,6 +240,7 @@ private:
double m_dGroundPlanePosition; //!< Position of ground plane (height) for reflection calculation
int m_iHRIRFilterLength; //!< Length of the HRIR filter DSP module
int m_iFilterBankType; //!< Filter bank type (FIR,IIR)
int m_iDefaultVDLSwitchingAlgorithm; //!< Umsetzungsalgorithmus der Variablen Verzgerungsleitung
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment