changeset 465:50a97c8d52ed

Apply fix from daschuer/mixxx:957aed58 : Use double precision for FS
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 29 May 2019 13:55:26 +0100
parents 0076c66d2932
children 46375e6d1b54
files dsp/chromagram/Chromagram.cpp dsp/chromagram/Chromagram.h dsp/chromagram/ConstantQ.h tests/TestChromagram.cpp
diffstat 4 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dsp/chromagram/Chromagram.cpp	Wed May 29 13:55:07 2019 +0100
+++ b/dsp/chromagram/Chromagram.cpp	Wed May 29 13:55:26 2019 +0100
@@ -44,7 +44,7 @@
 
     // Populate CQ config structure with parameters
     // inherited from the Chroma config
-    ConstantQConfig.FS	 = Config.FS;
+    ConstantQConfig.FS = Config.FS;
     ConstantQConfig.min = m_FMin;
     ConstantQConfig.max = m_FMax;
     ConstantQConfig.BPO = m_BPO;
--- a/dsp/chromagram/Chromagram.h	Wed May 29 13:55:07 2019 +0100
+++ b/dsp/chromagram/Chromagram.h	Wed May 29 13:55:26 2019 +0100
@@ -20,8 +20,8 @@
 #include "base/Window.h"
 #include "ConstantQ.h"
 
-struct ChromaConfig{
-    int FS;
+struct ChromaConfig {
+    double FS;
     double min;
     double max;
     int BPO;
--- a/dsp/chromagram/ConstantQ.h	Wed May 29 13:55:07 2019 +0100
+++ b/dsp/chromagram/ConstantQ.h	Wed May 29 13:55:26 2019 +0100
@@ -20,8 +20,8 @@
 #include "maths/MathAliases.h"
 #include "maths/MathUtilities.h"
 
-struct CQConfig{
-    unsigned int FS;   // samplerate
+struct CQConfig {
+    double FS;         // samplerate
     double min;        // minimum frequency
     double max;        // maximum frequency
     unsigned int BPO;  // bins per octave
@@ -58,7 +58,7 @@
     void deInitialise();
 	
     double* m_CQdata;
-    unsigned int m_FS;
+    double m_FS;
     double m_FMin;
     double m_FMax;
     double m_dQ;
--- a/tests/TestChromagram.cpp	Wed May 29 13:55:07 2019 +0100
+++ b/tests/TestChromagram.cpp	Wed May 29 13:55:26 2019 +0100
@@ -30,7 +30,7 @@
 }
 
 vector<double> generateSinusoid(double frequency,
-                                int sampleRate,
+                                double sampleRate,
                                 int length)
 {
     vector<double> buffer;
@@ -50,7 +50,7 @@
 BOOST_AUTO_TEST_CASE(sinusoid_12tET)
 {
     double concertA = 440.0;
-    int sampleRate = 44100;
+    double sampleRate = 44100;
     int bpo = 60;
 
     ChromaConfig config {