Commit c4d76f11 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding CMake configuration switch to export HRIR and CTC filter sets to...

Adding CMake configuration switch to export HRIR and CTC filter sets to harddrive as multi-channel WAV files (default: off)
parent 8c401ad2
...@@ -24,6 +24,10 @@ if( NOT DEFINED ITA_CTC_WITH_QUAD_CTC ) ...@@ -24,6 +24,10 @@ if( NOT DEFINED ITA_CTC_WITH_QUAD_CTC )
set( ITA_CTC_WITH_QUAD_CTC OFF CACHE BOOL "Build support for quad-loudspeaker Crosstalk-Cancellation (deprecated)" ) set( ITA_CTC_WITH_QUAD_CTC OFF CACHE BOOL "Build support for quad-loudspeaker Crosstalk-Cancellation (deprecated)" )
endif( NOT DEFINED ITA_CTC_WITH_QUAD_CTC ) endif( NOT DEFINED ITA_CTC_WITH_QUAD_CTC )
if( NOT DEFINED ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE )
set( ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE OFF CACHE BOOL "Export HRIR input,, intermediate results and final CTC filter set to harddrive (as multi-channel WAV files)" )
endif( NOT DEFINED ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE )
# includes # includes
include_directories( "include" ) include_directories( "include" )
...@@ -53,6 +57,10 @@ if( ITA_CTC_WITH_QUAD_CTC ) ...@@ -53,6 +57,10 @@ if( ITA_CTC_WITH_QUAD_CTC )
set( ITACTCSources "${ITACTCSources}" "src/ITAQuadCTC.cpp" "src/ITAQuadCTCStreamFilter.cpp" ) set( ITACTCSources "${ITACTCSources}" "src/ITAQuadCTC.cpp" "src/ITAQuadCTCStreamFilter.cpp" )
endif( ITA_CTC_WITH_QUAD_CTC ) endif( ITA_CTC_WITH_QUAD_CTC )
if( ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE )
add_definitions( -DNCTC_EXPORT_FILTER_TO_HARDDRIVE )
endif( ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE )
# compiler # compiler
add_definitions( -DITA_BASE_DLL -DITA_FFT_DLL -DITA_CONVOLUTION_DLL -DITA_CTC_DLL -DITA_CTC_EXPORT ) add_definitions( -DITA_BASE_DLL -DITA_FFT_DLL -DITA_CONVOLUTION_DLL -DITA_CTC_DLL -DITA_CTC_EXPORT )
......
...@@ -226,7 +226,9 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter ) ...@@ -226,7 +226,9 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
m_fft.execute( m_sfCTC_temp[ 0 ].data(), ( *pHRTF )[ 0 ]->data() ); m_fft.execute( m_sfCTC_temp[ 0 ].data(), ( *pHRTF )[ 0 ]->data() );
m_fft.execute( m_sfCTC_temp[ 1 ].data(), ( *pHRTF )[ 1 ]->data() ); m_fft.execute( m_sfCTC_temp[ 1 ].data(), ( *pHRTF )[ 1 ]->data() );
//pHRTF->Export( "BRIR_CalculateFilter_LS" + IntToString( n+1 ) ); #ifdef NCTC_EXPORT_FILTER_TO_HARDDRIVE
pHRTF->Export( "HRIR_LS" + IntToString( n+1 ) + "_RAW" );
#endif // NCTC_EXPORT_FILTER_TO_HARDDRIVE
} }
/* Matrix to be inverted (as two-by-two row vector) /* Matrix to be inverted (as two-by-two row vector)
...@@ -403,7 +405,10 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter ) ...@@ -403,7 +405,10 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
t->mul( fWeight * fRightChannelCTC ); t->mul( fWeight * fRightChannelCTC );
( *pCTCFilter )[ 1 ]->add( t ); ( *pCTCFilter )[ 1 ]->add( t );
//pCTCFilter->Export( "CTCFilter_noshift_" + IntToString( n+1 ) ); #ifdef NCTC_EXPORT_FILTER_TO_HARDDRIVE
pCTCFilter->Export( "CTCFilter_noshift_" + IntToString( n+1 ) );
#endif // NCTC_EXPORT_FILTER_TO_HARDDRIVE
// Time-shift // Time-shift
...@@ -422,7 +427,9 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter ) ...@@ -422,7 +427,9 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
m_fft.execute( sfTargetData_shift[ 0 ].data(), ( *pCTCFilter )[ 0 ]->data() ); m_fft.execute( sfTargetData_shift[ 0 ].data(), ( *pCTCFilter )[ 0 ]->data() );
m_fft.execute( sfTargetData_shift[ 1 ].data(), ( *pCTCFilter )[ 1 ]->data() ); m_fft.execute( sfTargetData_shift[ 1 ].data(), ( *pCTCFilter )[ 1 ]->data() );
//pCTCFilter->Export( "CTCFilter_shift_" + IntToString( n+1 ) ); #ifdef NCTC_EXPORT_FILTER_TO_HARDDRIVE
pCTCFilter->Export( "CTCFilter_shift_" + IntToString( n+1 ) );
#endif // NCTC_EXPORT_FILTER_TO_HARDDRIVE
} }
return true; return true;
......
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