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)
ITABase
Commits
e902c364
Commit
e902c364
authored
Jan 06, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Merge branch 'develop' of
https://git.rwth-aachen.de/ita/ITABase
into develop
parents
49ed1166
f8158b0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ITAHDFTSpectra.h
View file @
e902c364
...
...
@@ -92,6 +92,9 @@ public:
//! Copy from another Spectra
void
CopyFrom
(
const
ITAHDFTSpectra
*
otherSpectra
);
//! Returns maximum energy from all spectra
float
GetMaxEnergy
(
int
*
piChannelIndex
=
nullptr
)
const
;
//! Subscript operator gives direct access to spectrum channel
const
ITAHDFTSpectrum
*
operator
[](
const
int
)
const
;
ITAHDFTSpectrum
*
operator
[](
const
int
);
...
...
src/ITAHDFTSpectra.cpp
View file @
e902c364
#include
<ITAHDFTSpectra.h>
#include
<ITAAudiofileWriter.h>
#include
<ITAConstants.h>
#include
<ITAFilesystemUtils.h>
#include
<ITAHDFTSpectrum.h>
#include
<ITASampleFrame.h>
...
...
@@ -41,6 +42,23 @@ ITAHDFTSpectra::~ITAHDFTSpectra()
delete
m_vpSpectra
[
i
];
}
float
ITAHDFTSpectra
::
GetMaxEnergy
(
int
*
piIdx
)
const
{
float
fEnergyTemp
;
float
fEnergyMax
=
-
1.0
f
;
for
(
size_t
n
=
0
;
n
<
m_vpSpectra
.
size
();
n
++
)
{
fEnergyTemp
=
m_vpSpectra
[
n
]
->
getEnergy
();
if
(
fEnergyTemp
>
fEnergyMax
)
{
fEnergyMax
=
fEnergyTemp
;
*
piIdx
=
n
;
}
}
return
fEnergyMax
;
}
void
ITAHDFTSpectra
::
CopyFrom
(
const
ITAHDFTSpectra
*
otherSpectra
)
{
int
iNumChannels
=
otherSpectra
->
GetNumChannels
();
...
...
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