Skip to content
Snippets Groups Projects
Select Git revision
  • 31f3d4d41e0183436bdd5b83480c27dc0a600b9c
  • master default protected
  • feature/pynamic-dev
  • feature/reflection
  • propagationParameterCalculation
  • feature/hod-utd-kim
  • feature/python-interface
  • feature/reflectionTest
  • feature/diffraction-fading
  • develop protected
  • feature/runPELICAN
  • feature/propParamExport
  • feature/factory
  • ma_2018/erraji
  • ITAPropagationModels_v2024a
  • VA_v2023b
  • ART_v2023a
  • VA_v2023a
  • VA_v2022a
  • before_cmake_rework
  • v2021.a
  • v2019.a
22 results

FilterGenerator.h

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    FilterGenerator.h 2.55 KiB
    /*
     * ----------------------------------------------------------------
     *
     *		ITA geometrical acoustics
     *		(c) Copyright Institute of Technical Acoustics (ITA)
     *		RWTH Aachen University, Germany, 2015-2018
     *
     * ----------------------------------------------------------------
     *				    ____  __________  _______
     *				   //  / //__   ___/ //  _   |
     *				  //  /    //  /    //  /_|  |
     *				 //  /    //  /    //  ___   |
     *				//__/    //__/    //__/   |__|
     *
     * ----------------------------------------------------------------
     *
     */
    
    #ifndef INCLUDE_WATCHER_ITA_PROPAGATION_MODELS_FILTER_GENERATOR
    #define INCLUDE_WATCHER_ITA_PROPAGATION_MODELS_FILTER_GENERATOR
    
    #include "Base.h"
    #include "Definitions.h"
    #include "DiffractionFilter.h"
    
    // ITA includes
    #include <ITAGeo/Base.h>
    #include <ITAHDFTSpectra.h>
    #include <ITAHDFTSpectrum.h>
    
    // STL includes
    #include <vector>
    
    namespace ITAPropagationModels
    {
    	//! Transfer function filter generator for propagation paths
    	/**
    	  * Generates transfer functions in the frequency-domain that
    	  * can be used as filters, e.g. for auralization.
    	  */
    	class ITA_PROPAGATION_MODELS_API CTFGenerator
    	{
    	public:
    
    		//! Construct a generator with predetermined output channels, e.g. for binaural or SH filters
    		/**
    		  * @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, 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(), pTransferFunction.GetSampleRate() )
    		{
    		};
    
    		//! Cunstruct a generator with matching properties of multi-channel target spectra
    		CTFGenerator( const ITABase::CHDFTSpectra& pTransferFunctions )
    			: CTFGenerator( pTransferFunctions.GetNumChannels(), pTransferFunctions.GetDFTSize(), pTransferFunctions.GetSampleRate() )
    		{
    		};
    
    		//! Generate a single-channel transfer function
    		inline void GenerateTF( ITABase::CHDFTSpectrum& pTransferFunction )
    		{
    			const std::vector< ITABase::CHDFTSpectrum* > vpSpectra = { &( pTransferFunction ) };
    			ITABase::CHDFTSpectra oTF( vpSpectra );
    			GenerateTF( oTF );
    		};
    
    		//! Generate a multi-channel transfer function
    		inline void GenerateTF( ITABase::CHDFTSpectra& pTransferFunctions );
    
    	private:
    	};
    }
    
    #endif // INCLUDE_WATCHER_ITA_PROPAGATION_MODELS_FILTER_GENERATOR