Commit aaaab12e authored by Michael Kohnen's avatar Michael Kohnen

Added WICK and CTC Factor

parent d4815de8
......@@ -244,6 +244,26 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
for( int n=0; n<GetN(); n++ )
{
ITAHDFTSpectra* pHRTF( m_vpHRTFs[n] ); // two-channel
float HRTFEnergy[2];
HRTFEnergy[0]=(*pHRTF)[0]->getEnergy();
assert(HRTFEnergy[0]>0);
(*pHRTF)[0]->log();
(*pHRTF)[0]->mul(m_fWaveIncidenceAngleCompensationFactor);
(*pHRTF)[0]->exp();
float fEnergyCompensation = powf(HRTFEnergy[0],(1-m_fWaveIncidenceAngleCompensationFactor));
(*pHRTF)[0]->mul(fEnergyCompensation);
HRTFEnergy[1] = (*pHRTF)[1]->getEnergy();
assert(HRTFEnergy[1] > 0) ;
(*pHRTF)[1]->log();
(*pHRTF)[1]->mul(m_fWaveIncidenceAngleCompensationFactor);
(*pHRTF)[1]->exp();
float fEnergyCompensation = powf(HRTFEnergy[1], (1 - m_fWaveIncidenceAngleCompensationFactor));
(*pHRTF)[1]->mul(fEnergyCompensation);
float fWeight = float( m_vdWeights[n] ); // diag element
......@@ -256,48 +276,48 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
if (GetLoudspeakerSide(n) == Config::Loudspeaker::LEFT_SIDE)
{
fRightChannel *= m_fCrossTalkCancellationFactor;
fLeftChannelWICK *= m_fWaveIncidenceAngleCompensationFactor;
//fLeftChannelWICK *= m_fWaveIncidenceAngleCompensationFactor;
}
else if (GetLoudspeakerSide(n) == Config::Loudspeaker::RIGHT_SIDE)
{
fLeftChannel *= m_fCrossTalkCancellationFactor;
fRightChannelWICK *= m_fWaveIncidenceAngleCompensationFactor;
//fRightChannelWICK *= m_fWaveIncidenceAngleCompensationFactor;
}
// Element wise (a and d): HWH* -> 2x2
t->copy( (*pHRTF)[0] );
t->mul( fWeight*fLeftChannel );
t->log();
t->mul(fLeftChannelWICK);
t->exp();
//t->log();
//t->mul(m_fCrossTalkCancellationFactor);
//t->exp();
t->mul_conj( (*pHRTF)[0] );
n == 0 ? a->copy( t ) : a->add( t );
t->copy( (*pHRTF)[1] );
t->mul( fWeight*fRightChannel );
t->log();
t->mul(fRightChannelWICK);
/*t->log();
t->mul(m_fCrossTalkCancellationFactor);
t->exp();
*/
t->mul_conj( (*pHRTF)[1] );
n == 0 ? d->copy( t ) : d->add( t );
// Cross elements (b and c): HWH*
t->copy( (*pHRTF)[1] );
t->mul( fWeight*fRightChannel );
t->log();
t->mul(fRightChannelWICK);
t->exp();
/*t->log();
t->mul(m_fCrossTalkCancellationFactor);
t->exp();*/
t->mul_conj( (*pHRTF)[0] );
n == 0 ? b->copy( t ) : b->add( t );
t->copy( (*pHRTF)[0] );
t->mul( fWeight*fLeftChannel );
t->log();
t->mul(fLeftChannelWICK);
/*t->log();
t->mul(m_fCrossTalkCancellationFactor);
t->exp();
*/
t->mul_conj( (*pHRTF)[1] );
n == 0 ? c->copy( t ) : c->add( t );
}
......
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