diff options
author | Robin Gareus <robin@gareus.org> | 2015-10-05 16:17:49 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-10-05 16:17:49 +0200 |
commit | 22b07e0233a29d9633ffa825a79503befaf2e16e (patch) | |
tree | 1d8b06056f8e12197158f5d906319767d3dedda5 /libs/qm-dsp/dsp/onsets | |
parent | e11ba7b79d68bc1070b170236c22123966d7bcc3 (diff) |
NOOP, remove trailing tabs/whitespace.
Diffstat (limited to 'libs/qm-dsp/dsp/onsets')
-rw-r--r-- | libs/qm-dsp/dsp/onsets/DetectionFunction.cpp | 22 | ||||
-rw-r--r-- | libs/qm-dsp/dsp/onsets/DetectionFunction.h | 2 | ||||
-rw-r--r-- | libs/qm-dsp/dsp/onsets/PeakPicking.cpp | 18 | ||||
-rw-r--r-- | libs/qm-dsp/dsp/onsets/PeakPicking.h | 6 |
4 files changed, 24 insertions, 24 deletions
diff --git a/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp b/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp index ae22cfb11d..af65af8cd2 100644 --- a/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp +++ b/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp @@ -53,7 +53,7 @@ void DetectionFunction::initialise( DFConfig Config ) m_magHistory = new double[ m_halfLength ]; memset(m_magHistory,0, m_halfLength*sizeof(double)); - + m_phaseHistory = new double[ m_halfLength ]; memset(m_phaseHistory,0, m_halfLength*sizeof(double)); @@ -152,15 +152,15 @@ double DetectionFunction::runDF() case DF_HFC: retVal = HFC( m_halfLength, m_magnitude); break; - + case DF_SPECDIFF: retVal = specDiff( m_halfLength, m_magnitude); break; - + case DF_PHASEDEV: retVal = phaseDev( m_halfLength, m_thetaAngle); break; - + case DF_COMPLEXSD: retVal = complexSD( m_halfLength, m_magnitude, m_thetaAngle); break; @@ -169,7 +169,7 @@ double DetectionFunction::runDF() retVal = broadband( m_halfLength, m_magnitude); break; } - + return retVal; } @@ -195,7 +195,7 @@ double DetectionFunction::specDiff(unsigned int length, double *src) for( i = 0; i < length; i++) { temp = fabs( (src[ i ] * src[ i ]) - (m_magHistory[ i ] * m_magHistory[ i ]) ); - + diff= sqrt(temp); // (See note in phaseDev below.) @@ -230,15 +230,15 @@ double DetectionFunction::phaseDev(unsigned int length, double *srcPhase) // does significantly damage its ability to work with quieter // music, so I'm removing it and counting the result always. // Same goes for the spectral difference measure above. - + tmpVal = fabs(dev); val += tmpVal ; m_phaseHistoryOld[ i ] = m_phaseHistory[ i ] ; m_phaseHistory[ i ] = srcPhase[ i ]; } - - + + return val; } @@ -259,14 +259,14 @@ double DetectionFunction::complexSD(unsigned int length, double *srcMagnitude, d { tmpPhase = (srcPhase[ i ]- 2*m_phaseHistory[ i ]+m_phaseHistoryOld[ i ]); dev= MathUtilities::princarg( tmpPhase ); - + meas = m_magHistory[i] - ( srcMagnitude[ i ] * exp( j * dev) ); tmpReal = real( meas ); tmpImag = imag( meas ); val += sqrt( (tmpReal * tmpReal) + (tmpImag * tmpImag) ); - + m_phaseHistoryOld[ i ] = m_phaseHistory[ i ] ; m_phaseHistory[ i ] = srcPhase[ i ]; m_magHistory[ i ] = srcMagnitude[ i ]; diff --git a/libs/qm-dsp/dsp/onsets/DetectionFunction.h b/libs/qm-dsp/dsp/onsets/DetectionFunction.h index 083d0a2a06..1102ec416d 100644 --- a/libs/qm-dsp/dsp/onsets/DetectionFunction.h +++ b/libs/qm-dsp/dsp/onsets/DetectionFunction.h @@ -55,7 +55,7 @@ private: double phaseDev(unsigned int length, double *srcPhase); double complexSD(unsigned int length, double *srcMagnitude, double *srcPhase); double broadband(unsigned int length, double *srcMagnitude); - + private: void initialise( DFConfig Config ); void deInitialise(); diff --git a/libs/qm-dsp/dsp/onsets/PeakPicking.cpp b/libs/qm-dsp/dsp/onsets/PeakPicking.cpp index 472897b241..ea50223e15 100644 --- a/libs/qm-dsp/dsp/onsets/PeakPicking.cpp +++ b/libs/qm-dsp/dsp/onsets/PeakPicking.cpp @@ -41,7 +41,7 @@ void PeakPicking::initialise( PPickParams Config ) Qfilta = Config.QuadThresh.a ; Qfiltb = Config.QuadThresh.b ; Qfiltc = Config.QuadThresh.c ; - + m_DFProcessingParams.length = m_DFLength; m_DFProcessingParams.LPOrd = Config.LPOrd; m_DFProcessingParams.LPACoeffs = Config.LPACoeffs; @@ -50,7 +50,7 @@ void PeakPicking::initialise( PPickParams Config ) m_DFProcessingParams.winPost = Config.WinT.post; m_DFProcessingParams.AlphaNormParam = Config.alpha; m_DFProcessingParams.isMedianPositive = false; - + m_DFSmoothing = new DFProcess( m_DFProcessingParams ); m_workBuffer = new double[ m_DFLength ]; @@ -68,16 +68,16 @@ void PeakPicking::process( double* src, unsigned int len, vector<int> &onsets ) { if (len < 4) return; - vector <double> m_maxima; + vector <double> m_maxima; // Signal conditioning m_DFSmoothing->process( src, m_workBuffer ); - + for( unsigned int u = 0; u < len; u++) { - m_maxima.push_back( m_workBuffer[ u ] ); + m_maxima.push_back( m_workBuffer[ u ] ); } - + quadEval( m_maxima, onsets ); for(unsigned int b = 0; b < m_maxima.size(); b++) @@ -92,7 +92,7 @@ int PeakPicking::quadEval( vector<double> &src, vector<int> &idx ) vector <int> m_maxIndex; vector <int> m_onsetPosition; - + vector <double> m_maxFit; vector <double> m_poly; vector <double> m_err; @@ -123,7 +123,7 @@ int PeakPicking::quadEval( vector<double> &src, vector<int> &idx ) for (int k = -2; k <= 2; ++k) { selMax = src[ m_maxIndex[j] + k ] ; - m_maxFit.push_back(selMax); + m_maxFit.push_back(selMax); } double f = m_poly[0]; @@ -133,7 +133,7 @@ int PeakPicking::quadEval( vector<double> &src, vector<int> &idx ) { idx.push_back(m_maxIndex[j]); } - + m_maxFit.clear(); } diff --git a/libs/qm-dsp/dsp/onsets/PeakPicking.h b/libs/qm-dsp/dsp/onsets/PeakPicking.h index be6853ca8f..931c1c16e2 100644 --- a/libs/qm-dsp/dsp/onsets/PeakPicking.h +++ b/libs/qm-dsp/dsp/onsets/PeakPicking.h @@ -56,7 +56,7 @@ class PeakPicking public: PeakPicking( PPickParams Config ); virtual ~PeakPicking(); - + void process( double* src, unsigned int len, vector<int> &onsets ); @@ -64,7 +64,7 @@ private: void initialise( PPickParams Config ); void deInitialise(); int quadEval( vector<double> &src, vector<int> &idx ); - + DFProcConfig m_DFProcessingParams; unsigned int m_DFLength ; @@ -74,7 +74,7 @@ private: double* m_workBuffer; - + DFProcess* m_DFSmoothing; }; |