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)
ITACTC
Commits
0ccc0807
Commit
0ccc0807
authored
Aug 26, 2016
by
Jonas Stienen
Browse files
Adding sweet spot factor (atomic) to config of NCTC and setter/getter
parent
8a43d8bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ITANCTC.h
View file @
0ccc0807
...
...
@@ -119,6 +119,7 @@ public:
double
dSampleRate
;
//!< Sampling rate
float
fSpeedOfSound
;
//!< Speed of sound, m/s
int
iOptimization
;
//!< Optimization algorithm (future work, see features/room_compensation)
float
fSweetSpotWideningFactor
;
//!< Factor for sweet spot widening (none = 0.0, max_wide = 1.0)
class
ITA_CTC_API
Loudspeaker
{
...
...
@@ -164,16 +165,28 @@ public:
//! Get beta parameter
/**
* \return Beta parameter
*/
* \return Beta parameter
*/
float
GetBeta
();
//! Set beta parameter
/**
* \param fBeta Set the beta regularization parameter
*/
* \param fBeta Set the beta regularization parameter
*/
void
SetBeta
(
float
fBeta
);
//! Get sweet spot widening factor
/**
* \return Factor [0..1]
*/
float
GetSweetSpotWideningFactor
();
//! Set sweet spot widening parameter
/**
* \param fFactor number between [0..1] (none: 0, max range = 1.0)
*/
void
SetSweetSpotWideningFactor
(
float
fFactor
);
//! Get additional delay parameter
/**
* \return Delay in seconds
...
...
@@ -269,6 +282,7 @@ private:
std
::
atomic
<
float
>
m_fBeta
;
//!< Beta parameter (regularization)
std
::
vector
<
float
>
m_vfDelayTime
;
//!< Add a delay [seconds] to the resulting CTC filter (individual channels)
std
::
atomic
<
int
>
m_iOptimization
;
//!< Optimization (see Config enum)
std
::
atomic
<
float
>
m_fSweetSpotWideningFactor
;
//!< Factor for sweet spot widening (none = 0.0, max_wide = 1.0)
const
DAFFContentIR
*
m_pHRIR
;
//!< HRIR dataset pointer
Pose
m_oHeadPose
;
//!< Current head Pose data
...
...
src/ITANCTC.cpp
View file @
0ccc0807
...
...
@@ -23,6 +23,7 @@ ITANCTC::ITANCTC( const Config& oNCTCConfig )
m_fBeta
=
float
(
1e-4
);
m_iOptimization
=
m_oConfig
.
iOptimization
;
m_fSweetSpotWideningFactor
=
m_oConfig
.
fSweetSpotWideningFactor
;
m_oHeadPose
.
vPos
.
SetToZeroVector
();
m_oHeadPose
.
vView
.
SetValues
(
0
,
0
,
-
1.0
f
);
...
...
@@ -188,7 +189,9 @@ bool ITANCTC::CalculateFilter( std::vector< ITAHDFTSpectra* >& vpCTCFilter )
ITAHDFTSpectrum
*
d
=
(
*
m_vpHelper2x2
[
1
])[
1
];
// Least-squares minimization: C = WH*(HWH*-\beta)^-1
// using H* as the hermitian (complex conjugated) transpose of H
// using H* as the hermitian (complex conjugated) transpose of H
// @todo: jst/mko sweet spot widening ...
int
iDFTSize
=
m_oConfig
.
iCTCFilterLength
+
1
;
for
(
int
n
=
0
;
n
<
GetN
();
n
++
)
...
...
@@ -353,6 +356,21 @@ void ITANCTC::SetBeta( float fBeta )
m_fBeta
=
fBeta
;
}
float
ITANCTC
::
GetBeta
()
{
return
m_fBeta
;
}
void
ITANCTC
::
SetSweetSpotWideningFactor
(
float
fFactor
)
{
m_fSweetSpotWideningFactor
=
fFactor
;
}
float
ITANCTC
::
GetSweetSpotWideningFactor
()
{
return
m_fSweetSpotWideningFactor
;
}
void
ITANCTC
::
SetDelayTime
(
float
fDelayTime
)
{
for
(
int
n
=
0
;
n
<
GetN
();
n
++
)
...
...
@@ -368,11 +386,6 @@ void ITANCTC::SetDelayTime( std::vector< float > vfDelayTime )
m_vfDelayTime
[
n
]
=
vfDelayTime
[
n
];
}
float
ITANCTC
::
GetBeta
()
{
return
m_fBeta
;
}
std
::
vector
<
float
>
ITANCTC
::
GetDelayTime
()
{
std
::
vector
<
float
>
vfDelayTime
(
GetN
()
);
...
...
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