Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

FrequencyReference.h

00001 #ifndef INCLUDE_FREQUENCYREFERENCE_H
00002 #define INCLUDE_FREQUENCYREFERENCE_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-2004 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  * FrequencyReference.h
00026  *
00027  * Definition of class FrequencyReference.
00028  *
00029  * Kelly Fitz, 3 Dec 2001
00030  * loris@cerlsoundgroup.org
00031  *
00032  * http://www.cerlsoundgroup.org/Loris/
00033  *
00034  */
00035 
00036 #include "Envelope.h"
00037 #include "PartialList.h"
00038 #include <memory>
00039 
00040 //  begin namespace
00041 namespace Loris {
00042 
00043 class BreakpointEnvelope;
00044 
00045 // ---------------------------------------------------------------------------
00046 //  class FrequencyReference
00047 //
00048 //  Class FrequencyReference represents a reference frequency envelope
00049 //  derived from the longest Partial found in a given range of Partials,
00050 //  and in a specified (average) frequency range. This reference envelope
00051 //  can be used for channelizing the Partials in preparation for morphing
00052 //  (see Channelizer.h).
00053 //  
00054 //  FrequencyReference implements the Envelope interface (see
00055 //  Envelope.h).
00056 //
00057 class FrequencyReference : public Envelope
00058 {
00059 //  -- instance variables --
00060     std::auto_ptr< BreakpointEnvelope > _env;
00061     
00062 //  -- public interface --
00063 public:
00064 //  -- construction --
00065     FrequencyReference( PartialList::const_iterator begin, 
00066                         PartialList::const_iterator end, 
00067                         double minFreq, double maxFreq, long numSamps );
00068     /*  Construct a new FrequencyReference derived from the longest Partial
00069         in the specified half-open (STL-style) range of Partials that lies
00070         within the speficied average frequency range. Sample that longest
00071         Partial at numSamps points to construct the reference envelope.
00072      */
00073      
00074     FrequencyReference( PartialList::const_iterator begin, 
00075                         PartialList::const_iterator end, 
00076                         double minFreq, double maxFreq );
00077     /*  Construct a new FrequencyReference derived from the longest Partial
00078         in the specified half-open (STL-style) range of Partials that lies
00079         within the speficied average frequency range. Sample that longest
00080         Partial at every Breakpoint to construct the reference envelope.
00081      */
00082      
00083     FrequencyReference( const FrequencyReference & other );
00084     /*  Construct a new FrequencyReference that is an exact copy of the
00085         specified FrequencyReference.
00086      */
00087      
00088     FrequencyReference & operator= ( const FrequencyReference & other );
00089     /*  Assignment operator: make this FrequencyReference an exact copy 
00090     of the specified FrequencyReference.
00091      */
00092      
00093     ~FrequencyReference();
00094     /*  Destroy this FrequencyReference.
00095      */
00096      
00097 //  -- conversion to BreakpointEnvelope --
00098     BreakpointEnvelope envelope( void ) const;
00099     /*  Return a BreakpointEnvelope that evaluates indentically to this
00100         FrequencyReference at all time.
00101      */
00102      
00103 //  -- Envelope interface --
00104     virtual FrequencyReference * clone( void ) const;
00105     /*  Return an exact copy of this FrequencyReference (following the
00106         Prototype pattern).
00107      */
00108     
00109     virtual double valueAt( double x ) const;   
00110     /*  Return the frequency value (in Hz) of this FrequencyReference at the
00111         specified time.
00112      */
00113 
00114 };  // end of class FrequencyReference
00115 
00116 }   //  end of namespace Loris
00117 
00118 #endif  // ndef INCLUDE_FREQUENCYREFERENCE_H

Generated on Thu Apr 14 22:01:55 2005 for Loris by doxygen 1.3.4