00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PITCHACF_H
00020 #define PITCHACF_H
00021
00022 #include "Typedefs.h"
00023 #include "Debug.h"
00024
00025 #include "PeakDetection.h"
00026 #include "PeakInterpolation.h"
00027 #include "Autocorrelation.h"
00028
00055 class PitchACF {
00056 protected:
00057 int _fftSize;
00058 int _halfSize;
00059 int _minimumPeakWidth;
00060 int _peakCandidateCount;
00061
00062 Real _samplerate;
00063
00064 PeakDetection _peak;
00065 PeakInterpolation _peakInterp;
00066 Autocorrelation _acorr;
00067
00068 MatrixXR _acorred;
00069
00070 public:
00088 PitchACF(int fftSize = 1024, Real samplerate = 1.0, int minimumPeakWidth = 6, int peakCandidateCount = 10);
00089
00093 ~PitchACF();
00094
00095 void setup();
00096 void reset();
00097
00126 void process(const MatrixXR& spectrums, MatrixXR* pitches, MatrixXR* saliencies);
00127
00134 int fftSize() const;
00135
00142 void setFftSize( int size, bool callSetup = true );
00143
00151 int minimumPeakWidth() const;
00152
00159 void setMinimumPeakWidth( int width, bool callSetup = true );
00160
00170 int peakCandidateCount() const;
00171
00179 void setPeakCandidateCount( int count, bool callSetup = true );
00180
00187 Real samplerate() const;
00188
00194 void setSamplerate( Real frequency, bool callSetup = true );
00195
00196 };
00197
00198 #endif