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/chromagram | |
parent | e11ba7b79d68bc1070b170236c22123966d7bcc3 (diff) |
NOOP, remove trailing tabs/whitespace.
Diffstat (limited to 'libs/qm-dsp/dsp/chromagram')
-rw-r--r-- | libs/qm-dsp/dsp/chromagram/Chromagram.cpp | 10 | ||||
-rw-r--r-- | libs/qm-dsp/dsp/chromagram/Chromagram.h | 8 | ||||
-rw-r--r-- | libs/qm-dsp/dsp/chromagram/ConstantQ.cpp | 12 | ||||
-rw-r--r-- | libs/qm-dsp/dsp/chromagram/ConstantQ.h | 6 |
4 files changed, 18 insertions, 18 deletions
diff --git a/libs/qm-dsp/dsp/chromagram/Chromagram.cpp b/libs/qm-dsp/dsp/chromagram/Chromagram.cpp index 83a6661d17..5901082352 100644 --- a/libs/qm-dsp/dsp/chromagram/Chromagram.cpp +++ b/libs/qm-dsp/dsp/chromagram/Chromagram.cpp @@ -27,14 +27,14 @@ Chromagram::Chromagram( ChromaConfig Config ) : } int Chromagram::initialise( ChromaConfig Config ) -{ +{ m_FMin = Config.min; // min freq m_FMax = Config.max; // max freq m_BPO = Config.BPO; // bins per octave m_normalise = Config.normalise; // if frame normalisation is required // No. of constant Q bins - m_uK = ( unsigned int ) ceil( m_BPO * log(m_FMax/m_FMin)/log(2.0)); + m_uK = ( unsigned int ) ceil( m_BPO * log(m_FMax/m_FMin)/log(2.0)); // Create array for chroma result m_chromadata = new double[ m_BPO ]; @@ -49,7 +49,7 @@ int Chromagram::initialise( ChromaConfig Config ) ConstantQConfig.max = m_FMax; ConstantQConfig.BPO = m_BPO; ConstantQConfig.CQThresh = Config.CQThresh; - + // Initialise ConstantQ operator m_ConstantQ = new ConstantQ( ConstantQConfig ); @@ -57,7 +57,7 @@ int Chromagram::initialise( ChromaConfig Config ) m_frameSize = m_ConstantQ->getfftlength(); m_hopSize = m_ConstantQ->gethop(); - // Initialise FFT object + // Initialise FFT object m_FFT = new FFTReal(m_frameSize); m_FFTRe = new double[ m_frameSize ]; @@ -161,7 +161,7 @@ double* Chromagram::process( const double *real, const double *imag ) // Calculate ConstantQ frame m_ConstantQ->process( real, imag, m_CQRe, m_CQIm ); - + // add each octave of cq data into Chromagram const unsigned octaves = (int)floor(double( m_uK/m_BPO))-1; for (unsigned octave = 0; octave <= octaves; octave++) diff --git a/libs/qm-dsp/dsp/chromagram/Chromagram.h b/libs/qm-dsp/dsp/chromagram/Chromagram.h index 37af153be3..f04ffda83a 100644 --- a/libs/qm-dsp/dsp/chromagram/Chromagram.h +++ b/libs/qm-dsp/dsp/chromagram/Chromagram.h @@ -32,17 +32,17 @@ struct ChromaConfig{ class Chromagram { -public: +public: Chromagram( ChromaConfig Config ); ~Chromagram(); - + double* process( const double *data ); // time domain double* process( const double *real, const double *imag ); // frequency domain void unityNormalise( double* src ); // Complex arithmetic double kabs( double real, double imag ); - + // Results unsigned int getK() { return m_uK;} unsigned int getFrameSize() { return m_frameSize; } @@ -54,7 +54,7 @@ private: Window<double> *m_window; double *m_windowbuf; - + double* m_chromadata; double m_FMin; double m_FMax; diff --git a/libs/qm-dsp/dsp/chromagram/ConstantQ.cpp b/libs/qm-dsp/dsp/chromagram/ConstantQ.cpp index 222fd80a36..fa6c32c26b 100644 --- a/libs/qm-dsp/dsp/chromagram/ConstantQ.cpp +++ b/libs/qm-dsp/dsp/chromagram/ConstantQ.cpp @@ -109,14 +109,14 @@ void ConstantQ::sparsekernel() sk->js.reserve( m_FFTLength*2 ); sk->real.reserve( m_FFTLength*2 ); sk->imag.reserve( m_FFTLength*2 ); - + // for each bin value K, calculate temporal kernel, take its fft to //calculate the spectral kernel then threshold it to make it sparse and //add it to the sparse kernels matrix double squareThreshold = m_CQThresh * m_CQThresh; FFT m_FFT(m_FFTLength); - + for (unsigned k = m_uK; k--; ) { for (unsigned u=0; u < m_FFTLength; u++) @@ -152,13 +152,13 @@ void ConstantQ::sparsekernel() //do fft of hammingWindow m_FFT.process( 0, hammingWindowRe, hammingWindowIm, transfHammingWindowRe, transfHammingWindowIm ); - + for (unsigned j=0; j<( m_FFTLength ); j++) { // perform thresholding const double squaredBin = squaredModule( transfHammingWindowRe[ j ], transfHammingWindowIm[ j ]); if (squaredBin <= squareThreshold) continue; - + // Insert non-zero position indexes, doubled because they are floats sk->is.push_back(j); sk->js.push_back(k); @@ -266,7 +266,7 @@ double* ConstantQ::process( const double* fftdata ) const double *real = &(sk->real[0]); const double *imag = &(sk->imag[0]); const unsigned int sparseCells = sk->real.size(); - + for (unsigned i = 0; i<sparseCells; i++) { const unsigned row = cqbin[i]; @@ -335,7 +335,7 @@ void ConstantQ::process(const double *FFTRe, const double* FFTIm, const double *real = &(sk->real[0]); const double *imag = &(sk->imag[0]); const unsigned int sparseCells = sk->real.size(); - + for (unsigned i = 0; i<sparseCells; i++) { const unsigned row = cqbin[i]; diff --git a/libs/qm-dsp/dsp/chromagram/ConstantQ.h b/libs/qm-dsp/dsp/chromagram/ConstantQ.h index c06f60a9d0..597e3d0087 100644 --- a/libs/qm-dsp/dsp/chromagram/ConstantQ.h +++ b/libs/qm-dsp/dsp/chromagram/ConstantQ.h @@ -29,7 +29,7 @@ struct CQConfig{ }; class ConstantQ { - + //public functions incl. sparsekernel so can keep out of loop in main public: void process( const double* FFTRe, const double* FFTIm, @@ -46,7 +46,7 @@ public: double out = 0.54 - 0.46*cos(2*PI*n/len); return(out); } - + int getnumwin() { return m_numWin;} double getQ() { return m_dQ;} int getK() {return m_uK ;} @@ -56,7 +56,7 @@ public: private: void initialise( CQConfig Config ); void deInitialise(); - + double* m_CQdata; unsigned int m_FS; double m_FMin; |