Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITABase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
ITABase
Commits
29b9652f
Commit
29b9652f
authored
Jul 12, 2019
by
henryjandrew
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://git.rwth-aachen.de/ita/ITABase
into develop
parents
6e8cd461
d05479e9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
8 deletions
+41
-8
include/ITAFiniteImpulseResponse.h
include/ITAFiniteImpulseResponse.h
+3
-0
include/ITAStringUtils.h
include/ITAStringUtils.h
+2
-1
src/ITAFiniteImpulseResponse.cpp
src/ITAFiniteImpulseResponse.cpp
+5
-0
src/ITAStringUtilsPCRE.cpp
src/ITAStringUtilsPCRE.cpp
+31
-7
No files found.
include/ITAFiniteImpulseResponse.h
View file @
29b9652f
...
...
@@ -78,6 +78,9 @@ namespace ITABase
*/
void
Init
(
const
int
iLength
,
const
float
fSampleRate
,
const
bool
bZeroInit
=
true
);
//! Set a dirac pulse / delta function (first sample 1, rest 0)
void
SetDirac
();
private:
//! Disable this Init method from sample buffer
...
...
include/ITAStringUtils.h
View file @
29b9652f
...
...
@@ -52,6 +52,7 @@ public:
bool
StringToFloatVec
(
const
std
::
string
&
s
,
std
::
vector
<
float
>&
v
,
std
::
string
sSeparatorRegex
=
"
\\
s*,
\\
s*"
,
bool
bMatchCase
=
true
);
bool
StringToDoubleVec
(
const
std
::
string
&
s
,
std
::
vector
<
double
>&
v
,
std
::
string
sSeparatorRegex
=
"
\\
s*,
\\
s*"
,
bool
bMatchCase
=
true
);
bool
StringToStringVec
(
const
std
::
string
&
s
,
std
::
vector
<
std
::
string
>&
v
,
std
::
string
sSeparatorRegex
=
"
\\
s*,
\\
s*"
,
bool
bMatchCase
=
true
);
void
StringToDoubleVecNoRegex
(
const
std
::
string
&
s
,
std
::
vector
<
double
>&
v
);
private:
int
m_iOpts
;
...
...
@@ -180,7 +181,7 @@ ITA_BASE_API std::vector<unsigned int> StringToUIntVec( const std::string& s, st
ITA_BASE_API
std
::
vector
<
float
>
StringToFloatVec
(
const
std
::
string
&
s
,
std
::
string
sSeparatorRegex
=
"
\\
s*,
\\
s*"
,
bool
bMatchCase
=
true
);
//! std::string nach double-Liste parsen (Parse-Fehler werden in ITAExceptions umgesetzt)
ITA_BASE_API
std
::
vector
<
double
>
StringToDoubleVec
(
const
std
::
string
&
s
,
std
::
string
sSeparatorRegex
=
"
\\
s*,
\\
s*"
,
bool
bMatchCase
=
true
);
ITA_BASE_API
std
::
vector
<
double
>
StringToDoubleVec
(
const
std
::
string
&
s
);
//! std::string nach String-Liste parsen (Parse-Fehler werden in ITAExceptions umgesetzt)
ITA_BASE_API
std
::
vector
<
std
::
string
>
StringToStringVec
(
const
std
::
string
&
s
,
std
::
string
sSeparatorRegex
=
"
\\
s*,
\\
s*"
,
bool
bMatchCase
=
true
);
...
...
src/ITAFiniteImpulseResponse.cpp
View file @
29b9652f
...
...
@@ -40,3 +40,8 @@ float CFiniteImpulseResponse::GetNyquistFrequency() const
{
return
GetSampleRate
()
/
2.0
f
;
}
void
ITABase
::
CFiniteImpulseResponse
::
SetDirac
()
{
Identity
();
}
src/ITAStringUtilsPCRE.cpp
View file @
29b9652f
...
...
@@ -8,6 +8,10 @@
#include <iomanip>
#include <numeric>
#include <sstream>
#include <iostream>
#include <string>
#include <iterator>
#include <vector>
#include <ITAConstants.h>
#include <ITAException.h>
...
...
@@ -224,7 +228,7 @@ std::string ComplexFloatArrayToString( const float* pfValues, size_t count, int
std
::
string
s
;
if
(
count
>
0
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
if
(
i
>
0
)
s
+=
sSeparator
;
if
(
i
>
0
)
s
+=
sSeparator
;
s
+=
FloatToString
(
pfValues
[
2
*
i
],
iPrecision
);
if
(
pfValues
[
2
*
i
+
1
]
<
0
)
s
+=
FloatToString
(
pfValues
[
2
*
i
+
1
],
iPrecision
)
+
"i"
;
...
...
@@ -346,9 +350,10 @@ std::vector<float> StringToFloatVec( const std::string& s, std::string sSeparato
return
v
;
}
std
::
vector
<
double
>
StringToDoubleVec
(
const
std
::
string
&
s
,
std
::
string
sSeparatorRegex
,
bool
bMatchCase
)
{
std
::
vector
<
double
>
v
;
g_oDefaultConversion
.
StringToDoubleVec
(
s
,
v
,
sSeparatorRegex
,
bMatchCase
);
std
::
vector
<
double
>
StringToDoubleVec
(
const
std
::
string
&
s
)
{
std
::
vector
<
double
>
v
;
g_oDefaultConversion
.
StringToDoubleVecNoRegex
(
s
,
v
);
return
v
;
}
...
...
@@ -662,7 +667,26 @@ bool ITAConversion::StringToFloatVec( const std::string& s, std::vector<float>&
return
true
;
}
bool
ITAConversion
::
StringToDoubleVec
(
const
std
::
string
&
s
,
std
::
vector
<
double
>&
v
,
std
::
string
sSeparatorRegex
,
bool
bMatchCase
)
{
template
<
class
Container
>
void
split1
(
const
std
::
string
&
str
,
Container
&
cont
)
{
}
void
ITAConversion
::
StringToDoubleVecNoRegex
(
const
std
::
string
&
s
,
std
::
vector
<
double
>&
v
)
{
v
.
clear
();
std
::
string
sDouble
;
double
dVal
;
std
::
stringstream
ss
(
s
);
while
(
std
::
getline
(
ss
,
sDouble
,
','
)
)
if
(
StringToDouble
(
sDouble
,
dVal
)
)
v
.
push_back
(
dVal
);
}
bool
ITAConversion
::
StringToDoubleVec
(
const
std
::
string
&
s
,
std
::
vector
<
double
>&
v
,
std
::
string
sSeparatorRegex
,
bool
bMatchCase
)
{
// [fwe 2008-07-09] TODO: Diese Implementierung ist mal eben gebaut und hemdsärmelig! Verbessern!
pcrecpp
::
RE_Options
re_opts
;
re_opts
.
set_multiline
(
true
);
...
...
@@ -831,7 +855,7 @@ std::string timeToString( const double dSeconds )
}
*/
sprintf
(
buf
,
"%i min %0.1f s "
,
(
int
)
dSeconds
,
fmodf
((
float
)
dSeconds
,
60.0
f
)
);
sprintf
(
buf
,
"%i min %0.1f s "
,
(
int
)
dSeconds
,
fmodf
(
(
float
)
dSeconds
,
60.0
f
)
);
return
std
::
string
(
buf
);
#endif // WIN32
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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