Fixing indexing bug

parent 450e2bef
......@@ -264,7 +264,7 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
// Apply WICK factor in cepstrum domain only on magnitudes (left channel)
( *pHRTF )[ 0 ]->log();
for( int i = 0; i < ( *pHRTF )[ 0 ]->getDFTSize(); i++ )
for( int i = 0; i < ( *pHRTF )[ 0 ]->getSize(); i++ )
{
float fCepstrumMag = ( *pHRTF )[ 0 ]->calcMagnitude( i );
( *pHRTF )[ 0 ]->setMagnitudePreservePhase( i, fCepstrumMag * m_fWaveIncidenceAngleCompensationFactor );
......@@ -282,10 +282,10 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
// Apply WICK factor in cepstrum domain (right channel)
( *pHRTF )[ 1 ]->log();
for( int i = 0; i < ( *pHRTF )[ 0 ]->getDFTSize(); i++ )
for( int i = 0; i < ( *pHRTF )[ 1 ]->getSize(); i++ )
{
float fCepstrumMag = ( *pHRTF )[ 0 ]->calcMagnitude( i );
( *pHRTF )[ 0 ]->setMagnitudePreservePhase( i, fCepstrumMag * m_fWaveIncidenceAngleCompensationFactor );
float fCepstrumMag = ( *pHRTF )[ 1 ]->calcMagnitude( i );
( *pHRTF )[ 1 ]->setMagnitudePreservePhase( i, fCepstrumMag * m_fWaveIncidenceAngleCompensationFactor );
}
( *pHRTF )[ 1 ]->exp();
......
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