summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Dekker <ehendrikd@gmail.com>2019-09-26 14:16:46 +1000
committerEvan Dekker <ehendrikd@gmail.com>2019-09-26 14:16:46 +1000
commit3c33ad59412f070b76acc045136a06fd33e72011 (patch)
treebbb31e864ed3468615a9b68c7d4deebe94d21ce7 /lib
parentc8528c564720e8496040feaeb51e23c88f4307fe (diff)
parente5a1dc8e4838117689e5a381f7919c2a9f49b867 (diff)
Fix depends.py conflict
Diffstat (limited to 'lib')
-rw-r--r--lib/qm-dsp/CONTRIBUTING.md81
-rw-r--r--lib/qm-dsp/README.md59
-rw-r--r--lib/qm-dsp/README.txt35
-rw-r--r--lib/qm-dsp/base/KaiserWindow.cpp26
-rw-r--r--lib/qm-dsp/base/KaiserWindow.h44
-rw-r--r--lib/qm-dsp/base/Pitch.cpp12
-rw-r--r--lib/qm-dsp/base/Pitch.h12
-rw-r--r--lib/qm-dsp/base/Restrict.h18
-rw-r--r--lib/qm-dsp/base/SincWindow.cpp30
-rw-r--r--lib/qm-dsp/base/SincWindow.h16
-rw-r--r--lib/qm-dsp/base/Window.h56
-rw-r--r--lib/qm-dsp/dsp/chromagram/CQprecalc.cpp49850
-rw-r--r--lib/qm-dsp/dsp/chromagram/Chromagram.cpp65
-rw-r--r--lib/qm-dsp/dsp/chromagram/Chromagram.h65
-rw-r--r--lib/qm-dsp/dsp/chromagram/ConstantQ.cpp429
-rw-r--r--lib/qm-dsp/dsp/chromagram/ConstantQ.h56
-rw-r--r--lib/qm-dsp/dsp/keydetection/GetKeyMode.cpp645
-rw-r--r--lib/qm-dsp/dsp/keydetection/GetKeyMode.h206
-rw-r--r--lib/qm-dsp/dsp/mfcc/MFCC.cpp6
-rw-r--r--lib/qm-dsp/dsp/mfcc/MFCC.h4
-rw-r--r--lib/qm-dsp/dsp/onsets/DetectionFunction.cpp111
-rw-r--r--lib/qm-dsp/dsp/onsets/DetectionFunction.h30
-rw-r--r--lib/qm-dsp/dsp/onsets/PeakPicking.cpp76
-rw-r--r--lib/qm-dsp/dsp/onsets/PeakPicking.h46
-rw-r--r--lib/qm-dsp/dsp/phasevocoder/PhaseVocoder.cpp8
-rw-r--r--lib/qm-dsp/dsp/phasevocoder/PhaseVocoder.h4
-rw-r--r--lib/qm-dsp/dsp/rateconversion/Decimator.cpp211
-rw-r--r--lib/qm-dsp/dsp/rateconversion/Decimator.h20
-rw-r--r--lib/qm-dsp/dsp/rateconversion/DecimatorB.cpp19
-rw-r--r--lib/qm-dsp/dsp/rateconversion/DecimatorB.h6
-rw-r--r--lib/qm-dsp/dsp/rateconversion/Resampler.cpp107
-rw-r--r--lib/qm-dsp/dsp/rateconversion/Resampler.h5
-rw-r--r--lib/qm-dsp/dsp/rhythm/BeatSpectrum.h4
-rw-r--r--lib/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.cpp63
-rw-r--r--lib/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.h33
-rw-r--r--lib/qm-dsp/dsp/segmentation/Segmenter.cpp22
-rw-r--r--lib/qm-dsp/dsp/segmentation/Segmenter.h50
-rw-r--r--lib/qm-dsp/dsp/segmentation/cluster_melt.c382
-rw-r--r--lib/qm-dsp/dsp/segmentation/cluster_melt.h24
-rw-r--r--lib/qm-dsp/dsp/segmentation/cluster_segmenter.c441
-rw-r--r--lib/qm-dsp/dsp/segmentation/cluster_segmenter.h22
-rw-r--r--lib/qm-dsp/dsp/segmentation/segment.h37
-rw-r--r--lib/qm-dsp/dsp/signalconditioning/DFProcess.cpp163
-rw-r--r--lib/qm-dsp/dsp/signalconditioning/DFProcess.h23
-rw-r--r--lib/qm-dsp/dsp/signalconditioning/FiltFilt.cpp129
-rw-r--r--lib/qm-dsp/dsp/signalconditioning/FiltFilt.h27
-rw-r--r--lib/qm-dsp/dsp/signalconditioning/Filter.cpp150
-rw-r--r--lib/qm-dsp/dsp/signalconditioning/Filter.h76
-rw-r--r--lib/qm-dsp/dsp/signalconditioning/Framer.cpp100
-rw-r--r--lib/qm-dsp/dsp/signalconditioning/Framer.h44
-rw-r--r--lib/qm-dsp/dsp/tempotracking/DownBeat.cpp68
-rw-r--r--lib/qm-dsp/dsp/tempotracking/DownBeat.h20
-rw-r--r--lib/qm-dsp/dsp/tempotracking/TempoTrack.cpp942
-rw-r--r--lib/qm-dsp/dsp/tempotracking/TempoTrack.h216
-rw-r--r--lib/qm-dsp/dsp/tempotracking/TempoTrackV2.cpp261
-rw-r--r--lib/qm-dsp/dsp/tempotracking/TempoTrackV2.h42
-rw-r--r--lib/qm-dsp/dsp/tonal/ChangeDetectionFunction.cpp207
-rw-r--r--lib/qm-dsp/dsp/tonal/ChangeDetectionFunction.h27
-rw-r--r--lib/qm-dsp/dsp/tonal/TCSgram.cpp48
-rw-r--r--lib/qm-dsp/dsp/tonal/TCSgram.h42
-rw-r--r--lib/qm-dsp/dsp/tonal/TonalEstimator.cpp130
-rw-r--r--lib/qm-dsp/dsp/tonal/TonalEstimator.h112
-rw-r--r--lib/qm-dsp/dsp/transforms/DCT.cpp91
-rw-r--r--lib/qm-dsp/dsp/transforms/DCT.h85
-rw-r--r--lib/qm-dsp/dsp/transforms/FFT.cpp2
-rw-r--r--lib/qm-dsp/dsp/transforms/FFT.h10
-rw-r--r--lib/qm-dsp/dsp/wavelet/Wavelet.cpp81
-rw-r--r--lib/qm-dsp/dsp/wavelet/Wavelet.h71
-rw-r--r--lib/qm-dsp/ext/kissfft/CHANGELOG4
-rw-r--r--lib/qm-dsp/ext/kissfft/README134
-rw-r--r--lib/qm-dsp/ext/kissfft/README.simd78
-rw-r--r--lib/qm-dsp/ext/kissfft/TIPS39
-rw-r--r--lib/qm-dsp/ext/kissfft/kiss_fft.c5
-rw-r--r--lib/qm-dsp/ext/kissfft/kissfft.hh300
-rw-r--r--lib/qm-dsp/ext/kissfft/tools/kiss_fftr.c (renamed from lib/qm-dsp/ext/kissfft/kiss_fftr.c)2
-rw-r--r--lib/qm-dsp/ext/kissfft/tools/kiss_fftr.h (renamed from lib/qm-dsp/ext/kissfft/kiss_fftr.h)2
-rw-r--r--lib/qm-dsp/hmm/hmm.c1323
-rw-r--r--lib/qm-dsp/hmm/hmm.h58
-rw-r--r--lib/qm-dsp/key_rounding.patch253
-rw-r--r--lib/qm-dsp/maths/Correlation.cpp32
-rw-r--r--lib/qm-dsp/maths/Correlation.h11
-rw-r--r--lib/qm-dsp/maths/CosineDistance.cpp3
-rw-r--r--lib/qm-dsp/maths/CosineDistance.h10
-rw-r--r--lib/qm-dsp/maths/KLDivergence.cpp2
-rw-r--r--lib/qm-dsp/maths/KLDivergence.h19
-rw-r--r--lib/qm-dsp/maths/MathAliases.h51
-rw-r--r--lib/qm-dsp/maths/MathUtilities.cpp220
-rw-r--r--lib/qm-dsp/maths/MathUtilities.h57
-rw-r--r--lib/qm-dsp/maths/MedianFilter.h71
-rw-r--r--lib/qm-dsp/maths/Polyfit.h421
-rw-r--r--lib/qm-dsp/maths/nan-inf.h4
-rw-r--r--lib/qm-dsp/maths/pca/pca.c449
-rw-r--r--lib/qm-dsp/maths/pca/pca.h4
-rw-r--r--lib/qm-dsp/mixxx-changes.patch110
-rw-r--r--lib/qm-dsp/thread/AsynchronousTask.h12
-rw-r--r--lib/qm-dsp/thread/BlockAllocator.h4
-rw-r--r--lib/qm-dsp/thread/Thread.h4
97 files changed, 5336 insertions, 54949 deletions
diff --git a/lib/qm-dsp/CONTRIBUTING.md b/lib/qm-dsp/CONTRIBUTING.md
new file mode 100644
index 0000000000..00b09d8148
--- /dev/null
+++ b/lib/qm-dsp/CONTRIBUTING.md
@@ -0,0 +1,81 @@
+
+Contributing
+============
+
+The qm-dsp library is maintained in a Github repository at
+https://github.com/c4dm/qm-dsp.
+
+
+Reporting bugs
+--------------
+
+Please use Github issues for bug reports. Try to make them as specific
+as possible. For example, describe an input that triggers some
+particular behaviour, and tell us how that behaviour differs from what
+you expected.
+
+If your bug can be reproduced by processing an audio file using one of
+the QM Vamp Plugins (https://github.com/c4dm/qm-vamp-plugins), which
+are built using this library, that might be a good way to illustrate
+the problem.
+
+
+Pull requests
+-------------
+
+We're happy to see pull requests, and can pull them directly in some
+circumstances.
+
+ * Please make sure your change compiles without warnings and passes
+ the existing tests.
+
+ * Please follow the code style guidelines (see below).
+
+ * Please make it as easy as possible to verify the behaviour of the
+ pull request, for example by adding a new test in the `tests`
+ directory. This library has only limited test coverage, but we
+ would like to expand it, and prefer not to make changes unless they
+ are backed by tests.
+
+ * Please provide your changes under terms which permit Queen Mary
+ University of London to relicense the code for commercial
+ purposes. The qm-dsp library as a whole is provided under the GPL,
+ but QM also make commercial licences available separately, and
+ cannot accept any pull request whose copyright status would prevent
+ that. In practice, this means any non-trivial change not
+ originating from QM must be explicitly licensed using a BSD-like
+ licence text, either in the source file itself or in an
+ accompanying file. See `thread/BlockAllocator.h` for an example of
+ typical language.
+
+Please note also that fixes which change the behaviour of the existing
+QM Vamp Plugins will need particularly close scrutiny - these are
+reasonably widely used and, even where they have defects, changes may
+cause problems for users and will at least need to be documented with
+the plugins. For this reason it may take some time for such changes to
+be reviewed or integrated.
+
+
+Code style
+----------
+
+ * C++ code must compile with the C++98 standard, except for the unit
+ tests which are C++14
+
+ * Classes are named `LikeThis` - functions, methods, and local
+ variables `likeThis` - class member variables `m_likeThis`
+
+ * Indentation is four spaces at a time (no tabs)
+
+ * The opening brace for a block goes at the end of the line, except
+ at the start of a function or class definition where it gets a line
+ of its own
+
+ * Please use braces around any conditional or loop block that is not
+ on the same line as the test
+
+ * Please keep lines to no more than 80 characters in length
+
+ * Avoid using unsigned int types, unless doing bit manipulation (see
+ http://soundsoftware.ac.uk/c-pitfall-unsigned.html for rationale)
+
diff --git a/lib/qm-dsp/README.md b/lib/qm-dsp/README.md
new file mode 100644
index 0000000000..20bcb60f04
--- /dev/null
+++ b/lib/qm-dsp/README.md
@@ -0,0 +1,59 @@
+
+QM-DSP library
+==============
+
+This is a C++ library of functions for Digital Signal Processing and
+Music Informatics purposes developed in the [Centre for Digital
+Music](http://c4dm.eecs.qmul.ac.uk) at Queen Mary, University of
+London.
+
+It is used by [QM Vamp Plugins](http://isophonics.net/QMVampPlugins)
+amongst other things.
+
+Despite the assertive name "qm-dsp", it is not "the official QM DSP
+library", just one library for DSP that happens to have been written
+at QM. It got this name because nothing else was using it at the time.
+
+
+Compiling the library
+---------------------
+
+ - Linux: `make -f build/linux/Makefile.linux64`
+
+ - Mac: `make -f build/osx/Makefile.osx`
+
+ - Windows (MSVC): Use the project file `build/msvc/QMDSP.vcxproj`
+
+To build and run unit tests as well, add the `test` target to your
+Make invocation, e.g. `make -f build/linux/Makefile.linux64
+test`. Tests require the Boost library.
+
+
+Licence
+-------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version. See the file COPYING included with
+this distribution for more information.
+
+This code is Copyright (c) 2006-2019 Queen Mary, University of London,
+with the following exceptions:
+
+ - `ext/kissfft` - Copyright (c) 2003-2010 Mark Borgerding
+
+ - `maths/pca/pca.c` - Fionn Murtagh, from StatLib, used with permission
+
+ - `maths/Polyfit.h` - by Allen Miller, David J Taylor and others;
+also for Delphi in the the JEDI Math Library, under the Mozilla Public
+License
+
+ - `thread/BlockAllocator.h` - derived from FSB Allocator by Juha
+Nieminen, under a BSD-style license
+
+See individual files for further authorship details.
+
+If you wish to use this code in a proprietary application or product
+for which the terms of the GPL are not appropriate, please contact QM
+Innovation https://www.qminnovation.co.uk/ for licensing terms.
diff --git a/lib/qm-dsp/README.txt b/lib/qm-dsp/README.txt
deleted file mode 100644
index 6927c7a1b8..0000000000
--- a/lib/qm-dsp/README.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-QM-DSP library
-==============
-
-This is a C++ library of functions for DSP and Music Informatics
-purposes developed at Queen Mary, University of London.
-It is used by the QM Vamp Plugins (q.v.) amongst other things.
-
-This code is Copyright (c) 2006-2015 Queen Mary, University of London,
-with the following exceptions:
-
-ext/kissfft -- Copyright (c) 2003-2010 Mark Borgerding
-
-maths/pca.c -- Fionn Murtagh, from StatLib; with permission
-
-maths/Polyfit.h -- Allen Miller, David J Taylor and others; also for
-Delphi in the the JEDI Math Library, under the Mozilla Public License
-
-thread/BlockAllocator.h -- derived from FSB Allocator by Juha Nieminen,
-under BSD-style license
-
-See individual files for further authorship details.
-
-
-License
-=======
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version. See the file
-COPYING included with this distribution for more information.
-
-
diff --git a/lib/qm-dsp/base/KaiserWindow.cpp b/lib/qm-dsp/base/KaiserWindow.cpp
index 4fe838e090..306b6aaacd 100644
--- a/lib/qm-dsp/base/KaiserWindow.cpp
+++ b/lib/qm-dsp/base/KaiserWindow.cpp
@@ -17,27 +17,27 @@
KaiserWindow::Parameters
KaiserWindow::parametersForTransitionWidth(double attenuation,
- double transition)
+ double transition)
{
Parameters p;
p.length = 1 + (attenuation > 21.0 ?
- ceil((attenuation - 7.95) / (2.285 * transition)) :
- ceil(5.79 / transition));
+ ceil((attenuation - 7.95) / (2.285 * transition)) :
+ ceil(5.79 / transition));
p.beta = (attenuation > 50.0 ?
- 0.1102 * (attenuation - 8.7) :
- attenuation > 21.0 ?
- 0.5842 * pow(attenuation - 21.0, 0.4) + 0.07886 * (attenuation - 21.0) :
- 0);
+ 0.1102 * (attenuation - 8.7) :
+ attenuation > 21.0 ?
+ 0.5842 * pow(attenuation - 21.0, 0.4) + 0.07886 * (attenuation - 21.0) :
+ 0);
return p;
}
static double besselTerm(double x, int i)
{
if (i == 0) {
- return 1;
+ return 1;
} else {
- double f = MathUtilities::factorial(i);
- return pow(x/2, i*2) / (f*f);
+ double f = MathUtilities::factorial(i);
+ return pow(x/2, i*2) / (f*f);
}
}
@@ -45,7 +45,7 @@ static double bessel0(double x)
{
double b = 0.0;
for (int i = 0; i < 20; ++i) {
- b += besselTerm(x, i);
+ b += besselTerm(x, i);
}
return b;
}
@@ -56,8 +56,8 @@ KaiserWindow::init()
double denominator = bessel0(m_beta);
bool even = (m_length % 2 == 0);
for (int i = 0; i < (even ? m_length/2 : (m_length+1)/2); ++i) {
- double k = double(2*i) / double(m_length-1) - 1.0;
- m_window.push_back(bessel0(m_beta * sqrt(1.0 - k*k)) / denominator);
+ double k = double(2*i) / double(m_length-1) - 1.0;
+ m_window.push_back(bessel0(m_beta * sqrt(1.0 - k*k)) / denominator);
}
for (int i = 0; i < (even ? m_length/2 : (m_length-1)/2); ++i) {
m_window.push_back(m_window[int(m_length/2) - i - 1]);
diff --git a/lib/qm-dsp/base/KaiserWindow.h b/lib/qm-dsp/base/KaiserWindow.h
index f16a4b6c16..23afe8c687 100644
--- a/lib/qm-dsp/base/KaiserWindow.h
+++ b/lib/qm-dsp/base/KaiserWindow.h
@@ -11,8 +11,8 @@
COPYING included with this distribution for more information.
*/
-#ifndef KAISER_WINDOW_H
-#define KAISER_WINDOW_H
+#ifndef QM_DSP_KAISER_WINDOW_H
+#define QM_DSP_KAISER_WINDOW_H
#include <vector>
#include <cmath>
@@ -26,8 +26,8 @@ class KaiserWindow
{
public:
struct Parameters {