Applying WICK factor only on magnitudes now

parent b9e87de1
......@@ -262,9 +262,13 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
// First, store original energy of HRTF (left channel)
float fEnergy = ( *pHRTF )[ 0 ]->getEnergy();
// Apply WICK factor in cepstrum domain (left channel)
// Apply WICK factor in cepstrum domain only on magnitudes (left channel)
( *pHRTF )[ 0 ]->log();
( *pHRTF )[ 0 ]->mul( m_fWaveIncidenceAngleCompensationFactor );
for( int i = 0; i < ( *pHRTF )[ 0 ]->getDFTSize(); i++ )
{
float fCepstrumMag = ( *pHRTF )[ 0 ]->calcMagnitude( i );
( *pHRTF )[ 0 ]->setMagnitudePreservePhase( i, fCepstrumMag * m_fWaveIncidenceAngleCompensationFactor );
}
( *pHRTF )[ 0 ]->exp();
// Compensate initial HRTF energy when WICK is used (left channel)
......@@ -273,12 +277,16 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
( *pHRTF )[ 0 ]->mul( fEnergyCompensation );
// First, store original energy of HRTF (right channel)
// First, store original energy of HRTF only on magnitudes (right channel)
fEnergy = ( *pHRTF )[ 1 ]->getEnergy();
// Apply WICK factor in cepstrum domain (right channel)
( *pHRTF )[ 1 ]->log();
( *pHRTF )[ 1 ]->mul( m_fWaveIncidenceAngleCompensationFactor );
for( int i = 0; i < ( *pHRTF )[ 0 ]->getDFTSize(); i++ )
{
float fCepstrumMag = ( *pHRTF )[ 0 ]->calcMagnitude( i );
( *pHRTF )[ 0 ]->setMagnitudePreservePhase( i, fCepstrumMag * m_fWaveIncidenceAngleCompensationFactor );
}
( *pHRTF )[ 1 ]->exp();
// Compensate initial HRTF energy when WICK is used (right channel)
......
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