Adapting iface changes in tests, also little bug fix

parent 25d65276
......@@ -130,7 +130,7 @@ class CITAThirdOctaveDecibelMagnitudeSpectrum : public CITAThirdOctaveMagnitudeS
{
public:
inline CITAThirdOctaveDecibelMagnitudeSpectrum()
: CITAThirdOctaveDecibelMagnitudeSpectrum()
: CITAThirdOctaveMagnitudeSpectrum()
{
};
......
......@@ -28,7 +28,7 @@ int main( int, char** )
void test_db_to_ration()
{
CITAThirdOctaveDecibelMagnitudeSpectrum oTOSpectrumConvertToRatio;
oTOSpectrumConvertToRatio.SetName( "Test unit magnitude spectrum to ratio" );
oTOSpectrumConvertToRatio.SetName( "Test unit decibel magnitude spectrum to ratio" );
oTOSpectrumConvertToRatio.SetIdentity();
for( int n = 0; n < oTOSpectrumConvertToRatio.GetNumBands(); n++ )
......@@ -48,20 +48,19 @@ void test_db_to_ration()
void test_ratio_to_db()
{
CITAThirdOctaveFactorMagnitudeSpectrum oTOSpectrumConvertToRatio;
oTOSpectrumConvertToRatio.SetName( "Test unit gain spectrum to db" );
oTOSpectrumConvertToRatio.SetName( "Test unit factor spectrum to db" );
oTOSpectrumConvertToRatio.SetValueUnit( "(gain)" );
oTOSpectrumConvertToRatio.SetIdentity(); // db -> all zeros
oTOSpectrumConvertToRatio.SetZero(); // all zeros
for( int n = 0; n < oTOSpectrumConvertToRatio.GetNumBands(); n++ )
oTOSpectrumConvertToRatio[ n ] = ratio_to_db10( oTOSpectrumConvertToRatio[ n ] ); // zero to db -> -inf
oTOSpectrumConvertToRatio[ n ] = ratio_to_db10( oTOSpectrumConvertToRatio[ n ] ); // zeros to db -> -inf
oTOSpectrumConvertToRatio.SetValueUnit( "dB" );
cout << oTOSpectrumConvertToRatio << endl;
// Convert gains "1"
oTOSpectrumConvertToRatio.SetIdentity(); // db -> all zeros
oTOSpectrumConvertToRatio.Add( 1.0f ); // gains now all 1.0
oTOSpectrumConvertToRatio.SetIdentity(); //all ones
for( int n = 0; n < oTOSpectrumConvertToRatio.GetNumBands(); n++ )
oTOSpectrumConvertToRatio[ n ] = ratio_to_db10( oTOSpectrumConvertToRatio[ n ] ); // ratio 1 to db -> 0
......@@ -73,16 +72,16 @@ void test_ratio_to_db()
void test_third_octave_spectrum()
{
CITAThirdOctaveGainMagnitudeSpectrum oTOSpectrumIdent;
oTOSpectrumIdent.SetName( "Test unit magnitude spectrum" );
oTOSpectrumIdent.SetName( "Test unit gain magnitude spectrum" );
oTOSpectrumIdent.SetIdentity();
cout << "Third octave magnitude spectrum identity:" << endl;
cout << "Third octave gain magnitude spectrum identity:" << endl;
cout << oTOSpectrumIdent << endl;
CITAThirdOctaveGainMagnitudeSpectrum oTOSpectrumZero;
oTOSpectrumZero.SetName( "Test unit zero spectrum" );
oTOSpectrumZero.SetZero();
cout << "Third octave magnitude spectrum zero:" << endl;
cout << "Third octave gain magnitude spectrum zero:" << endl;
cout << oTOSpectrumZero << endl;
}
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