Loris::FundamentalFromSamples Class Reference
#include <Fundamental.h>
List of all members.
Public Member Functions |
| FundamentalFromSamples (double winWidthHz, double precisionHz=DefaultPrecisionOver100 *0.01) |
| ~FundamentalFromSamples (void) |
| Destructor.
|
LinearEnvelope | buildEnvelope (const double *sampsBeg, const double *sampsEnd, double sampleRate, double tbeg, double tend, double interval, double lowerFreqBound, double upperFreqBound, double confidenceThreshold) |
LinearEnvelope | buildEnvelope (const double *sampsBeg, unsigned long nsamps, double sampleRate, double tbeg, double tend, double interval, double lowerFreqBound, double upperFreqBound, double confidenceThreshold) |
LinearEnvelope | buildEnvelope (const std::vector< double > &samps, double sampleRate, double tbeg, double tend, double interval, double lowerFreqBound, double upperFreqBound, double confidenceThreshold) |
value_type | estimateAt (const double *sampsBeg, const double *sampsEnd, double sampleRate, double time, double lowerFreqBound, double upperFreqBound) |
value_type | estimateAt (const double *sampsBeg, unsigned long nsamps, double sampleRate, double time, double lowerFreqBound, double upperFreqBound) |
value_type | estimateAt (const std::vector< double > &samps, double sampleRate, double time, double lowerFreqBound, double upperFreqBound) |
double | windowWidth (void) const |
void | setWindowWidth (double w) |
Detailed Description
Class FundamentalFromSamples represents an algorithm for time-varying fundamental frequency estimation based on time-frequency reassigned spectral analysis of a sequence of samples. This class is adapted from the Analyzer class (see Analyzer.h), and performs the same spectral analysis and peak extraction, but does not form Partials.
For more information about Reassigned Bandwidth-Enhanced Analysis and the Reassigned Bandwidth-Enhanced Additive Sound Model, refer to the Loris website: www.cerlsoundgroup.org/Loris/.
Constructor & Destructor Documentation
Loris::FundamentalFromSamples::FundamentalFromSamples |
( |
double |
winWidthHz, |
|
|
double |
precisionHz = DefaultPrecisionOver100 *0.01 | |
|
) |
| | |
Construct a new estimator configured with the given analysis window width (main lobe, zero-to-zero). All other spectrum analysis parameters are computed from the specified window width.
The specified precision is used to terminate the iterative estimation procedure. If unspecified, the default value, DefaultPrecisionOver100 * 100 is used.
- Parameters:
-
| windowWidthHz | is the main lobe width of the Kaiser analysis window in Hz. |
| precisionHz | is the precision in Hz with which the fundamental estimates will be made. |
Member Function Documentation
LinearEnvelope Loris::FundamentalFromSamples::buildEnvelope |
( |
const std::vector< double > & |
samps, |
|
|
double |
sampleRate, |
|
|
double |
tbeg, |
|
|
double |
tend, |
|
|
double |
interval, |
|
|
double |
lowerFreqBound, |
|
|
double |
upperFreqBound, |
|
|
double |
confidenceThreshold | |
|
) |
| | [inline] |
Construct a linear envelope from fundamental frequency estimates taken at the specified interval in seconds starting at tbeg (seconds) and ending before tend (seconds).
- Parameters:
-
| samps | is the sequence of samples |
| sampleRate | is the sampling rate (in Hz) associated with the sequence of samples (used to compute frequencies in Hz, and to convert the time from seconds to samples) |
| tbeg | is the beginning of the time interval (in seconds) |
| tend | is the end of the time interval (in seconds) |
| interval | is the time between breakpoints in the fundamental frequency envelope (in seconds) |
| lowerFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| upperFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| confidenceThreshold | is the minimum confidence level resuired for a fundamental frequency estimate to be added to the envelope. Lower confidence estimates are not added, the envelope returned will not contain breakpoints at times associated with low confidence estimates |
- Returns:
- a LinearEnvelope composed of breakpoints corresponding to the fundamental frequency estimates at samples of the span tbeg to tend at the specified sampling interval, only estimates having confidence level exceeding the specified confidence threshold are added to the envelope
LinearEnvelope Loris::FundamentalFromSamples::buildEnvelope |
( |
const double * |
sampsBeg, |
|
|
unsigned long |
nsamps, |
|
|
double |
sampleRate, |
|
|
double |
tbeg, |
|
|
double |
tend, |
|
|
double |
interval, |
|
|
double |
lowerFreqBound, |
|
|
double |
upperFreqBound, |
|
|
double |
confidenceThreshold | |
|
) |
| | [inline] |
Construct a linear envelope from fundamental frequency estimates taken at the specified interval in seconds starting at tbeg (seconds) and ending before tend (seconds).
- Parameters:
-
| samps | is the beginning of a sequence of samples |
| nsamps | is the length of the sequence of samples |
| sampleRate | is the sampling rate (in Hz) associated with the sequence of samples (used to compute frequencies in Hz, and to convert the time from seconds to samples) |
| tbeg | is the beginning of the time interval (in seconds) |
| tend | is the end of the time interval (in seconds) |
| interval | is the time between breakpoints in the fundamental frequency envelope (in seconds) |
| lowerFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| upperFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| confidenceThreshold | is the minimum confidence level resuired for a fundamental frequency estimate to be added to the envelope. Lower confidence estimates are not added, the envelope returned will not contain breakpoints at times associated with low confidence estimates |
- Returns:
- a LinearEnvelope composed of breakpoints corresponding to the fundamental frequency estimates at samples of the span tbeg to tend at the specified sampling interval, only estimates having confidence level exceeding the specified confidence threshold are added to the envelope
LinearEnvelope Loris::FundamentalFromSamples::buildEnvelope |
( |
const double * |
sampsBeg, |
|
|
const double * |
sampsEnd, |
|
|
double |
sampleRate, |
|
|
double |
tbeg, |
|
|
double |
tend, |
|
|
double |
interval, |
|
|
double |
lowerFreqBound, |
|
|
double |
upperFreqBound, |
|
|
double |
confidenceThreshold | |
|
) |
| | |
Construct a linear envelope from fundamental frequency estimates taken at the specified interval in seconds starting at tbeg (seconds) and ending before tend (seconds).
- Parameters:
-
| samps | is the beginning of a sequence of samples |
| sampsEnd | is the end of the sequence of samples |
| sampleRate | is the sampling rate (in Hz) associated with the sequence of samples (used to compute frequencies in Hz, and to convert the time from seconds to samples) |
| tbeg | is the beginning of the time interval (in seconds) |
| tend | is the end of the time interval (in seconds) |
| interval | is the time between breakpoints in the fundamental frequency envelope (in seconds) |
| lowerFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| upperFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| confidenceThreshold | is the minimum confidence level resuired for a fundamental frequency estimate to be added to the envelope. Lower confidence estimates are not added, the envelope returned will not contain breakpoints at times associated with low confidence estimates |
- Returns:
- a LinearEnvelope composed of breakpoints corresponding to the fundamental frequency estimates at samples of the span tbeg to tend at the specified sampling interval, only estimates having confidence level exceeding the specified confidence threshold are added to the envelope
value_type Loris::FundamentalFromSamples::estimateAt |
( |
const std::vector< double > & |
samps, |
|
|
double |
sampleRate, |
|
|
double |
time, |
|
|
double |
lowerFreqBound, |
|
|
double |
upperFreqBound | |
|
) |
| | [inline] |
Return an estimate of the fundamental frequency computed at the specified time. The F0Estimate returned stores the estimate of the fundamental frequency (in Hz) and the relative confidence (from 0 to 1) associated with that estimate.
- Parameters:
-
| samps | is the sequence of samples |
| sampleRate | is the sampling rate (in Hz) associated with the sequence of samples (used to compute frequencies in Hz, and to convert the time from seconds to samples) |
| time | is the time in seconds at which to attempt to estimate the fundamental frequency |
| lowerFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| upperFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
- Returns:
- the estimate of fundamental frequency in Hz and the confidence associated with that estimate (see F0Estimate.h)
value_type Loris::FundamentalFromSamples::estimateAt |
( |
const double * |
sampsBeg, |
|
|
unsigned long |
nsamps, |
|
|
double |
sampleRate, |
|
|
double |
time, |
|
|
double |
lowerFreqBound, |
|
|
double |
upperFreqBound | |
|
) |
| | [inline] |
Return an estimate of the fundamental frequency computed at the specified time. The F0Estimate returned stores the estimate of the fundamental frequency (in Hz) and the relative confidence (from 0 to 1) associated with that estimate.
- Parameters:
-
| samps | is the beginning of a sequence of samples |
| nsamps | is the length of the sequence of samples |
| sampleRate | is the sampling rate (in Hz) associated with the sequence of samples (used to compute frequencies in Hz, and to convert the time from seconds to samples) |
| time | is the time in seconds at which to attempt to estimate the fundamental frequency |
| lowerFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| upperFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
- Returns:
- the estimate of fundamental frequency in Hz and the confidence associated with that estimate (see F0Estimate.h)
value_type Loris::FundamentalFromSamples::estimateAt |
( |
const double * |
sampsBeg, |
|
|
const double * |
sampsEnd, |
|
|
double |
sampleRate, |
|
|
double |
time, |
|
|
double |
lowerFreqBound, |
|
|
double |
upperFreqBound | |
|
) |
| | |
Return an estimate of the fundamental frequency computed at the specified time. The F0Estimate returned stores the estimate of the fundamental frequency (in Hz) and the relative confidence (from 0 to 1) associated with that estimate.
- Parameters:
-
| sampsBeg | is the beginning of a sequence of samples |
| sampsEnd | is the end of the sequence of samples |
| sampleRate | is the sampling rate (in Hz) associated with the sequence of samples (used to compute frequencies in Hz, and to convert the time from seconds to samples) |
| time | is the time in seconds at which to attempt to estimate the fundamental frequency |
| lowerFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
| upperFreqBound | is the lower bound on the fundamental frequency estimate (in Hz) |
- Returns:
- the estimate of fundamental frequency in Hz and the confidence associated with that estimate (see F0Estimate.h)
void Loris::FundamentalFromSamples::setWindowWidth |
( |
double |
w |
) |
|
Set the frequency-domain main lobe width (in Hz measured between zero-crossings) of the analysis window used in spectral analysis.
- Parameters:
-
| w | is the new main lobe width in Hz |
double Loris::FundamentalFromSamples::windowWidth |
( |
void |
|
) |
const |
Return the frequency-domain main lobe width (in Hz measured between zero-crossings) of the analysis window used in spectral analysis.
The documentation for this class was generated from the following file: