# HG changeset patch # User Chris Cannam # Date 1559134526 -3600 # Node ID 50a97c8d52ed570883c60eae18c67ab37bb048ce # Parent 0076c66d2932ff3ef48d5771ae83b937f9903eba Apply fix from daschuer/mixxx:957aed58 : Use double precision for FS diff -r 0076c66d2932 -r 50a97c8d52ed dsp/chromagram/Chromagram.cpp --- 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; diff -r 0076c66d2932 -r 50a97c8d52ed dsp/chromagram/Chromagram.h --- 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; diff -r 0076c66d2932 -r 50a97c8d52ed dsp/chromagram/ConstantQ.h --- 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; diff -r 0076c66d2932 -r 50a97c8d52ed tests/TestChromagram.cpp --- 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 generateSinusoid(double frequency, - int sampleRate, + double sampleRate, int length) { vector 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 {