Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITAConvolution
Commits
85ee24c9
Commit
85ee24c9
authored
Mar 09, 2020
by
Dipl.-Ing. Jonas Stienen
Browse files
Messing around with the benchmark, fixed some issues
parent
a4f9a923
Changes
2
Hide whitespace changes
Inline
Side-by-side
benchmarks/ITAConvolution_BM_UPConv.cpp
View file @
85ee24c9
...
...
@@ -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
=
100
0
;
#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
<<
"
\t
Starting "
<<
sBMID
<<
" "
;
//run_benchmark( pm, sBMID );
cout
<<
"
\t
done."
<<
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
<<
"
\t
Starting "
<<
sBMID
<<
" "
;
run_benchmark
(
pm
,
sBMID
);
cout
<<
"
\t
done."
<<
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
();
...
...
benchmarks/ITAConvolution_BM_UPConv.m
0 → 100644
View file @
85ee24c9
[
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment