Adding new Vista test for IPNet, also a lot of style

parent 88240f88
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_DEBUG
#define INCLUDE_WATCHER_ITA_DEBUG
......
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_LOG
#define INCLUDE_WATCHER_ITA_LOG
......
......@@ -40,7 +40,6 @@ public:
std::vector< float > GetMagnitudesCopy() const;
const std::vector< float >& GetMagnitudes() const;
const std::vector< float >& GetFrequencies() const;
void SetMagnitudes( const std::vector< float >& vfMagnitudes );
void SetMagnitude( const int iFrequencyBandIndex, const float fMagnitudeValue );
......
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_OPS
#define INCLUDE_WATCHER_ITA_OPS
......
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_SAMPLE_FRAME
#define INCLUDE_WATCHER_ITA_SAMPLE_FRAME
......
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_SIMPLE_CONVOLUTION
#define INCLUDE_WATCHER_ITA_SIMPLE_CONVOLUTION
......
......@@ -3,12 +3,12 @@
#define _WIN32_WINNT 0x0500
#include <windows.h>
typedef union {
typedef union
{
LONG longValue;
float floatValue;
} ConvLongFloat;
//inline int atomic_read_int(volatile const int* src) {
int atomic_read_int( volatile const int* src )
{
/*
......
#include <ITABlockMath.h>
#include <ITAConstants.h>
#include <memory.h>
#include <cmath>
#ifndef M_PI
#define M_PI 3.14159265358979323846f
#endif
void bm_CMul(float* pfDestRe, float* pfDestIm, const float* pfRe1, const float* pfIm1, const float* pfRe2, const float* pfIm2, unsigned int uiCount) {
for (unsigned int i=0; i<uiCount; i++) {
void bm_CMul( float* pfDestRe, float* pfDestIm, const float* pfRe1, const float* pfIm1, const float* pfRe2, const float* pfIm2, unsigned int uiCount )
{
for( unsigned int i = 0; i < uiCount; i++ )
{
*pfDestRe++ = *pfRe1 * *pfRe2 - *pfIm1 * *pfIm2;
*pfDestIm++ = *pfRe1++ * *pfIm2++ + *pfIm1++ * *pfRe2++;
}
}
void bm_CMul(float* pfDest, const float* pfSrc1, const float* pfSrc2, unsigned int uiCount) {
for (unsigned int i=0; i<uiCount; i++)
void bm_CMul( float* pfDest, const float* pfSrc1, const float* pfSrc2, unsigned int uiCount )
{
for( unsigned int i = 0; i < uiCount; i++ )
*pfDest++ = *pfSrc1++ * *pfSrc2++;
}
void bm_CMul_css(float* pfDest, const float* pfSource1, const float* pfSource2, unsigned int uiCssArraySize) {
void bm_CMul_css( float* pfDest, const float* pfSource1, const float* pfSource2, unsigned int uiCssArraySize )
{
float *pfDestRe = pfDest;
float *pfDestIm = pfDest + uiCssArraySize/2;
float *pfDestIm = pfDest + uiCssArraySize / 2;
const float *pfRe1 = pfSource1;
const float *pfIm1 = pfSource1 + uiCssArraySize/2;
const float *pfIm1 = pfSource1 + uiCssArraySize / 2;
const float *pfRe2 = pfSource2;
const float *pfIm2 = pfSource2 + uiCssArraySize/2;
const float *pfIm2 = pfSource2 + uiCssArraySize / 2;
for (unsigned int i=0; i<uiCssArraySize/2; i++) {
for( unsigned int i = 0; i < uiCssArraySize / 2; i++ )
{
*pfDestRe++ = *pfRe1 * *pfRe2 - *pfIm1 * *pfIm2;
*pfDestIm++ = *pfRe1++ * *pfIm2++ + *pfIm1++ * *pfRe2++;
}
}
void bm_CMulMag_css(float* pfDest, const float* pfSrcCmx, const float* pfSrcMag, unsigned int uiCssArraySize, float fFactor) {
void bm_CMulMag_css( float* pfDest, const float* pfSrcCmx, const float* pfSrcMag, unsigned int uiCssArraySize, float fFactor )
{
float *pfDestRe = pfDest;
float *pfDestIm = pfDest + uiCssArraySize/2;
float *pfDestIm = pfDest + uiCssArraySize / 2;
const float *pfRe1 = pfSrcCmx;
const float *pfIm1 = pfSrcCmx + uiCssArraySize/2;
const float *pfIm1 = pfSrcCmx + uiCssArraySize / 2;
for (unsigned int i=0; i<uiCssArraySize/2; i++) {
for( unsigned int i = 0; i < uiCssArraySize / 2; i++ )
{
*pfDestRe++ = *pfRe1++ * *pfSrcMag * fFactor;
*pfDestIm++ = *pfIm1++ * *pfSrcMag++ * fFactor;
}
}
void bm_CMulAdd(float* pfDestRe, float* pfDestIm, const float* pfRe1, const float* pfIm1, const float* pfRe2, const float* pfIm2, unsigned int uiCount) {
for (unsigned int i=0; i<uiCount; i++) {
void bm_CMulAdd( float* pfDestRe, float* pfDestIm, const float* pfRe1, const float* pfIm1, const float* pfRe2, const float* pfIm2, unsigned int uiCount )
{
for( unsigned int i = 0; i < uiCount; i++ )
{
*pfDestRe++ += *pfRe1 * *pfRe2 - *pfIm1 * *pfIm2;
*pfDestIm++ += *pfRe1++ * *pfIm2++ + *pfIm1++ * *pfRe2++;
}
}
void bm_CMulAdd_css(float* pfDest, const float* pfSource1, const float* pfSource2, unsigned int uiCssArraySize) {
void bm_CMulAdd_css( float* pfDest, const float* pfSource1, const float* pfSource2, unsigned int uiCssArraySize ) {
float *pfDestRe = pfDest;
float *pfDestIm = pfDest + uiCssArraySize/2;
float *pfDestIm = pfDest + uiCssArraySize / 2;
const float *pfRe1 = pfSource1;
const float *pfIm1 = pfSource1 + uiCssArraySize/2;
const float *pfIm1 = pfSource1 + uiCssArraySize / 2;
const float *pfRe2 = pfSource2;
const float *pfIm2 = pfSource2 + uiCssArraySize/2;
const float *pfIm2 = pfSource2 + uiCssArraySize / 2;
for (unsigned int i=0; i<uiCssArraySize/2; i++) {
for( unsigned int i = 0; i < uiCssArraySize / 2; i++ ) {
*pfDestRe++ += *pfRe1 * *pfRe2 - *pfIm1 * *pfIm2;
*pfDestIm++ += *pfRe1++ * *pfIm2++ + *pfIm1++ * *pfRe2++;
}
}
void bm_CMulSub(float* pfDestRe, float* pfDestIm, const float* pfRe1, const float* pfIm1, const float* pfRe2, const float* pfIm2, unsigned int uiCount) {
for (unsigned int i = 0; i < uiCount; i++ ) {
void bm_CMulSub( float* pfDestRe, float* pfDestIm, const float* pfRe1, const float* pfIm1, const float* pfRe2, const float* pfIm2, unsigned int uiCount ) {
for( unsigned int i = 0; i < uiCount; i++ ) {
*pfDestRe++ -= *pfRe1 * *pfRe2 - *pfIm1 * *pfIm2;
*pfDestIm++ -= *pfRe1++ * *pfIm2++ + *pfIm1++ * *pfRe2++;
}
}
void bm_CMulSub_css(float* pfDest, const float* pfSource1, const float* pfSource2, unsigned int uiCssArraySize) {
void bm_CMulSub_css( float* pfDest, const float* pfSource1, const float* pfSource2, unsigned int uiCssArraySize ) {
float *pfDestRe = pfDest;
float *pfDestIm = pfDest + uiCssArraySize/2;
float *pfDestIm = pfDest + uiCssArraySize / 2;
const float *pfRe1 = pfSource1;
const float *pfIm1 = pfSource1 + uiCssArraySize/2;
const float *pfIm1 = pfSource1 + uiCssArraySize / 2;
const float *pfRe2 = pfSource2;
const float *pfIm2 = pfSource2 + uiCssArraySize/2;
const float *pfIm2 = pfSource2 + uiCssArraySize / 2;
for (unsigned int i=0; i<uiCssArraySize/2; i++ ) {
for( unsigned int i = 0; i < uiCssArraySize / 2; i++ ) {
*pfDestRe++ -= *pfRe1 * *pfRe2 - *pfIm1 * *pfIm2;
*pfDestIm++ -= *pfRe1++ * *pfIm2++ + *pfIm1++ * *pfRe2++;
}
}
void bm_CDiv(float* pfDestRe, float* pfDestIm, const float* pfZRe, const float* pfZIm, const float* pfNRe, const float* pfNIm, unsigned int uiCount) {
void bm_CDiv( float* pfDestRe, float* pfDestIm, const float* pfZRe, const float* pfZIm, const float* pfNRe, const float* pfNIm, unsigned int uiCount ) {
float fNenner = 0.0;
for (unsigned int i=0; i<uiCount; i++) {
for( unsigned int i = 0; i < uiCount; i++ ) {
fNenner = *pfNRe * *pfNRe + *pfNIm * *pfNIm;
*pfDestRe = *pfZRe * *pfNRe + *pfZIm * *pfNIm;
*pfDestRe++ /= fNenner;
*pfDestIm = *pfNRe++ * *pfZIm++ - *pfZRe++ * *pfNIm++;
*pfDestIm++ /= fNenner;
*pfDestIm++ /= fNenner;
}
}
/*
void bm_CMulMag_css(float *pfDest, const float *pfSrcCmx, const std::vector<float> &pvSrcMag, unsigned int uiCssArraySize, float fFactor) {
float *pfDestRe = pfDest;
float *pfDestIm = pfDest + uiCssArraySize/2;
const float *pfRe1 = pfSrcCmx;
const float *pfIm1 = pfSrcCmx + uiCssArraySize/2;
for (unsigned int i=0; i<uiCssArraySize/2; i++) {
*pfDestRe++ = *pfRe1++ * pvSrcMag[i] * fFactor;
*pfDestIm++ = *pfIm1++ * pvSrcMag[i] * fFactor;
}
float *pfDestRe = pfDest;
float *pfDestIm = pfDest + uiCssArraySize/2;
const float *pfRe1 = pfSrcCmx;
const float *pfIm1 = pfSrcCmx + uiCssArraySize/2;
for (unsigned int i=0; i<uiCssArraySize/2; i++) {
*pfDestRe++ = *pfRe1++ * pvSrcMag[i] * fFactor;
*pfDestIm++ = *pfIm1++ * pvSrcMag[i] * fFactor;
}
}
*/
void bm_CDiv_css(float* pfDest, const float* pfZ, const float* pfN, unsigned int uiCssArraySize) {
void bm_CDiv_css( float* pfDest, const float* pfZ, const float* pfN, unsigned int uiCssArraySize ) {
float *pfDestRe = pfDest;
float *pfDestIm = pfDest + uiCssArraySize/2;
float *pfDestIm = pfDest + uiCssArraySize / 2;
const float *pfZRe = pfZ;
const float *pfZIm = pfZ + uiCssArraySize/2;
const float *pfZIm = pfZ + uiCssArraySize / 2;
const float *pfNRe = pfN;
const float *pfNIm = pfN + uiCssArraySize/2;
const float *pfNIm = pfN + uiCssArraySize / 2;
float fNenner = 0.0;
for (unsigned int i=0; i<uiCssArraySize/2; i++) {
for( unsigned int i = 0; i < uiCssArraySize / 2; i++ ) {
fNenner = *pfNRe * *pfNRe + *pfNIm * *pfNIm;
*pfDestRe = *pfZRe * *pfNRe + *pfZIm * *pfNIm;
*pfDestRe++ /= fNenner;
*pfDestIm = *pfNRe++ * *pfZIm++ - *pfZRe++ * *pfNIm++;
*pfDestIm++ /= fNenner;
*pfDestIm++ /= fNenner;
}
}
void bm_Add(float* pfDest, const float* pfSummand, unsigned int uiCount) {
for (unsigned int i=0; i<uiCount; i++)
void bm_Add( float* pfDest, const float* pfSummand, unsigned int uiCount ) {
for( unsigned int i = 0; i < uiCount; i++ )
*pfDest++ += *pfSummand++;
}
void bm_ContinueMagnitudePreservePhase(float *pfRe, float *pfIm, unsigned int uiCount) {
void bm_ContinueMagnitudePreservePhase( float *pfRe, float *pfIm, unsigned int uiCount ) {
float fFactor = 0.0;
float fConstMag = sqrtf((powf(*pfRe,2)) + (powf(*pfIm,2)));
float fConstMag = sqrtf( ( powf( *pfRe, 2 ) ) + ( powf( *pfIm, 2 ) ) );
for (unsigned int i=0 ; i<uiCount; i++) {
fFactor = fConstMag / sqrtf((powf(*pfRe,2)) + (powf(*pfIm,2))) ;
*pfRe = fFactor * *pfRe++;
*pfIm = fFactor * *pfIm++;
for( unsigned int i = 0; i < uiCount; i++ ) {
fFactor = fConstMag / sqrtf( ( powf( *pfRe, 2 ) ) + ( powf( *pfIm, 2 ) ) );
*pfRe = fFactor * *pfRe++;
*pfIm = fFactor * *pfIm++;
}
}
void bm_ContinueMagnitudePreservePhase_css(float *pfData, float fStartFrequency, float fSamplerate, unsigned int uiCssArraySize) {
unsigned int uiStartBin = (unsigned int)floor(fStartFrequency * uiCssArraySize / fSamplerate );
void bm_ContinueMagnitudePreservePhase_css( float *pfData, float fStartFrequency, float fSamplerate, unsigned int uiCssArraySize ) {
unsigned int uiStartBin = ( unsigned int ) floor( fStartFrequency * uiCssArraySize / fSamplerate );
float *pfRe = pfData;
float *pfIm = pfData + uiCssArraySize/2;
float *pfIm = pfData + uiCssArraySize / 2;
float fFactor = 0.0;
float fConstMag = sqrtf( powf(pfRe[uiStartBin],2) + powf(pfIm[uiStartBin],2) );
for (unsigned int i=uiStartBin ; i<((uiCssArraySize/2) - 1); i++) {
fFactor = fConstMag / sqrtf( powf(pfRe[i],2) + powf(pfIm[i],2) ) ;
pfRe[i] = fFactor * pfRe[i];
pfIm[i] = fFactor * pfIm[i];
float fConstMag = sqrtf( powf( pfRe[ uiStartBin ], 2 ) + powf( pfIm[ uiStartBin ], 2 ) );
for( unsigned int i = uiStartBin; i < ( ( uiCssArraySize / 2 ) - 1 ); i++ ) {
fFactor = fConstMag / sqrtf( powf( pfRe[ i ], 2 ) + powf( pfIm[ i ], 2 ) );
pfRe[ i ] = fFactor * pfRe[ i ];
pfIm[ i ] = fFactor * pfIm[ i ];
}
pfRe[(uiCssArraySize/2) - 1] = 0;
pfIm[(uiCssArraySize/2) - 1] = 0;
pfRe[ ( uiCssArraySize / 2 ) - 1 ] = 0;
pfIm[ ( uiCssArraySize / 2 ) - 1 ] = 0;
}
void bm_MaxMag(float *pfData, unsigned int uiCount, float &fValue, unsigned int &uiPosition) {
void bm_MaxMag( float *pfData, unsigned int uiCount, float &fValue, unsigned int &uiPosition ) {
float fTmp = 0.0;
uiPosition = 0;
for (unsigned int i=0 ; i<uiCount; i++) {
if (fabs(pfData[i]) > fTmp) {
for( unsigned int i = 0; i < uiCount; i++ ) {
if( fabs( pfData[ i ] ) > fTmp ) {
uiPosition = i;
fTmp= pfData[i];
fTmp = pfData[ i ];
}
}
fValue = fTmp;
}
void bm_Max(float *pfData, unsigned int uiCount, float &fValue, unsigned int &uiPosition) {
void bm_Max( float *pfData, unsigned int uiCount, float &fValue, unsigned int &uiPosition ) {
float fTmp = 0.0;
uiPosition = 0;
for (unsigned int i=0 ; i<uiCount; i++) {
if (pfData[i] > fTmp) {
for( unsigned int i = 0; i < uiCount; i++ ) {
if( pfData[ i ] > fTmp ) {
uiPosition = i;
fTmp= pfData[i];
fTmp = pfData[ i ];
}
}
fValue = fTmp ;
fValue = fTmp;
}
void bm_CyclicMove(float *pfData, unsigned int uiCount) {
void bm_CyclicMove( float *pfData, unsigned int uiCount ) {
float fTmp = 0.0;
unsigned int uiOffset = uiCount/2;
unsigned int uiOffset = uiCount / 2;
for (unsigned int i=0 ; i<uiOffset; i++) {
fTmp = pfData[i];
pfData[i] = pfData[i + uiOffset];
pfData[i + uiOffset] = fTmp;
for( unsigned int i = 0; i < uiOffset; i++ ) {
fTmp = pfData[ i ];
pfData[ i ] = pfData[ i + uiOffset ];
pfData[ i + uiOffset ] = fTmp;
}
}
void bm_FreqIdent_css(float *pfData, unsigned int uiCssArraySize) {
for (unsigned int i=0 ; i<uiCssArraySize/2; i++)
pfData[i] = 1.0;
void bm_FreqIdent_css( float *pfData, unsigned int uiCssArraySize ) {
for( unsigned int i = 0; i < uiCssArraySize / 2; i++ )
pfData[ i ] = 1.0;
memset(pfData + uiCssArraySize/2, 0, (uiCssArraySize/2) * sizeof(float));
memset( pfData + uiCssArraySize / 2, 0, ( uiCssArraySize / 2 ) * sizeof( float ) );
}
void bm_SubSampleShift_css(float *pfData, float fSubSampleShift, unsigned int uiCssArraySize) {
void bm_SubSampleShift_css( float *pfData, float fSubSampleShift, unsigned int uiCssArraySize ) {
float fPhi = 0.0;
float fCosinusPhi = 0.0;
float fSinusPhi = 0.0;
float fSinusPhi = 0.0;
float fTmpRe = 0.0;
float fTmpIm = 0.0;
float *pfRe = pfData;
float *pfIm = pfData + uiCssArraySize / 2;
float fDeltaPhi = (float)-2.0 * (float)M_PI * fSubSampleShift / (float)uiCssArraySize;
float fDeltaPhi = float( -2.0 * ITAConstants::PI_F * fSubSampleShift ) / float( uiCssArraySize );
for (unsigned int i=0; i<uiCssArraySize/2; i++) {
for( unsigned int i = 0; i < uiCssArraySize / 2; i++ ) {
fPhi = fDeltaPhi * i;
fCosinusPhi = cosf(fPhi);
fSinusPhi = sinf(fPhi);
fTmpRe = pfRe[i];
fTmpIm = pfIm[i];
pfRe[i] = fTmpRe * fCosinusPhi - fTmpIm * fSinusPhi ;
pfIm[i] = fTmpRe * fSinusPhi + fTmpIm * fCosinusPhi ;
fCosinusPhi = cosf( fPhi );
fSinusPhi = sinf( fPhi );
fTmpRe = pfRe[ i ];
fTmpIm = pfIm[ i ];
pfRe[ i ] = fTmpRe * fCosinusPhi - fTmpIm * fSinusPhi;
pfIm[ i ] = fTmpRe * fSinusPhi + fTmpIm * fCosinusPhi;
}
}
void bm_SubSampleShift_SHDI(float *pfData, float fSubSampleShift, unsigned int uiCoeffs) {
unsigned int uiDFTSize = (uiCoeffs-1)*2;
void bm_SubSampleShift_SHDI( float *pfData, float fSubSampleShift, unsigned int uiCoeffs ) {
unsigned int uiDFTSize = ( uiCoeffs - 1 ) * 2;
float fPhi, fCosinusPhi, fSinusPhi;
float fTmpRe, fTmpIm;
//float *pfRe = pfData;
//float *pfIm = pfData + uiCssArraySize / 2;
float fDeltaPhi = (float) -1.0 * (float) M_PI * fSubSampleShift / (float) uiDFTSize;
float fDeltaPhi = float( -1.0 * ITAConstants::PI_D * fSubSampleShift ) / float( uiDFTSize );
for (unsigned int i=0; i<uiCoeffs; i++) {
for( unsigned int i = 0; i < uiCoeffs; i++ ) {
fPhi = fDeltaPhi * i;
fCosinusPhi = cosf(fPhi);
fSinusPhi = sinf(fPhi);
fTmpRe = pfData[2*i];
fTmpIm = pfData[2*i+1];
pfData[2*i] = fTmpRe * fCosinusPhi - fTmpIm * fSinusPhi;
pfData[2*i+1] = fTmpRe * fSinusPhi + fTmpIm * fCosinusPhi;
fCosinusPhi = cosf( fPhi );
fSinusPhi = sinf( fPhi );
fTmpRe = pfData[ 2 * i ];
fTmpIm = pfData[ 2 * i + 1 ];
pfData[ 2 * i ] = fTmpRe * fCosinusPhi - fTmpIm * fSinusPhi;
pfData[ 2 * i + 1 ] = fTmpRe * fSinusPhi + fTmpIm * fCosinusPhi;
}
}
unsigned int bm_GetNextFFTLength(unsigned int uiLength) {
unsigned int uiFFTDegree = (unsigned int)floor(0.5 + log((float)uiLength)/log((float)2));
return ((unsigned int) pow(2.0f, (float) uiFFTDegree));
unsigned int bm_GetNextFFTLength( unsigned int uiLength ) {
unsigned int uiFFTDegree = ( unsigned int ) floor( 0.5 + log( ( float ) uiLength ) / log( ( float ) 2 ) );
return ( ( unsigned int ) pow( 2.0f, ( float ) uiFFTDegree ) );
}
......@@ -11,8 +11,10 @@
static ITAClock* pDefaultClock = NULL;
ITAClock* ITAClock::getDefaultClock() {
if (!pDefaultClock) {
ITAClock* ITAClock::getDefaultClock()
{
if( !pDefaultClock )
{
#ifdef WIN32
// Standard auf Windows-Systemen: Windows Performance Counters
pDefaultClock = ITAWinPCClock::getInstance();
......@@ -22,7 +24,7 @@ ITAClock* ITAClock::getDefaultClock() {
pDefaultClock = ITAPosixRealtimeClock::getInstance();
#endif
// Kein Standard-Zeitgeber fr diese Plattform -> Ausnahme!
if (!pDefaultClock) ITA_EXCEPT1(NOT_IMPLEMENTED, "Could not create a default clock instance (activate HAVE_POSIX if available)");
if( !pDefaultClock ) ITA_EXCEPT1( NOT_IMPLEMENTED, "Could not create a default clock instance (activate HAVE_POSIX if available)" );
}
return pDefaultClock;
......
......@@ -9,44 +9,47 @@
std::string sCurrentINIFile = "";
std::string sCurrentSection = "";
bool INIFileExists(const std::string& sINIFilename) {
bool INIFileExists( const std::string& sINIFilename )
{
// Nur pr�fen ob die Datei existiert
return doesFileExist(sINIFilename);
return doesFileExist( sINIFilename );
}
bool INIFileSectionExists(const std::string& sINIFilename, const std::string& sSection) {
std::vector<std::string> vsSects = INIFileGetSections(sINIFilename);
std::string s = toUppercase(sSection);
for (unsigned int i=0; i<vsSects.size(); i++)
if (toUppercase(vsSects[i]).compare(s) == 0) return true;