Starting filter enginge design

parent 4a07625e
......@@ -37,11 +37,57 @@ namespace ITAPropagationModels
/**
* Generates transfer functions in the frequency-domain that
* can be used as filters, e.g. for auralization.
*
* @note Not thread safe
*/
class ITA_PROPAGATION_MODELS_API CFilterEngine
{
public:
CFilterEngine();
~CFilterEngine();
//! Returns number of sensor channels
/**
* @param[in] oPathList Propagation path list
*
* @note Throws ITAException if sensors have different number of channels
*/
static int GetNumSensorChannels( const ITAGeo::CPropagationPathList& oPathList );
//! Checks if the sensor is the same anchor for all propagation paths
/**
* @param[in] oPathList Propagation path list
*
* @note Throws ITAException if sensors have different number of channels
*/
static bool HasSameSensorAnchor( const ITAGeo::CPropagationPathList& oPathList );
//! Applies all acoustic models like reflection diffraction models
void ApplyAcousticModels( ITAGeo::CPropagationPathList& oPathList );
void ApplyDiffractionModel( ITAGeo::CPropagationPathList& oPathList, int iModel = 1 );
void ApplyReflectionModel( ITAGeo::CPropagationPathList& oPathList, int iModel = 1 );
void ApplyTransmissionModel( ITAGeo::CPropagationPathList& oPathList, int iModel = 1 ); // @todo
//! Generate multi-channel propagation path (for multi-channel receiver directivitiy)
/**
* @todo AER
*/
void Generate( const ITAGeo::CPropagationPathList& oPathList, ITABase::CHDFTSpectra& oFilter );
//! Generate single-channel propagation path (for single-channel receiver directivity)
inline void Generate( const ITAGeo::CPropagationPathList& oPathList, ITABase::CHDFTSpectrum& oFilter )
{
const std::vector< ITABase::CHDFTSpectrum* > vpSpectra = { &oFilter };
ITABase::CHDFTSpectra oTF( vpSpectra );
Generate( oPathList, oTF );
};
private:
ITABase::CHDFTSpectra m_oAccumulatedSpectra; //!< Gathered propagation paths from list
ITABase::CHDFTSpectra m_oTempPropPathSpectra; //!< Single prop-path spectra
};
}
......
......@@ -46,18 +46,19 @@ namespace ITAPropagationModels
/**
* @param[in] iNumOutputChannels Number of output channels
* @param[in] iDFTSize Length of the DFT used to construct and combine filter components
* @param[in] fSamplingRate Filer sampling rate
*/
CTFGenerator( const int iNumOutputChannels, const int iDFTSize = 128 );
CTFGenerator( const int iNumOutputChannels, const int iDFTSize = 128, const float fSamplingRate = 44100.0f );
//! Cunstruct a generator with matching properties of a target spectrum
inline CTFGenerator( const ITABase::CHDFTSpectrum& pTransferFunction )
: CTFGenerator( 1, pTransferFunction.GetDFTSize() )
: CTFGenerator( 1, pTransferFunction.GetDFTSize(), pTransferFunction.GetSampleRate() )
{
};
//! Cunstruct a generator with matching properties of multi-channel target spectra
CTFGenerator( const ITABase::CHDFTSpectra& pTransferFunctions )
: CTFGenerator( pTransferFunctions.GetNumChannels(), pTransferFunctions.GetDFTSize() )
: CTFGenerator( pTransferFunctions.GetNumChannels(), pTransferFunctions.GetDFTSize(), pTransferFunctions.GetSampleRate() )
{
};
......
......@@ -14,7 +14,7 @@
using namespace ITAGeo;
using namespace ITAPropagationModels;
ITAPropagationModels::CTFGenerator::CTFGenerator( const int iNumOutputChannels, const int iDFTSize /*= 128 */ )
ITAPropagationModels::CTFGenerator::CTFGenerator( const int iNumOutputChannels, const int iDFTSize /*= 128 */, const float fSamplingRate )
{
}
......
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