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
f8158b0a
Commit
f8158b0a
authored
Jan 06, 2017
by
Michael Kohnen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding energy getter for hdft
parent
6747da28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
include/ITAHDFTSpectra.h
include/ITAHDFTSpectra.h
+3
-0
src/ITAHDFTSpectra.cpp
src/ITAHDFTSpectra.cpp
+18
-0
No files found.
include/ITAHDFTSpectra.h
View file @
f8158b0a
...
...
@@ -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 @
f8158b0a
#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
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