00001 #ifndef INCLUDE_F0ESTIMATE_H 00002 #define INCLUDE_F0ESTIMATE_H 00003 /* 00004 * This is the Loris C++ Class Library, implementing analysis, 00005 * manipulation, and synthesis of digitized sounds using the Reassigned 00006 * Bandwidth-Enhanced Additive Sound Model. 00007 * 00008 * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY, without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 * 00025 * F0Estimate.h 00026 * 00027 * Implementation of an iterative alrogithm for computing an 00028 * estimate of fundamental frequency from a sequence of sinusoidal 00029 * frequencies and amplitudes using a likelihood estimator 00030 * adapted from Quatieri's Speech Signal Processing text. The 00031 * algorithm here takes advantage of the fact that spectral peaks 00032 * have already been identified and extracted in the analysis/modeling 00033 * process. 00034 * 00035 * Kelly Fitz, 28 March 2006 00036 * loris@cerlsoundgroup.org 00037 * 00038 * http://www.cerlsoundgroup.org/Loris/ 00039 * 00040 */ 00041 00042 #include <vector> 00043 00044 // begin namespace 00045 namespace Loris { 00046 00047 // --------------------------------------------------------------------------- 00048 // class F0Estimate 00049 // 00076 // 00077 00078 class F0Estimate 00079 { 00080 private: 00081 00082 double m_frequency; 00083 double m_confidence; 00084 00085 00086 00087 public: 00088 00089 // --- lifecycle --- 00090 00101 00102 F0Estimate( const std::vector<double> & amps, 00103 const std::vector<double> & freqs, 00104 double fmin, double fmax, 00105 double resolution ); 00106 00107 // default copy/assign/destroy are OK 00108 00109 00110 // Not sure whether or why these would be useful. 00111 // 00112 // F0Estimate( void ) : m_frequency( 0 ), m_confidence( 0 ) {} 00113 // F0Estimate( double f, double c ) : m_frequency( f ), m_confidence( c ) {} 00114 00115 00116 // --- accessors --- 00117 00119 00120 double frequency( void ) const { return m_frequency; } 00121 00125 00126 double confidence( void ) const { return m_confidence; } 00127 00128 00129 00130 }; // end of class F0Estimate 00131 00132 00133 } // end of namespace Loris 00134 00135 #endif // ndef INCLUDE_F0ESTIMATE_H