add normlization for the case that the two channels are added together

This commit is contained in:
Volker Fischer 2009-07-03 17:12:09 +00:00
parent e3ba007c1e
commit f5feef2a6f
3 changed files with 8 additions and 4 deletions

View file

@ -353,7 +353,8 @@ void CClient::ProcessAudioData ( CVector<short>& vecsStereoSndCrd )
for ( i = 0, j = 0; i < iMonoBlockSizeSam; i++, j += 2 ) for ( i = 0, j = 0; i < iMonoBlockSizeSam; i++, j += 2 )
{ {
vecsNetwork[i] = vecsNetwork[i] =
Double2Short ( vecdAudioStereo[j] + vecdAudioStereo[j + 1] ); Double2Short ( ( vecdAudioStereo[j] +
vecdAudioStereo[j + 1] ) / 2 );
} }
} }
else else
@ -368,7 +369,8 @@ void CClient::ProcessAudioData ( CVector<short>& vecsStereoSndCrd )
{ {
// attenuation on right channel // attenuation on right channel
vecsNetwork[i] = vecsNetwork[i] =
Double2Short ( vecdAudioStereo[j] + dAttFact * vecdAudioStereo[j + 1] ); Double2Short ( ( vecdAudioStereo[j] +
dAttFact * vecdAudioStereo[j + 1] ) / 2 );
} }
} }
else else
@ -377,7 +379,8 @@ void CClient::ProcessAudioData ( CVector<short>& vecsStereoSndCrd )
{ {
// attenuation on left channel // attenuation on left channel
vecsNetwork[i] = vecsNetwork[i] =
Double2Short ( vecdAudioStereo[j + 1] + dAttFact * vecdAudioStereo[j] ); Double2Short ( ( vecdAudioStereo[j + 1] +
dAttFact * vecdAudioStereo[j] ) / 2 );
} }
} }
} }

View file

@ -172,6 +172,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
MultiColorLEDBarInputLevelL->setEnabled ( false ); MultiColorLEDBarInputLevelL->setEnabled ( false );
MultiColorLEDBarInputLevelR->setEnabled ( false ); MultiColorLEDBarInputLevelR->setEnabled ( false );
LEDOverallStatus->setEnabled ( false ); LEDOverallStatus->setEnabled ( false );
PushButtonConnect->setFocus();
} }

View file

@ -11,7 +11,7 @@
* whereby we perform a linear interpolation between these two samples to get * whereby we perform a linear interpolation between these two samples to get
* an arbitraty sample grid. * an arbitraty sample grid.
* *
* The polyphase filter is calculated with Matlab(TM), the associated file * The polyphase filter is calculated with Matlab, the associated file
* is ResampleFilter.m. * is ResampleFilter.m.
* *
****************************************************************************** ******************************************************************************