Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITAGeo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Institute of Technical Acoustics (ITA)
ITAGeo
Commits
0113e0a5
Commit
0113e0a5
authored
Jan 23, 2019
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving material utils code to the right file
parent
98449abf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
21 deletions
+16
-21
src/ITAGeo/Material/Utils.cpp
src/ITAGeo/Material/Utils.cpp
+16
-2
src/ITAGeo/Utils.cpp
src/ITAGeo/Utils.cpp
+0
-19
No files found.
src/ITAGeo/Material/Utils.cpp
View file @
0113e0a5
#include <ITAGeo/Material/Utils.h>
#include <ITAException.h>
float
ITAGeo
::
Material
::
Utils
::
EstimateFilterLengthSamples
(
std
::
shared_ptr
<
const
IMaterial
>
pMaterial
,
const
float
fSampleRate
,
const
float
fSpeedOfSound
/*= ITAConstants::DEFAULT_SPEED_OF_SOUND_F*/
)
float
ITAGeo
::
Material
::
Utils
::
EstimateFilterLengthSamples
(
std
::
shared_ptr
<
const
ITAGeo
::
Material
::
IMaterial
>
pMaterial
,
const
float
fSampleRate
,
const
float
fSpeedOfSound
)
{
ITA_EXCEPT_NOT_IMPLEMENTED
;
// Allow for the lowest frequency a phase shift of one cycle / return samples of one wave length
switch
(
pMaterial
->
GetType
()
)
{
case
(
ITAGeo
::
Material
::
IMaterial
::
THIRD_OCTAVE
)
:
{
auto
p
=
std
::
dynamic_pointer_cast
<
const
ITAGeo
::
Material
::
CThirdOctaveMaterial
>
(
pMaterial
);
const
float
fFirstCenterFrequency
=
p
->
oAbsorptionCoefficients
.
GetCenterFrequencies
()[
0
];
assert
(
fFirstCenterFrequency
!=
0.0
f
);
const
float
fLambda
=
fSpeedOfSound
/
fFirstCenterFrequency
;
return
fLambda
*
fSampleRate
;
}
}
// All other cases are considered to not extend any filter length, hence have to estimate
return
0.0
f
;
}
src/ITAGeo/Utils.cpp
View file @
0113e0a5
...
...
@@ -707,22 +707,3 @@ bool ITAGeoUtils::VistaRaysFromOpenMeshFaceHalfedges( CITAMesh* pMesh, CITAMesh:
}
return
true
;
}
float
ITAGeo
::
Material
::
Utils
::
EstimateFilterLengthSamples
(
std
::
shared_ptr
<
const
IMaterial
>
pMaterial
,
const
float
fSampleRate
,
const
float
fSpeedOfSound
)
{
// Allow for the lowest frequency a phase shift of one cycle / return samples of one wave length
switch
(
pMaterial
->
GetType
())
{
case
(
IMaterial
::
THIRD_OCTAVE
):
{
auto
p
=
std
::
dynamic_pointer_cast
<
const
CThirdOctaveMaterial
>
(
pMaterial
);
const
float
fFirstCenterFrequency
=
p
->
oAbsorptionCoefficients
.
GetCenterFrequencies
()[
0
];
assert
(
fFirstCenterFrequency
!=
0.0
f
);
const
float
fLambda
=
fSpeedOfSound
/
fFirstCenterFrequency
;
return
fLambda
*
fSampleRate
;
}
}
// All other cases are considered to not extend any filter length, hence have to estimate
return
0.0
f
;
}
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