Commits (3)
Copyright 2015-2017 Institute of Technical Acoustics, RWTH Aachen University Copyright 2015-2020 Institute of Technical Acoustics, RWTH Aachen University
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use files of this project except in compliance with the License. you may not use files of this project except in compliance with the License.
......
...@@ -7,7 +7,7 @@ ITAConvolution is a component of [ITACoreLibs](https://git.rwth-aachen.de/ita/IT ...@@ -7,7 +7,7 @@ ITAConvolution is a component of [ITACoreLibs](https://git.rwth-aachen.de/ita/IT
### License ### License
Copyright 2015-2017 Institute of Technical Acoustics, RWTH Aachen University Copyright 2015-2020 Institute of Technical Acoustics, RWTH Aachen University
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use files of this project except in compliance with the License. you may not use files of this project except in compliance with the License.
......
Copyright 2015-2017 Institute of Technical Acoustics, RWTH Aachen University. Any usage and distribution is prohibited, unless explicitly granted by the authors. Copyright 2015-2020 Institute of Technical Acoustics, RWTH Aachen University. Any usage and distribution is prohibited, unless explicitly granted by the authors.
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ITA core libs * ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA) * (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019 * RWTH Aachen University, Germany, 2015-2020
* *
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* ____ __________ _______ * ____ __________ _______
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ITA core libs * ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA) * (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019 * RWTH Aachen University, Germany, 2015-2020
* *
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* ____ __________ _______ * ____ __________ _______
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
#include <stdio.h> #include <stdio.h>
using namespace std; using namespace std;
const std::string sBMFilePath = "ITAConvolution_BM_UPConv.ini";
ITASampleBuffer* pbfImpulse;
struct ParameterSet struct ParameterSet
{ {
...@@ -53,18 +54,13 @@ struct ParameterSet ...@@ -53,18 +54,13 @@ struct ParameterSet
{ {
dSampleRate = 44.1e3; dSampleRate = 44.1e3;
#ifdef DEBUG #ifdef DEBUG
iNumFrames = 100; iNumFrames = 1000;
#else #else
iNumFrames = 1e2; iNumFrames = 1e2;
#endif #endif
iScalingApproximation = 64; iScalingApproximation = 64;
}; };
inline void SetSomeDependentParameters()
{
iFilterLength = 2 * iBlockLength;
};
inline void WriteToINIFile() const inline void WriteToINIFile() const
{ {
INIFileWriteInt( "BlockLength", iBlockLength ); INIFileWriteInt( "BlockLength", iBlockLength );
...@@ -82,9 +78,17 @@ void run_benchmark( const ParameterSet&, const std::string& ); ...@@ -82,9 +78,17 @@ void run_benchmark( const ParameterSet&, const std::string& );
int main( int, char** ) int main( int, char** )
{ {
pbfImpulse = new ITASampleBuffer( int( 1000 * 44.1e3 ), true );
srand( 100 );
int iLength = pbfImpulse->GetLength();
for( unsigned int i = 0; i < iLength; i++ )
pbfImpulse->GetData()[ i ] = ( float ) rand() / RAND_MAX;
cout << "Starting uniformly partitioned block convolution benchmark" << endl; cout << "Starting uniformly partitioned block convolution benchmark" << endl;
INIFileUseFile( sBMFilePath ); INIFileUseFile( "ITAConvolution_BM_UPConv.ini" );
ParameterSet pm; ParameterSet pm;
pm.SetSomeDefaults(); pm.SetSomeDefaults();
...@@ -99,13 +103,32 @@ int main( int, char** ) ...@@ -99,13 +103,32 @@ int main( int, char** )
pm.iBlockLength = BL; pm.iBlockLength = BL;
pm.iFilterLength = BL*BM; pm.iFilterLength = BL*BM;
pm.sWAVOutFilePath = sBMID + ".wav"; pm.sWAVOutFilePath = sBMID + ".wav";
pm.SetSomeDependentParameters(); cout << "\tStarting " << sBMID << " ";
//run_benchmark( pm, sBMID );
cout << "\tdone." << endl;
}
}
INIFileUseFile( "ITAConvolution_BM_UPConv_ScalingBehavior.ini" );
for( auto BL : { 256 } )
{
for( auto BM : { 1, 2, 4, 8, 16, 32, 64, 128, 512, 1024, 2048, 4096, 8182 } )
{
stringstream ss;
ss << "ITAConvolution_BM_NUPConv_ScalingBehavior_L" << BL << "_M" << BL*BM;
string sBMID = ss.str();
pm.iBlockLength = BL;
pm.iFilterLength = BL*BM;
pm.sWAVOutFilePath = sBMID + ".wav";
cout << "\tStarting " << sBMID << " "; cout << "\tStarting " << sBMID << " ";
run_benchmark( pm, sBMID ); run_benchmark( pm, sBMID );
cout << "\tdone." << endl; cout << "\tdone." << endl;
} }
} }
cout << "All done." << endl; cout << "All done." << endl;
return 255; return 255;
...@@ -120,8 +143,8 @@ void run_benchmark( const ParameterSet& pm, const std::string& sName ) ...@@ -120,8 +143,8 @@ void run_benchmark( const ParameterSet& pm, const std::string& sName )
ITADatasource* pIntputStream = &sinesignal; ITADatasource* pIntputStream = &sinesignal;
ITAUPConvolution* pFIRFilterEnginge = new ITAUPConvolution( pm.iBlockLength, pm.iFilterLength ); ITAUPConvolution* pFIRFilterEnginge = new ITAUPConvolution( pm.iBlockLength, pm.iFilterLength );
ITAUPFilter* pFIRFilter = pFIRFilterEnginge->RequestFilter(); ITAUPFilter* pFIRFilter = pFIRFilterEnginge->RequestFilter();;
pFIRFilter->identity(); pFIRFilter->Load( pbfImpulse->GetData(), std::min( pbfImpulse->GetLength(), pm.iFilterLength ) );
pFIRFilterEnginge->ExchangeFilter( pFIRFilter ); pFIRFilterEnginge->ExchangeFilter( pFIRFilter );
pFIRFilter->Release(); pFIRFilter->Release();
......
[ bmrd, ~ ] = inifile( 'ITAConvolution_BM_UPConv.ini', 'readall' );
%%
bm_L256_1x = str2double( bmrd{ 204, 4 } );
bm_L256_2x = str2double( bmrd{ 217, 4 } );
bm_L256_3x = str2double( bmrd{ 230, 4 } );
bm_L256_4x = str2double( bmrd{ 243, 4 } );
bm_L256_5x = str2double( bmrd{ 243, 4 } );
bm_L256 = [ bm_L256_1x bm_L256_2x bm_L256_3x bm_L256_4x bm_L256_5x ];
plot( bm_L256 )
bm_L128_M2048 = str2double( bmrd{ 191, 4 } );
bm_L256_M2048 = bm_L256_4x;
bm_M2048 = [ bm_L128_M2048 bm_L256_M2048 ]
%%
[ bm_data, ~ ] = inifile( 'ITAConvolution_BM_UPConv_ScalingBehavior.ini', 'readall' );
block_time = str2double( bm_data{ 6, 4 } );
bm_L256 = [];
bm_L256( 1 ) = str2double( bm_data{ 9 + 0 * 13, 4 } );
bm_L256( 2 ) = str2double( bm_data{ 9 + 1 * 13, 4 } );
bm_L256( 3 ) = str2double( bm_data{ 9 + 2 * 13, 4 } );
bm_L256( 4 ) = str2double( bm_data{ 9 + 3 * 13, 4 } );
bm_L256( 5 ) = str2double( bm_data{ 9 + 4 * 13, 4 } );
bm_L256( 6 ) = str2double( bm_data{ 9 + 5 * 13, 4 } );
bm_L256( 7 ) = str2double( bm_data{ 9 + 6 * 13, 4 } );
bm_L256( 8 ) = str2double( bm_data{ 9 + 7 * 13, 4 } );
bm_L256( 9 ) = str2double( bm_data{ 9 + 8 * 13, 4 } );
bm_L256( 10 ) = str2double( bm_data{ 9 + 9 * 13, 4 } );
bm_L256( 11 ) = str2double( bm_data{ 9 + 10 * 13, 4 } );
bm_L256( 12 ) = str2double( bm_data{ 9 + 11 * 13, 4 } );
bm_L256( 13 ) = str2double( bm_data{ 9 + 12 * 13, 4 } );
bm_irlength_samples = 256 * [ 1, 2, 4, 8, 16, 32, 64, 128, 512, 1024, 2048, 4096, 8182 ];
bm_irlength_seconds = bm_irlength_samples ./ 44100;
bm_L256_pph = bm_L256 / block_time * 100;
figure
hold on
plot( bm_irlength_seconds, bm_L256_pph )
plot( bm_irlength_seconds, bm_L256_pph * 4 ) % 2x binaural, 2x filter exchange
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ITA core libs * ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA) * (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019 * RWTH Aachen University, Germany, 2015-2020
* *
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* ____ __________ _______ * ____ __________ _______
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ITA core libs * ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA) * (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019 * RWTH Aachen University, Germany, 2015-2020
* *
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* ____ __________ _______ * ____ __________ _______
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ITA core libs * ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA) * (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019 * RWTH Aachen University, Germany, 2015-2020
* *
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* ____ __________ _______ * ____ __________ _______
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ITA core libs * ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA) * (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019 * RWTH Aachen University, Germany, 2015-2020
* *
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* ____ __________ _______ * ____ __________ _______
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ITA core libs * ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA) * (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019 * RWTH Aachen University, Germany, 2015-2020
* *
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* ____ __________ _______ * ____ __________ _______
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ITA core libs * ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA) * (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019 * RWTH Aachen University, Germany, 2015-2020
* *
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* ____ __________ _______ * ____ __________ _______
......