Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ITADSP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
ITADSP
Commits
0d6f33af
Commit
0d6f33af
authored
7 years ago
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Downloads
Patches
Plain Diff
Adding benchmark for SIMO VDL
parent
c027ee0f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+7
-0
7 additions, 0 deletions
CMakeLists.txt
benchmarks/CMakeLists.txt
+29
-0
29 additions, 0 deletions
benchmarks/CMakeLists.txt
benchmarks/ITADSP_BM_SIMO_VDL.cpp
+125
-0
125 additions, 0 deletions
benchmarks/ITADSP_BM_SIMO_VDL.cpp
with
161 additions
and
0 deletions
CMakeLists.txt
+
7
−
0
View file @
0d6f33af
...
@@ -80,3 +80,10 @@ if( ITA_CORE_LIBS_WITH_TESTS )
...
@@ -80,3 +80,10 @@ if( ITA_CORE_LIBS_WITH_TESTS )
set
(
ITA_DSP_COMMON_BUILD TRUE
)
set
(
ITA_DSP_COMMON_BUILD TRUE
)
add_subdirectory
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/tests"
)
add_subdirectory
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/tests"
)
endif
(
)
endif
(
)
# benchmarks
if
(
ITA_CORE_LIBS_WITH_BENCHMARKS
)
set
(
ITA_DSP_COMMON_BUILD TRUE
)
add_subdirectory
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/benchmarks"
)
endif
(
)
This diff is collapsed.
Click to expand it.
benchmarks/CMakeLists.txt
0 → 100644
+
29
−
0
View file @
0d6f33af
cmake_minimum_required
(
VERSION 2.8
)
project
(
ITADSPTest
)
list
(
APPEND CMAKE_MODULE_PATH
"$ENV{VISTA_CMAKE_COMMON}"
)
include
(
VistaCommon
)
vista_use_package
(
ITABase REQUIRED FIND_DEPENDENCIES
)
vista_use_package
(
ITADSP REQUIRED FIND_DEPENDENCIES
)
vista_use_package
(
ITADataSources REQUIRED FIND_DEPENDENCIES
)
if
(
ITA_CORE_LIBS_BUILD_STATIC
)
add_definitions
(
-DITA_BASE_STATIC -DITA_DSP_STATIC -DITA_DATA_SOURCES_STATIC
)
endif
(
)
if
(
ITA_VISTA_BUILD_STATIC
)
add_definitions
(
-DVISTATOOLS_STATIC -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTAINTERPROCCOMM_STATIC
)
endif
(
)
add_executable
(
ITADSP_BM_SIMO_VDL ITADSP_BM_SIMO_VDL.cpp
)
target_link_libraries
(
ITADSP_BM_SIMO_VDL
${
VISTA_USE_PACKAGE_LIBRARIES
}
)
vista_configure_app
(
ITADSP_BM_SIMO_VDL
)
vista_install
(
ITADSP_BM_SIMO_VDL
)
vista_create_default_info_file
(
ITADSP_BM_SIMO_VDL
)
set_property
(
TARGET ITADSP_BM_SIMO_VDL PROPERTY FOLDER
"ITACoreLibs/Benchmarks/ITADSP"
)
This diff is collapsed.
Click to expand it.
benchmarks/ITADSP_BM_SIMO_VDL.cpp
0 → 100644
+
125
−
0
View file @
0d6f33af
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
* Benchmark SIMO VDL I/O
*
*/
#include
<ITASIMOVariableDelayLine.h>
#include
<ITAStringUtils.h>
#include
<ITAAudiofileWriter.h>
#include
<ITASampleBuffer.h>
#include
<ITASampleFrame.h>
#include
<ITAStopWatch.h>
#include
<ITAStreamFunctionGenerator.h>
#include
<ITAFileDataSource.h>
#include
<ITAStreamInfo.h>
#include
<iostream>
#include
<math.h>
#include
<vector>
using
namespace
std
;
const
unsigned
int
iBlockLength
=
128
;
const
double
dSampleRate
=
44.1e3
;
const
float
fMaxReservedDelaySamples
=
5
*
iBlockLength
;
const
float
fSimulateSeconds
=
10
;
const
float
fInitialDelaySamples
=
10
*
2
*
iBlockLength
-
1
;
const
int
g_iNumCursors
=
128
;
const
string
sOutFilePath
=
"ITADSP_BM_SIMOVDL_out.wav"
;
int
main
(
int
,
char
**
)
{
ITAStreamFunctionGenerator
sinesignal
(
1
,
dSampleRate
,
iBlockLength
,
ITAStreamFunctionGenerator
::
SINE
,
500.0f
,
0.9f
,
true
);
ITADatasource
*
pIntputStream
=
&
sinesignal
;
CITASIMOVariableDelayLine
*
pSIMOVDL
=
new
CITASIMOVariableDelayLine
(
dSampleRate
,
iBlockLength
,
fMaxReservedDelaySamples
,
CITASIMOVariableDelayLine
::
CUBIC_SPLINE_INTERPOLATION
);
double
dSamplerate
=
dSampleRate
;
unsigned
int
uiBlocklength
=
iBlockLength
;
unsigned
int
uiNumberOfFrames
=
(
unsigned
int
)
std
::
ceil
(
dSamplerate
*
fSimulateSeconds
/
(
float
)
uiBlocklength
);
std
::
vector
<
int
>
viCursors
;
for
(
int
i
=
0
;
i
<
g_iNumCursors
;
i
++
)
{
viCursors
.
push_back
(
pSIMOVDL
->
AddCursor
()
);
pSIMOVDL
->
SetDelaySamples
(
viCursors
[
i
],
float
(
iBlockLength
*
(
2
+
i
)
)
);
}
ITAAudiofileProperties
props_out
;
props_out
.
iChannels
=
1
;
props_out
.
dSampleRate
=
dSamplerate
;
props_out
.
eQuantization
=
ITAQuantization
::
ITA_FLOAT
;
props_out
.
eDomain
=
ITADomain
::
ITA_TIME_DOMAIN
;
props_out
.
iLength
=
uiNumberOfFrames
*
uiBlocklength
;
props_out
.
iChannels
=
pSIMOVDL
->
GetNumCursors
();
ITAAudiofileWriter
*
writer_out
=
ITAAudiofileWriter
::
create
(
sOutFilePath
,
props_out
);
ITAStreamInfo
oState
;
ITASampleBuffer
*
psbInput
=
new
ITASampleBuffer
(
uiBlocklength
,
true
);
ITASampleFrame
*
psfOutput
=
new
ITASampleFrame
(
pSIMOVDL
->
GetNumCursors
(),
uiBlocklength
,
true
);
cout
<<
"Processing "
;
ITAStopWatch
swBenchmark
;
unsigned
int
n
=
0
;
while
(
n
<
uiNumberOfFrames
)
{
// Add new samples
psbInput
->
write
(
pIntputStream
->
GetBlockPointer
(
0
,
&
oState
),
uiBlocklength
);
pSIMOVDL
->
WriteBlock
(
psbInput
);
for
(
size_t
i
=
0
;
i
<
viCursors
.
size
();
i
++
)
{
const
float
fCurrentDelay
=
pSIMOVDL
->
GetCurrentDelaySamples
(
viCursors
[
i
]
);
pSIMOVDL
->
SetDelaySamples
(
viCursors
[
i
],
fCurrentDelay
+
1.0f
);
// Keep Doppler ratio constant
}
swBenchmark
.
start
();
pSIMOVDL
->
ReadBlockAndIncrement
(
psfOutput
);
swBenchmark
.
stop
();
writer_out
->
write
(
psfOutput
,
uiBlocklength
);
n
++
;
pIntputStream
->
IncrementBlockPointer
();
if
(
n
%
(
uiNumberOfFrames
/
40
)
==
0
)
cout
<<
"."
;
}
cout
<<
" done."
<<
endl
;
cout
<<
"Output file: "
<<
sOutFilePath
<<
endl
;
cout
<<
"Benchmark: "
<<
swBenchmark
<<
endl
;
delete
writer_out
;
delete
psbInput
;
delete
psfOutput
;
return
255
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment