annotate dsp/chromagram/Chromagram.h @ 96:88f3cfcff55f

A threshold (delta) is added in the peak picking parameters structure (PPickParams). It is used as an offset when computing the smoothed detection function. A constructor for the structure PPickParams is also added to set the parameters to 0 when a structure instance is created. Hence programmes using the peak picking parameter structure and which do not set the delta parameter (e.g. QM Vamp note onset detector) won't be affected by the modifications. Functions modified: - dsp/onsets/PeakPicking.cpp - dsp/onsets/PeakPicking.h - dsp/signalconditioning/DFProcess.cpp - dsp/signalconditioning/DFProcess.h
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Mon, 20 Jun 2011 19:01:48 +0100
parents e5907ae6de17
children e4a57215ddee
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{
cannam@0 24 unsigned int FS;
cannam@0 25 double min;
cannam@0 26 double max;
cannam@0 27 unsigned 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
cannam@0 47 unsigned int getK() { return m_uK;}
cannam@0 48 unsigned int getFrameSize() { return m_frameSize; }
cannam@0 49 unsigned int getHopSize() { return m_hopSize; }
cannam@0 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;
cannam@0 61 unsigned int m_BPO;
cannam@0 62 unsigned int m_uK;
cannam@0 63
cannam@34 64 MathUtilities::NormaliseType m_normalise;
cannam@0 65
cannam@0 66 unsigned int m_frameSize;
cannam@0 67 unsigned 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