Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITACTC
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)
ITACTC
Commits
d46dba91
Commit
d46dba91
authored
May 18, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes after refactoring
parent
4aabc712
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
src/ITANCTCStreamFilter.cpp
src/ITANCTCStreamFilter.cpp
+17
-17
No files found.
src/ITANCTCStreamFilter.cpp
View file @
d46dba91
...
...
@@ -27,13 +27,13 @@ ITANCTCStreamFilter::ITANCTCStreamFilter( const ITANCTCStreamFilter::Config& oC
for
(
int
n
=
0
;
n
<
oConfig
.
N
;
n
++
)
{
ITAUPConvolution
*
pConvolverL
=
new
ITAUPConvolution
(
oConfig
.
iBlockLength
,
oConfig
.
iFilterLength
,
m_pFilterPool
);
pConvolverL
->
s
etFilterExchangeMode
(
oConfig
.
iFilterExchangeMode
);
pConvolverL
->
s
etFilterCrossfadeLength
(
oConfig
.
iFilterCrossfadeLength
);
pConvolverL
->
S
etFilterExchangeMode
(
oConfig
.
iFilterExchangeMode
);
pConvolverL
->
S
etFilterCrossfadeLength
(
oConfig
.
iFilterCrossfadeLength
);
m_vpConvolvers
.
push_back
(
pConvolverL
);
ITAUPConvolution
*
pConvolverR
=
new
ITAUPConvolution
(
oConfig
.
iBlockLength
,
oConfig
.
iFilterLength
,
m_pFilterPool
);
pConvolverR
->
s
etFilterExchangeMode
(
oConfig
.
iFilterExchangeMode
);
pConvolverR
->
s
etFilterCrossfadeLength
(
oConfig
.
iFilterCrossfadeLength
);
pConvolverR
->
S
etFilterExchangeMode
(
oConfig
.
iFilterExchangeMode
);
pConvolverR
->
S
etFilterCrossfadeLength
(
oConfig
.
iFilterCrossfadeLength
);
m_vpConvolvers
.
push_back
(
pConvolverR
);
}
...
...
@@ -98,27 +98,27 @@ void ITANCTCStreamFilter::ExchangeFilters( const std::vector< ITAHDFTSpectra* >&
// Left binaural signal
ITAUPConvolution
*
pConvolverL
(
m_vpConvolvers
[
iIdxLeft
]
);
ITAUPFilter
*
pNewFilterL
=
m_pFilterPool
->
r
equestFilter
();
ITAUPFilter
*
pNewFilterL
=
m_pFilterPool
->
R
equestFilter
();
sbSpectrum
.
write
(
oCTCFilterL
.
data
(),
sbSpectrum
.
length
()
);
fIn
=
sbSpectrum
.
data
();
fOut
=
sbImpulseResponse
.
data
();
ifft
.
execute
(
fIn
,
fOut
);
sbImpulseResponse
.
div_scalar
(
float
(
sbImpulseResponse
.
length
()
)
);
pNewFilterL
->
l
oad
(
sbImpulseResponse
.
data
(),
sbImpulseResponse
.
length
()
);
pConvolverL
->
e
xchangeFilter
(
pNewFilterL
);
pNewFilterL
->
r
elease
();
pNewFilterL
->
L
oad
(
sbImpulseResponse
.
data
(),
sbImpulseResponse
.
length
()
);
pConvolverL
->
E
xchangeFilter
(
pNewFilterL
);
pNewFilterL
->
R
elease
();
// Right binaural signal
ITAUPConvolution
*
pConvolverR
(
m_vpConvolvers
[
iIdxRight
]
);
ITAUPFilter
*
pNewFilterR
=
m_pFilterPool
->
r
equestFilter
();
ITAUPFilter
*
pNewFilterR
=
m_pFilterPool
->
R
equestFilter
();
sbSpectrum
.
write
(
oCTCFilterR
.
data
(),
sbSpectrum
.
length
()
);
fIn
=
sbSpectrum
.
data
();
fOut
=
sbImpulseResponse
.
data
();
ifft
.
execute
(
fIn
,
fOut
);
sbImpulseResponse
.
div_scalar
(
float
(
sbImpulseResponse
.
length
()
)
);
pNewFilterR
->
l
oad
(
sbImpulseResponse
.
data
(),
sbImpulseResponse
.
length
()
);
pConvolverR
->
e
xchangeFilter
(
pNewFilterR
);
pNewFilterR
->
r
elease
();
pNewFilterR
->
L
oad
(
sbImpulseResponse
.
data
(),
sbImpulseResponse
.
length
()
);
pConvolverR
->
E
xchangeFilter
(
pNewFilterR
);
pNewFilterR
->
R
elease
();
}
return
;
...
...
@@ -137,8 +137,8 @@ void ITANCTCStreamFilter::SetGains( const std::vector< float >& vfGains, bool bS
ITAUPConvolution
*
pConvolverR
(
m_vpConvolvers
[
iIdxRight
]
);
const
float
&
fGain
(
vfGains
[
n
]
);
pConvolverL
->
s
etGain
(
fGain
,
bSetImmediately
);
pConvolverR
->
s
etGain
(
fGain
,
bSetImmediately
);
pConvolverL
->
S
etGain
(
fGain
,
bSetImmediately
);
pConvolverR
->
S
etGain
(
fGain
,
bSetImmediately
);
}
}
...
...
@@ -162,15 +162,15 @@ void ITANCTCStreamFilter::HandleProcessStream( ITADatasourceRealization*, const
ITAUPConvolution
*
pConvolverL
(
m_vpConvolvers
[
iIdxLeft
]
);
ITAUPConvolution
*
pConvolverR
(
m_vpConvolvers
[
iIdxRight
]
);
pConvolverL
->
p
rocess
(
pfInputDataCh0
,
oConfig
.
iBlockLength
,
pfOutputData
,
oConfig
.
iBlockLength
,
ITAUPConvolution
::
OUTPUT_OVERWRITE
);
pConvolverR
->
p
rocess
(
pfInputDataCh1
,
oConfig
.
iBlockLength
,
pfOutputData
,
oConfig
.
iBlockLength
,
ITAUPConvolution
::
OUTPUT_MIX
);
pConvolverL
->
P
rocess
(
pfInputDataCh0
,
oConfig
.
iBlockLength
,
pfOutputData
,
oConfig
.
iBlockLength
,
ITAUPConvolution
::
OUTPUT_OVERWRITE
);
pConvolverR
->
P
rocess
(
pfInputDataCh1
,
oConfig
.
iBlockLength
,
pfOutputData
,
oConfig
.
iBlockLength
,
ITAUPConvolution
::
OUTPUT_MIX
);
}
// Increment write pointer on output stream
m_pdsOutput
->
IncrementWritePointer
();
}
void
ITANCTCStreamFilter
::
HandlePostIncrementBlockPointer
(
ITADatasourceRealization
*
pSender
)
void
ITANCTCStreamFilter
::
HandlePostIncrementBlockPointer
(
ITADatasourceRealization
*
)
{
m_pdsInput
->
IncrementBlockPointer
();
}
\ No newline at end of file
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