diff dsp/chromagram/ConstantQ.h @ 505:930b5b0f707d

Merge branch 'codestyle-and-tidy'
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 05 Jun 2019 12:55:15 +0100
parents af5b7ef02aa7
children
line wrap: on
line diff
--- a/dsp/chromagram/ConstantQ.h	Thu May 30 16:18:13 2019 +0100
+++ b/dsp/chromagram/ConstantQ.h	Wed Jun 05 12:55:15 2019 +0100
@@ -13,8 +13,8 @@
     COPYING included with this distribution for more information.
 */
 
-#ifndef CONSTANTQ_H
-#define CONSTANTQ_H
+#ifndef QM_DSP_CONSTANTQ_H
+#define QM_DSP_CONSTANTQ_H
 
 #include <vector>
 #include "maths/MathAliases.h"
@@ -24,54 +24,46 @@
     double FS;         // samplerate
     double min;        // minimum frequency
     double max;        // maximum frequency
-    unsigned int BPO;  // bins per octave
+    int BPO;           // bins per octave
     double CQThresh;   // threshold
 };
 
-class ConstantQ {
-	
-//public functions incl. sparsekernel so can keep out of loop in main
+class ConstantQ
+{
 public:
-    void process( const double* FFTRe, const double* FFTIm,
-                  double* CQRe, double* CQIm );
-
-    ConstantQ( CQConfig Config );
+    ConstantQ(CQConfig config);
     ~ConstantQ();
 
-    double* process( const double* FFTData );
+    void process(const double* FFTRe, const double* FFTIm,
+                 double* CQRe, double* CQIm);
+
+    double* process(const double* FFTData);
 
     void sparsekernel();
 
-    double hamming(int len, int n) {
-	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 ;}
-    int getfftlength() { return m_FFTLength;}
-    int gethop() { return m_hop;}
+    double getQ() { return m_dQ; }
+    int getK() { return m_uK; }
+    int getFFTLength() { return m_FFTLength; }
+    int getHop() { return m_hop; }
 
 private:
-    void initialise( CQConfig Config );
+    void initialise(CQConfig config);
     void deInitialise();
-	
+        
     double* m_CQdata;
     double m_FS;
     double m_FMin;
     double m_FMax;
     double m_dQ;
     double m_CQThresh;
-    unsigned int m_numWin;
-    unsigned int m_hop;
-    unsigned int m_BPO;
-    unsigned int m_FFTLength;
-    unsigned int m_uK;
+    int m_hop;
+    int m_BPO;
+    int m_FFTLength;
+    int m_uK;
 
     struct SparseKernel {
-        std::vector<unsigned> is;
-        std::vector<unsigned> js;
+        std::vector<int> is;
+        std::vector<int> js;
         std::vector<double> imag;
         std::vector<double> real;
     };