libKeyFinder
A small C++11 library for estimating the musical key of digital audio.
fftadapter.h
1 /*************************************************************************
2 
3  Copyright 2011-2015 Ibrahim Sha'ath
4 
5  This file is part of LibKeyFinder.
6 
7  LibKeyFinder is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  LibKeyFinder is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with LibKeyFinder. If not, see <http://www.gnu.org/licenses/>.
19 
20 *************************************************************************/
21 
22 #ifndef FFTADAPTER_H
23 #define FFTADAPTER_H
24 
25 #include "constants.h"
26 
27 namespace KeyFinder {
28 
29  class FftAdapterPrivate;
30  class InverseFftAdapterPrivate;
31 
32  class FftAdapter {
33  public:
34  FftAdapter(unsigned int frameSize);
35  ~FftAdapter();
36  unsigned int getFrameSize() const;
37  void setInput(unsigned int sample, double real);
38  void execute();
39  double getOutputReal(unsigned int bin) const;
40  double getOutputImaginary(unsigned int bin) const;
41  double getOutputMagnitude(unsigned int bin) const;
42  protected:
43  unsigned int frameSize;
44  FftAdapterPrivate* priv;
45  };
46 
48  public:
49  InverseFftAdapter(unsigned int frameSize);
51  unsigned int getFrameSize() const;
52  void setInput(unsigned int sample, double real, double imaginary);
53  void execute();
54  double getOutput(unsigned int bin) const;
55  protected:
56  unsigned int frameSize;
57  InverseFftAdapterPrivate* priv;
58  };
59 
60 }
61 
62 #endif
Definition: fftadapter.h:32
Definition: fftadapter.h:47