Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITAConvolution
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)
ITAConvolution
Commits
22d5121b
Commit
22d5121b
authored
May 18, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style for DSMBC filter modules
parent
70c03f30
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
322 additions
and
248 deletions
+322
-248
include/DSMBCConvolver.h
include/DSMBCConvolver.h
+25
-28
src/DSMBCConvolver.cpp
src/DSMBCConvolver.cpp
+297
-220
No files found.
include/DSMBCConvolver.h
View file @
22d5121b
...
...
@@ -46,7 +46,7 @@ class ITAFFT;
* Nebenlüufigkeit & Synchronisation:
*
* Folgende Methoden sind synchronisiert:
*
*
* - getFilterPool, setFilterPool, requestFilter, releaseFilter => Blocking aber leichtgewichtig, reentrant
* - getFilterExchangeMode, setFilterExchangeMode, getFilterCrossfadeLength, setFilterCrossfadeLength,
* getActiveFilter, exchangeFilter => Non-blocking und wait-free, reentrant
...
...
@@ -57,22 +57,25 @@ class ITAFFT;
* Müchtest Du mehr zu den Details wissen? Frag mich! -> Frank.Wefers@akustik.rwth-aachen.de
*/
class
ITA_CONVOLUTION_API
DSMBCConvolver
:
public
ITAUncopyable
{
class
ITA_CONVOLUTION_API
DSMBCConvolver
:
public
ITAUncopyable
{
public:
//! Austausch-Modi
enum
{
enum
{
SWITCH
=
0
,
//!< Hartes Umschalten
CROSSFADE_LINEAR
,
//!< Lineare Kreuzblende
CROSSFADE_COSINE_SQUARE
//!< Cosinus-Quadrat Kreuzblende
};
//! Ausgabe-Modi
enum
{
enum
{
OUTPUT_OVERWRITE
=
0
,
//!< Daten im Ausgabepuffer mit neuen Daten überschreiben
OUTPUT_MIX
,
//!< Neue Daten in den Ausgabepuffer einmischen
};
static
const
int
AUTO
=
-
1
;
static
const
int
AUTO
=
-
1
;
//! Standard-Konstruktor
/**
...
...
@@ -87,7 +90,7 @@ public:
* \param iBlocklength Blocklänge [in Samples]
* \param iMaxFilterlength Maximale Filterlänge [Anzahl Filterkoeffizienten]
*/
DSMBCConvolver
(
int
iBlocklength
,
int
iMaxFilterlength
,
DSMBCFilterPool
*
pFilterPool
=
NULL
);
DSMBCConvolver
(
const
int
iBlocklength
,
const
int
iMaxFilterlength
,
DSMBCFilterPool
*
pFilterPool
=
NULL
);
//! Destruktor
virtual
~
DSMBCConvolver
();
...
...
@@ -99,7 +102,7 @@ public:
* \param iBlocklength Blocklänge [in Samples]
* \param iMaxFilterlength Maximale Filterlänge [Anzahl Filterkoeffizienten]
*/
void
init
(
int
iBlocklength
,
int
iFilterLength
);
void
init
(
const
int
iBlocklength
,
const
int
iFilterLength
);
//! Blocklänge zurückgeben
int
getBlocklength
()
const
;
...
...
@@ -111,19 +114,19 @@ public:
const
DSMBCTrigger
*
getFilterExchangeTrigger
()
const
;
//! Trigger für den Filteraustausch setzen
void
setFilterExchangeTrigger
(
const
DSMBCTrigger
*
pTrigger
);
void
setFilterExchangeTrigger
(
const
DSMBCTrigger
*
pTrigger
);
//! Filteraustausch-Modus zurückgeben
int
getFilterExchangeMode
();
//! Filteraustausch-Modus setzen
void
setFilterExchangeMode
(
int
iMode
);
void
setFilterExchangeMode
(
const
int
iMode
);
//! überblendlänge [Samples] des Filteraustauschs zurückgeben
int
getFilterCrossfadeLength
();
//! überblendlänge [Samples] für den Filteraustausch setzen
void
setFilterCrossfadeLength
(
int
iLength
);
void
setFilterCrossfadeLength
(
const
int
iLength
);
//! Verstärkung zurückgeben
float
getGain
()
const
;
...
...
@@ -131,7 +134,7 @@ public:
//! Verstärkung setzen
// Hinweis: Falls bSetImmediately==true gesetzt, wird die Verstärkung nicht
// dynamisch angepasst, sondern hart auf den angegebenen Wert gesetzt.
void
setGain
(
float
fGain
,
bool
bSetImmediately
=
false
);
void
setGain
(
const
float
fGain
,
const
bool
bSetImmediately
=
false
);
//! Filterpool zurückgeben
DSMBCFilterPool
*
getFilterPool
()
const
;
...
...
@@ -140,13 +143,13 @@ public:
/**
* NULL => Falter-eigenen Pool benutzen
*/
void
setFilterPool
(
DSMBCFilterPool
*
pFilterPool
);
void
setFilterPool
(
DSMBCFilterPool
*
pFilterPool
);
//! Freies Filter anfordern
DSMBCFilter
*
requestFilter
();
//! Filter wieder zur anderweitigen Benutzung freigeben
void
releaseFilter
(
DSMBCFilter
*
pFilter
);
void
releaseFilter
(
DSMBCFilter
*
pFilter
);
//! Aktives Filter zurückgeben
/**
...
...
@@ -158,7 +161,7 @@ public:
/**
* Hinweis: Nullzeiger => Aktives Filter entfernen
*/
void
exchangeFilter
(
DSMBCFilter
*
pNewFilter
,
int
iExchangeMode
=
AUTO
,
int
iCrossfadeLength
=
AUTO
);
void
exchangeFilter
(
DSMBCFilter
*
pNewFilter
,
const
int
iExchangeMode
=
AUTO
,
const
int
iCrossfadeLength
=
AUTO
);
//! Löscht alle internen Samplepuffer
void
clear
();
...
...
@@ -174,9 +177,7 @@ public:
*/
// TODO: Hier wird Austausch durchgeführt!
void
process
(
const
float
*
pfInputData
,
float
*
pfOutputData
,
int
iOutputMode
=
OUTPUT_OVERWRITE
);
void
process
(
const
float
*
pfInputData
,
float
*
pfOutputData
,
const
int
iOutputMode
=
OUTPUT_OVERWRITE
);
//! Faltungsmethode (Erweitert)
/**
...
...
@@ -190,15 +191,11 @@ public:
* \param iOutputMode Ausgabemodus (überschreiben oder Einmischen)
*/
// TODO: Hier wird Austausch durchgeführt!
void
process
(
const
float
*
pfInputData
,
int
iInputLength
,
float
*
pfOutputData
,
int
iOutputLength
,
int
iOutputMode
=
OUTPUT_OVERWRITE
);
void
process
(
const
float
*
pfInputData
,
const
int
iInputLength
,
float
*
pfOutputData
,
const
int
iOutputLength
,
const
int
iOutputMode
=
OUTPUT_OVERWRITE
);
private:
typedef
struct
{
typedef
struct
{
DSMBCFilter
*
pFilter
;
int
iExchangeMode
;
int
iCrossfadeLength
;
...
...
@@ -220,7 +217,7 @@ private:
float
*
m_pfFreqAuxBuffer
;
// Hilfspuffer (Frequenz-bereich)
float
*
m_pfFreqMixdownBuffer
;
// Mischpuffer (Frequenz-bereich)
int
m_iFreqCoeffs
;
// Anzahl DFT-Koeffizienten (Symetrien eingerechnet)
std
::
vector
<
float
*
>
m_vpfFreqDelayLine
;
// Frequency-domain delay line (FDL)
std
::
vector
<
float
*
>
m_vpfFreqDelayLine
;
// Frequency-domain delay line (FDL)
ITAFFT
*
m_pFFT
,
*
m_pIFFT
;
// FFT, IFFT der Daten
ITACriticalSection
m_csPool
;
// Exklusiver Zugriff auf den Filterpool
...
...
@@ -229,8 +226,8 @@ private:
DSMBCTriggerWatch
m_oTriggerWatch
;
// TriggerWatch für den Filteraustausch
void
copyOutputApplyGain1
(
float
*
pfDest
,
const
float
*
pfSrc
,
int
iNumSamples
,
int
iOutputMode
);
void
copyOutputApplyGain2
(
float
*
pfDest
,
const
float
*
pfSrc1
,
const
float
*
pfSrc2
,
int
iOutputLength
,
int
iCrossfadeLength
,
int
iOutputMode
);
void
copyOutputApplyGain1
(
float
*
pfDest
,
const
float
*
pfSrc
,
const
int
iNumSamples
,
const
int
iOutputMode
);
void
copyOutputApplyGain2
(
float
*
pfDest
,
const
float
*
pfSrc1
,
const
float
*
pfSrc2
,
const
int
iOutputLength
,
const
int
iCrossfadeLength
,
const
int
iOutputMode
);
};
#endif // INCLUDE_WATCHER_DSMBC_CONVOLVER
src/DSMBCConvolver.cpp
View file @
22d5121b
This diff is collapsed.
Click to expand it.
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