Commit 98449abf authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen

Merging develop

parents eaca04a3 2da1a794
......@@ -19,9 +19,13 @@
#ifndef IW_ITA_GEO_DIRECTIVITY_DAFF_IMPULSE_RESPONSE
#define IW_ITA_GEO_DIRECTIVITY_DAFF_IMPULSE_RESPONSE
#include <ITAGeo/Definitions.h>
#include <ITAGeo/Directivity/Base.h>
#include <ITAGeo/Directivity/DAFF_Format.h>
#include "../Definitions.h"
#include "../Coordinates.h"
#include "Base.h"
#include "DAFF_Format.h"
#include <ITAFiniteImpulseResponse.h>
#include <ITAMultichannelFiniteImpulseResponse.h>
namespace ITAGeo
{
......@@ -35,6 +39,9 @@ namespace ITAGeo
virtual ~CDAFF_ImpulseResponse();
float GetFilterLengthSamples() const;
void GetNearestNeighbourImpulseResponse( const ITAGeo::Coordinates::CSpherical& oDirection, ITABase::CFiniteImpulseResponse& oFIR, const int iChannelIndex = 0 ) const;
void GetNearestNeighbourImpulseResponse( const ITAGeo::Coordinates::CSpherical& oDirection, ITABase::CMultichannelFiniteImpulseResponse& oFIR ) const;
};
}
}
......
......@@ -28,3 +28,13 @@ float ITAGeo::Directivity::CDAFF_ImpulseResponse::GetFilterLengthSamples() const
ITAGeo::Directivity::CDAFF_ImpulseResponse::~CDAFF_ImpulseResponse()
{
}
void ITAGeo::Directivity::CDAFF_ImpulseResponse::GetNearestNeighbourImpulseResponse( const ITAGeo::Coordinates::CSpherical& oDirection, ITABase::CFiniteImpulseResponse& oFIR, const int iChannelIndex ) const
{
ITA_EXCEPT_NOT_IMPLEMENTED;
}
void ITAGeo::Directivity::CDAFF_ImpulseResponse::GetNearestNeighbourImpulseResponse( const ITAGeo::Coordinates::CSpherical& oDirection, ITABase::CMultichannelFiniteImpulseResponse& oFIR ) const
{
ITA_EXCEPT_NOT_IMPLEMENTED;
}
#include <ITAGeo/Material/Utils.h>
#include <ITAException.h>
float ITAGeo::Material::Utils::EstimateFilterLengthSamples( std::shared_ptr< const IMaterial > pMaterial, const float fSampleRate, const float fSpeedOfSound /*= ITAConstants::DEFAULT_SPEED_OF_SOUND_F*/ )
{
ITA_EXCEPT_NOT_IMPLEMENTED;
}
......@@ -706,5 +706,23 @@ bool ITAGeoUtils::VistaRaysFromOpenMeshFaceHalfedges( CITAMesh* pMesh, CITAMesh:
vRays.push_back( VistaRay( oStartPoint, oEndPoint - oStartPoint ) );
}
return true;
}
}
float ITAGeo::Material::Utils::EstimateFilterLengthSamples(std::shared_ptr<const IMaterial> pMaterial, const float fSampleRate, const float fSpeedOfSound)
{
// Allow for the lowest frequency a phase shift of one cycle / return samples of one wave length
switch (pMaterial->GetType())
{
case(IMaterial::THIRD_OCTAVE):
{
auto p = std::dynamic_pointer_cast<const CThirdOctaveMaterial>(pMaterial);
const float fFirstCenterFrequency = p->oAbsorptionCoefficients.GetCenterFrequencies()[0];
assert(fFirstCenterFrequency != 0.0f);
const float fLambda = fSpeedOfSound / fFirstCenterFrequency;
return fLambda * fSampleRate;
}
}
// All other cases are considered to not extend any filter length, hence have to estimate
return 0.0f;
}
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