Loris::Fundamental Class Reference

#include <Fundamental.h>

Inheritance diagram for Loris::Fundamental:

Loris::Envelope

List of all members.

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 Fundamentalclone (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


Detailed Description

Fundamental represents a time varying estimate of fundamental frequency based on maximum likelihood analysis of a sequence of Partials. The estimate can be queried at a specific time or a LinearEnvelope can be constructed by sampling the fundamental frequency estiamte at regular intervals.

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).


Constructor & Destructor Documentation

template<typename Iter>
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.

Parameters:
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


Member Function Documentation

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_).

Parameters:
time is the time at which to estimate the fundamental
Returns:
the estimate of fundamental frequency in Hz
Exceptions:
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.

Parameters:
time is the time at which to estimate the fundamental
Returns:
the estimate of fundamental frequency in Hz
Exceptions:
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_).

Parameters:
interval is the time between breakpoints in the fundamental envelope
Returns:
a new LinearEnvelope
Exceptions:
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_).

Parameters:
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
Returns:
a new LinearEnvelope
Exceptions:
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.

Returns:
the ampitude threshold in dB

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.

Parameters:
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.

Returns:
the resolution in Hz

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.

Parameters:
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).

Returns:
a new Fundamental instance

Implements Loris::Envelope.


Member Data Documentation

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.

Parameters:
time is the time at which to estimate the fundamental
Returns:
the estimate of fundamental frequency in Hz


The documentation for this class was generated from the following file:

Generated on Sun Aug 17 17:01:53 2008 for Loris by  doxygen 1.5.5