27 #include "../system/eptexception.h"
28 #include "../system/log.h"
29 #include "../math/mathtools.h"
72 EptAssert(f > 0 && f < 20000,
"Freqency must be in [0,20000]");
73 static const double lnfmin = log(
fmin);
115 EptAssert(f > 0 && f < 20000,
"Frequency must in the range (0,20000)");
132 EptAssert (B >= 0,
"The inharmonicity must be positive");
135 LogW(
"Inharmonicity larger than 1 ignored");
170 EptAssert(f >= 0 && f < 20000,
"Freqency must be below 20000 and greater than 0");
189 EptAssert(f >= 0 && f < 20000,
"Freqency must be below 20000 and greater than 0");
225 "Spectrum size must match the total number of bins");
247 EptAssert(s.size() < 200,
"Peak list should not be unreasonably large");
double getRecordedFrequency() const
Get recorded frequency.
void setTunedFrequency(double f)
Set tuned frequency.
void setPeaks(const PeakListType &s)
Copy map of peaks.
PeakListType mPeaks
List of identified peaks.
double mOverpull
Overpull in cents.
const PeakListType & getPeaks() const
Get a read-only reference to mPeaks.
void setMeasuredInharmonicity(double f)
Set estimated inharmonicity.
void setComputedFrequency(double f)
Set computed frequency.
void setRecordedFrequency(const double f)
Set recorded frequency.
static const int NumberOfBins
Total number of slots: 9 octaves.
static const int BinsPerOctave
Number of slots per ocatave (here 1 cent)
double mRecognitionQuality
Accuracy of higher partials (in cents)
void setOverpull(double cents)
Set overpull in cents.
bool mRecorded
Is the key already recorded?
static double IndexToFrequency(double m)
Convert continuous slot index to frequency in Hz.
void setSpectrum(const SpectrumType &s)
Copy spectrum to mSpectrum.
double mRecordedFrequency
Recorded frequency of 1st partial in Hz.
double getComputedFrequency() const
Get computed frequency.
double getMeasuredInharmonicity() const
Get estimated inharmonicity.
static double FrequencyToRealIndex(double f)
Convert frequency to real-valued logbin index.
void setRecognitionQuality(double f)
Set quality of recognition.
void clear()
Clear all data elements of the Key.
double getRecognitionQuality() const
Get quality of recognition.
std::vector< double > SpectrumType
Type of a log-binned spectrum.
double mMeasuredInharmonicity
Measured inharmonicity of recorded signal.
SpectrumType mSpectrum
Logarithmically organized spectrum.
const SpectrumType & getSpectrum() const
Get a read-only reference to mSpectrum.
double mComputedFrequency
Computed frequency in Hz (tuning curve)
static int FrequencyToIndex(double f)
Convert frequency to logbin index.
double getTunedFrequency() const
Get tuned frequency.
std::map< double, double > PeakListType
Type for a peak map.
double getOverpull() const
Get overpull in cents.
static const double fmin
Mimimal frequency of logbinned spectrum in Hz.
double mTunedFrequency
Tuned frequency in Hz.