Constant-Q Library
cq/CQBase.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 /*
00003     Constant-Q library
00004     Copyright (c) 2013-2014 Queen Mary, University of London
00005 
00006     Permission is hereby granted, free of charge, to any person
00007     obtaining a copy of this software and associated documentation
00008     files (the "Software"), to deal in the Software without
00009     restriction, including without limitation the rights to use, copy,
00010     modify, merge, publish, distribute, sublicense, and/or sell copies
00011     of the Software, and to permit persons to whom the Software is
00012     furnished to do so, subject to the following conditions:
00013 
00014     The above copyright notice and this permission notice shall be
00015     included in all copies or substantial portions of the Software.
00016 
00017     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00018     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00019     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00020     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
00021     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
00022     CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00023     WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00024 
00025     Except as contained in this notice, the names of the Centre for
00026     Digital Music; Queen Mary, University of London; and Chris Cannam
00027     shall not be used in advertising or otherwise to promote the sale,
00028     use or other dealings in this Software without prior written
00029     authorization.
00030 */
00031 
00032 #ifndef CQBASE_H
00033 #define CQBASE_H
00034 
00035 #include <vector>
00036 #include <complex>
00037 
00042 class CQBase
00043 {
00044 public:
00046     typedef std::complex<double> Complex;
00047 
00049     typedef std::vector<double> RealSequence;
00050 
00052     typedef std::vector<double> RealColumn;
00053 
00055     typedef std::vector<Complex> ComplexSequence;
00056 
00058     typedef std::vector<Complex> ComplexColumn;
00059 
00061     typedef std::vector<RealColumn> RealBlock;
00062 
00064     typedef std::vector<ComplexColumn> ComplexBlock;
00065 
00070     virtual bool isValid() const = 0;
00071     
00076     virtual double getSampleRate() const = 0;
00077 
00082     virtual int getBinsPerOctave() const = 0;
00083 
00088     virtual int getOctaves() const = 0; 
00089 
00094     virtual int getTotalBins() const = 0;
00095 
00100     virtual int getColumnHop() const = 0;
00101 
00106     virtual int getLatency() const = 0;
00107 
00114     virtual double getMaxFrequency() const = 0;
00115 
00123     virtual double getMinFrequency() const = 0;
00124 
00130     virtual double getBinFrequency(double bin) const = 0;
00131 };
00132 
00133 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator