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

FourierTransform.h

00001 #ifndef INCLUDE_FOURIERTRANSFORM_H
00002 #define INCLUDE_FOURIERTRANSFORM_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  * FourierTransform.h
00026  *
00027  * Definition of class Loris::FourierTransform, support for the
00028  * FFTW library (www.fftw.org). Requires a compiled fttw library.
00029  *
00030  * Kelly Fitz, 15 Feb 2000
00031  * loris@cerlsoundgroup.org
00032  *
00033  * http://www.cerlsoundgroup.org/Loris/
00034  *
00035  */
00036 #include <complex>
00037 #include <vector>
00038 
00039 //  begin namespace
00040 namespace Loris {
00041 
00042 class FTimpl;
00043 
00044 // ---------------------------------------------------------------------------
00045 //  class FourierTransform
00046 //
00059 //
00060 class FourierTransform 
00061 {
00062 //  -- public interface --
00063 public:
00064    
00067    typedef std::vector< std::complex< double > >::size_type size_type;
00068 
00070     typedef std::vector< std::complex< double > >::iterator iterator;
00071 
00073     typedef std::vector< std::complex< double > >::const_iterator const_iterator;
00074 
00075 //  --- lifecycle ---
00076 
00083     FourierTransform( size_type len );
00084     
00091     FourierTransform( const FourierTransform & rhs );
00092     
00094     ~FourierTransform( void );  
00095 
00096 //  --- operators ---
00097         
00105     FourierTransform & operator= ( const FourierTransform & rhs );
00106     
00107 
00108 //  --- access/mutation ---
00109 
00120     std::complex< double > & operator[] ( size_type index )
00121     { 
00122        return _buffer[ index ]; 
00123     }
00124 
00135     const std::complex< double > & operator[] ( size_type index ) const
00136     { 
00137        return _buffer[ index ]; 
00138     }
00139 
00145     iterator begin( void )  
00146     { 
00147        return _buffer.begin(); 
00148     }
00149     
00155     iterator end( void )    
00156     { 
00157        return _buffer.end(); 
00158     }
00159 
00165     const_iterator begin( void ) const  
00166     { 
00167        return _buffer.begin(); 
00168     }
00169     
00175     const_iterator end( void ) const    
00176     { 
00177        return _buffer.end(); 
00178     }
00179 
00180 //  --- operations ---
00181         
00186     void transform( void );
00187 
00188 //  --- inquiry ---
00189 
00193     size_type size( void ) const ;
00194                 
00195 //  -- instance variables --
00196 private:
00197 
00201     std::vector< std::complex< double > > _buffer;
00202 
00203     // insulating implementation instance (defined in 
00204     // FourierTransform.C), conceals interface to FFTW
00205     FTimpl * _impl;
00206     
00207 };  //  end of class FourierTransform
00208 
00209 
00210 }   //  end of namespace Loris
00211 
00212 #endif /* ndef INCLUDE_FOURIERTRANSFORM_H */

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