annotate dsp/chromagram/Chromagram.h @ 209:ccd2019190bf msvc

Some MSVC fixes, including (temporarily, probably) renaming the FFT source file to avoid getting it mixed up with the Vamp SDK one in our object dir
author Chris Cannam
date Thu, 01 Feb 2018 16:34:08 +0000
parents e4a57215ddee
children 50a97c8d52ed
rev   line source
cannam@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@0 2
cannam@0 3 /*
cannam@0 4 QM DSP Library
cannam@0 5
cannam@0 6 Centre for Digital Music, Queen Mary, University of London.
Chris@84 7 This file 2005-2006 Christian Landone.
Chris@84 8
Chris@84 9 This program is free software; you can redistribute it and/or
Chris@84 10 modify it under the terms of the GNU General Public License as
Chris@84 11 published by the Free Software Foundation; either version 2 of the
Chris@84 12 License, or (at your option) any later version. See the file
Chris@84 13 COPYING included with this distribution for more information.
cannam@0 14 */
cannam@0 15
cannam@0 16 #ifndef CHROMAGRAM_H
cannam@0 17 #define CHROMAGRAM_H
cannam@0 18
cannam@0 19 #include "dsp/transforms/FFT.h"
cannam@32 20 #include "base/Window.h"
cannam@0 21 #include "ConstantQ.h"
cannam@0 22
cannam@0 23 struct ChromaConfig{
Chris@189 24 int FS;
cannam@0 25 double min;
cannam@0 26 double max;
Chris@189 27 int BPO;
cannam@0 28 double CQThresh;
cannam@34 29 MathUtilities::NormaliseType normalise;
cannam@0 30 };
cannam@0 31
cannam@0 32 class Chromagram
cannam@0 33 {
cannam@0 34
cannam@0 35 public:
cannam@0 36 Chromagram( ChromaConfig Config );
cannam@0 37 ~Chromagram();
cannam@0 38
cannam@32 39 double* process( const double *data ); // time domain
cannam@32 40 double* process( const double *real, const double *imag ); // frequency domain
cannam@0 41 void unityNormalise( double* src );
cannam@0 42
cannam@0 43 // Complex arithmetic
cannam@0 44 double kabs( double real, double imag );
cannam@0 45
cannam@0 46 // Results
Chris@189 47 int getK() { return m_uK;}
Chris@189 48 int getFrameSize() { return m_frameSize; }
Chris@189 49 int getHopSize() { return m_hopSize; }
Chris@189 50
cannam@0 51 private:
cannam@0 52 int initialise( ChromaConfig Config );
cannam@0 53 int deInitialise();
cannam@32 54
cannam@32 55 Window<double> *m_window;
cannam@32 56 double *m_windowbuf;
cannam@0 57
cannam@0 58 double* m_chromadata;
cannam@0 59 double m_FMin;
cannam@0 60 double m_FMax;
Chris@189 61 int m_BPO;
Chris@189 62 int m_uK;
cannam@0 63
cannam@34 64 MathUtilities::NormaliseType m_normalise;
cannam@0 65
Chris@189 66 int m_frameSize;
Chris@189 67 int m_hopSize;
cannam@0 68
cannam@64 69 FFTReal* m_FFT;
cannam@0 70 ConstantQ* m_ConstantQ;
cannam@0 71
cannam@0 72 double* m_FFTRe;
cannam@0 73 double* m_FFTIm;
cannam@0 74 double* m_CQRe;
cannam@0 75 double* m_CQIm;
cannam@0 76
cannam@51 77 bool m_skGenerated;
cannam@0 78 };
cannam@0 79
cannam@0 80 #endif