Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

FFT.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * FFT algorithm interface
00004  *
00005  * This file is part of JWS (Jazz WorkShop)
00006  *
00007  * Copyright 2004 Roland Stigge
00008  *
00009  * 
00010  * JWS 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  * JWS 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 JWS; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  */
00025 
00026 #ifndef FFT_H
00027 #define FFT_H
00028 
00029 // STL headers
00030 #include <complex>
00031 
00032 // framework headers
00033 #include <glibmm/thread.h>
00034 
00035 // GNU headers
00036 extern "C" {
00037 #include <fftw3.h>
00038 }
00039 
00040 // own headers
00041 #include "globals.h"
00042 #include "Window.h"
00043 
00044 namespace JWS {
00045 
00046   class FFT {
00047     
00048     public:
00049       
00058       FFT(int n, Window<double>* cos_window = 0);
00059       
00060       ~FFT();
00061       
00067       void setInput(double* input);
00068       
00074       void getOutput(double* output) throw (Exception);
00075 
00081       void getOutput(std::complex<double>* output) throw (Exception);
00082 
00083       void execute() throw (Exception);
00084       
00085     private:
00086       int m_n;
00087       double* m_input; 
00088       std::complex<double>* m_output; 
00089       bool m_executed;
00090       fftw_plan m_plan;
00091       Window<double>* m_window;
00092       
00093       static Glib::StaticMutex m_fftw_mutex;
00094   };
00095 }
00096 
00097 #endif // FFT_H

Generated on Mon Oct 25 10:08:47 2004 for JWS by  doxygen 1.3.9.1