gri_fft.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2003 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 #ifndef _GRI_FFT_H_
00023 #define _GRI_FFT_H_
00024 
00025 /*
00026  * Wrappers for FFTW single precision 1d dft
00027  */
00028 
00029 #include <gr_complex.h>
00030 
00036 class gri_fft_complex {
00037   int         d_fft_size;
00038   gr_complex *d_inbuf;
00039   gr_complex *d_outbuf;
00040   void       *d_plan;
00041   
00042 public:
00043   gri_fft_complex (int fft_size, bool forward = true);
00044   virtual ~gri_fft_complex ();
00045 
00046   /*
00047    * These return pointers to buffers owned by gri_fft_complex into which
00048    * input and output take place.  It's done this way in order to
00049    * ensure optimal alignment for SIMD instructions.
00050    */
00051   gr_complex *get_inbuf ()  const { return d_inbuf; }
00052   gr_complex *get_outbuf () const { return d_outbuf; }
00053 
00054   int inbuf_length ()  const { return d_fft_size; }
00055   int outbuf_length () const { return d_fft_size; }
00056 
00060   void execute ();
00061 };
00062 
00067 class gri_fft_real_fwd {
00068   int         d_fft_size;
00069   float      *d_inbuf;
00070   gr_complex *d_outbuf;
00071   void       *d_plan;
00072   
00073 public:
00074   gri_fft_real_fwd (int fft_size);
00075   virtual ~gri_fft_real_fwd ();
00076 
00077   /*
00078    * These return pointers to buffers owned by gri_fft_real_fwd into
00079    * which input and output take place.  It's done this way in order
00080    * to ensure optimal alignment for SIMD instructions.
00081    */
00082   float *get_inbuf ()      const { return d_inbuf; }
00083   gr_complex *get_outbuf () const { return d_outbuf; }
00084 
00085   int inbuf_length ()  const { return d_fft_size; }
00086   int outbuf_length () const { return d_fft_size / 2 + 1; }
00087 
00091   void execute ();
00092 };
00093 
00098 class gri_fft_real_rev {
00099   int         d_fft_size;
00100   gr_complex *d_inbuf;
00101   float      *d_outbuf;
00102   void       *d_plan;
00103   
00104 public:
00105   gri_fft_real_rev (int fft_size);
00106   virtual ~gri_fft_real_rev ();
00107 
00108   /*
00109    * These return pointers to buffers owned by gri_fft_real_rev into
00110    * which input and output take place.  It's done this way in order
00111    * to ensure optimal alignment for SIMD instructions.
00112    */
00113   gr_complex *get_inbuf () const { return d_inbuf; }
00114   float *get_outbuf () const { return d_outbuf; }
00115 
00116   int inbuf_length ()  const { return d_fft_size / 2 + 1; }
00117   int outbuf_length () const { return d_fft_size; }
00118 
00122   void execute ();
00123 };
00124 
00125 #endif

Generated on Thu Mar 5 09:01:12 2009 for GNU Radio 3.1.3 by  doxygen 1.5.8