#include <Fundamental.h>

Public Member Functions | |
| template<typename Iter> | |
| Fundamental (Iter begin_partials, Iter end_partials, double fmin, double fmax) | |
| double | estimateAt (double time) const |
| double | operator() (double time) const |
| LinearEnvelope | constructEnvelope (double interval) const |
| LinearEnvelope | constructEnvelope (double t1, double t2, double interval) const |
| double | ampThreshold (void) const |
| void | setAmpThreshold (double x) |
| double | freqResolution (void) const |
| void | setFreqResolution (double x) |
| virtual Fundamental * | clone (void) const |
| virtual double | valueAt (double time) const |
| Return the value of this Envelope at the specified time. | |
Static Public Attributes | |
| static const double | DefaultThreshold |
| static const double | DefaultResolution |
| the default amplitude threshold in dB | |
The reliability of the estimate depends on the quality of the analysis, so make sure that the partials yield a good reconstruction before attempting to estimate the fundamental.
Fundamental implements the Envelope interface (see Envelope.h).
| Loris::Fundamental::Fundamental | ( | Iter | begin_partials, | |
| Iter | end_partials, | |||
| double | fmin, | |||
| double | fmax | |||
| ) | [inline] |
Construct a fundamental estimator for a sequence of Partials. [begin_partials, end_partials) must specify a valid range of Partials. f1 and f2 are frequency bounds on the search for a likely estimate of the fundamental (a narrower range will speed up the search). Throws InvalidArgument if f1==f2 or or if either frequency is negative.
| begin_partials | is the beginning of a sequence of Partials. | |
| end_partials | is the end of a sequence of Partials. | |
| fmin | is the lower bound on the fundamental frequency estimate | |
| fmax | is the lower bound on the fundamental frequency estimate |
| double Loris::Fundamental::estimateAt | ( | double | time | ) | const |
Return the estimate of the fundamental frequency at the specified time. Throws InvalidArgument if there are no Partials having sufficient energy to contribute to an estimate of the fundamental frequency at the specified time. Throws InvalidObject if no likely estimate is found in the frequency range (freqMin_, freqMax_).
| time | is the time at which to estimate the fundamental |
| InvalidObject | if no likely estimate is found in the frequency range (freqMin_, freqMax_) at the specified time. | |
| InvalidArgument | if there are no Partials having sufficient energy to contribute to an estimate of the fundamental frequency at the specified time. |
| double Loris::Fundamental::operator() | ( | double | time | ) | const |
Function call operator, same as estimateAt, for using Fundamental as a functor.
| time | is the time at which to estimate the fundamental |
| InvalidObject | if no likely estimate is found in the frequency range (freqMin_, freqMax_) at the specified time. | |
| InvalidArgument | if there are no Partials having sufficient energy to contribute to an estimate of the fundamental frequency at the specified time. |
| LinearEnvelope Loris::Fundamental::constructEnvelope | ( | double | interval | ) | const |
Return a LinearEnvelope that evaluates to a linear envelope approximation to the fundamental frequency estimate sampled at regular intervals. interval is the sampling interval in seconds. Throws InvalidArgument if no Partials have sufficient energy to contribute to an estimate of the fundamental frequency at any time in the range [t1,t2]. Throws InvalidObject if no likely estimate is found in the frequency range (freqMin_, freqMax_).
| interval | is the time between breakpoints in the fundamental envelope |
| InvalidObject | if no likely estimate is found in the frequency range (freqMin_, freqMax_) at any time. | |
| InvalidArgument | if there are no Partials having sufficient energy to contribute to an estimate of the fundamental frequency at any time. |
| LinearEnvelope Loris::Fundamental::constructEnvelope | ( | double | t1, | |
| double | t2, | |||
| double | interval | |||
| ) | const |
Return a LinearEnvelope that evaluates to a linear envelope approximation to the fundamental frequency estimate sampled at regular intervals. Consider only the time between t1 and t2. interval is the sampling interval in seconds. Throws InvalidArgument if no Partials have sufficient energy to contribute to an estimate of the fundamental frequency at any time in the range [t1,t2]. Throws InvalidObject if no likely estimate is found in the frequency range (freqMin_, freqMax_).
| t1 | is the beginning of the time interval | |
| t2 | is the end of the time interval | |
| interval | is the time between breakpoints in the fundamental envelope |
| InvalidObject | if no likely estimate is found in the frequency range (freqMin_, freqMax_) at any time during the specified range. | |
| InvalidArgument | if there are no Partials having sufficient energy to contribute to an estimate of the fundamental frequency at any time during the specified range. |
| double Loris::Fundamental::ampThreshold | ( | void | ) | const [inline] |
Get the minimum Partial amplitude in dB (relative to a full amplitude sine wave), quieter Partials are ignored when estimating the fundamental.
| void Loris::Fundamental::setAmpThreshold | ( | double | x | ) |
Get the minimum Partial amplitude in dB (relative to a full amplitude sine wave), quieter Partials are ignored when estimating the fundamental.
| x | is the new amplitude threshold |
| double Loris::Fundamental::freqResolution | ( | void | ) | const [inline] |
Get the resolution of the fundamental frequency estimates. Estimates of fundamental frequency are computed iteratively until within this many Hz of the local most likely value.
| void Loris::Fundamental::setFreqResolution | ( | double | x | ) |
Set the resolution of the fundamental frequency estimates. Estimates of fundamental frequency are computed iteratively until within this many Hz of the local most likely value.
| x | is the new resolution in Hz |
| virtual Fundamental* Loris::Fundamental::clone | ( | void | ) | const [inline, virtual] |
Return an exact copy of this FrequencyReference (following the Prototype pattern).
Implements Loris::Envelope.
const double Loris::Fundamental::DefaultThreshold [static] |
Same as estimateAt: Return the estimate of the fundamental frequency at the specified time. Throws InvalidArgument if there are no Partials having sufficient energy to contribute to an estimate of the fundamental frequency at the specified time.
| time | is the time at which to estimate the fundamental |
1.5.5