Messing around with the benchmark, fixed some issues

parent a4f9a923
......@@ -38,7 +38,8 @@
#include <stdio.h>
using namespace std;
const std::string sBMFilePath = "ITAConvolution_BM_UPConv.ini";
ITASampleBuffer* pbfImpulse;
struct ParameterSet
{
......@@ -53,18 +54,13 @@ struct ParameterSet
{
dSampleRate = 44.1e3;
#ifdef DEBUG
iNumFrames = 100;
iNumFrames = 1000;
#else
iNumFrames = 1e2;
#endif
iScalingApproximation = 64;
};
inline void SetSomeDependentParameters()
{
iFilterLength = 2 * iBlockLength;
};
inline void WriteToINIFile() const
{
INIFileWriteInt( "BlockLength", iBlockLength );
......@@ -82,9 +78,17 @@ void run_benchmark( const ParameterSet&, const std::string& );
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;
INIFileUseFile( sBMFilePath );
INIFileUseFile( "ITAConvolution_BM_UPConv.ini" );
ParameterSet pm;
pm.SetSomeDefaults();
......@@ -99,13 +103,32 @@ int main( int, char** )
pm.iBlockLength = BL;
pm.iFilterLength = BL*BM;
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 << " ";
run_benchmark( pm, sBMID );
cout << "\tdone." << endl;
}
}
cout << "All done." << endl;
return 255;
......@@ -120,8 +143,8 @@ void run_benchmark( const ParameterSet& pm, const std::string& sName )
ITADatasource* pIntputStream = &sinesignal;
ITAUPConvolution* pFIRFilterEnginge = new ITAUPConvolution( pm.iBlockLength, pm.iFilterLength );
ITAUPFilter* pFIRFilter = pFIRFilterEnginge->RequestFilter();
pFIRFilter->identity();
ITAUPFilter* pFIRFilter = pFIRFilterEnginge->RequestFilter();;
pFIRFilter->Load( pbfImpulse->GetData(), std::min( pbfImpulse->GetLength(), pm.iFilterLength ) );
pFIRFilterEnginge->ExchangeFilter( pFIRFilter );
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
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