GNU Radio 3.4.2 C++ API
gcp_fft_1d_r2.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2008 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 along
00018  * with this program; if not, write to the Free Software Foundation, Inc.,
00019  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00020  */
00021 #ifndef INCLUDED_GCP_FFT_1D_R2_H
00022 #define INCLUDED_GCP_FFT_1D_R2_H
00023 
00024 #include <gcell/gc_job_manager.h>
00025 #include <complex>
00026 
00027 /*!
00028  * \brief Submit a job that computes the forward or inverse FFT.
00029  *
00030  * \param mgr is the job manager instance
00031  * \param log2_fft_length is the log2 of the fft_length (4 <= x <= 12).
00032  * \param forward is true to compute the forward transform, else the inverse.
00033  * \param shift indicates if an "fftshift" should be applied to the output data
00034  * \param out is the fft_length output from FFT (must be 16-byte aligned).
00035  * \param in is the fft_length input to FFT (must be 16-byte aligned).
00036  * \param twiddle is fft_length/4 twiddle factor input to FFT (must be 16-byte aligned).
00037  * \param window is the window to be applied to the input data.
00038  *    The window length must be either 0 or fft_length (must be 16-byte aligned).
00039  *
00040  * Returns a shared_ptr to a job descriptor which should be passed to wait_job*.
00041  * Throws an exception in the event of a problem.
00042  * This uses the FFTW conventions for scaling.  That is, neither the forward nor inverse
00043  * are scaled by 1/fft_length.
00044  */
00045 gc_job_desc_sptr
00046 gcp_fft_1d_r2_submit(gc_job_manager_sptr mgr,
00047                      unsigned int log2_fft_length,
00048                      bool forward,
00049                      bool shift,
00050                      std::complex<float> *out,
00051                      const std::complex<float> *in,
00052                      const std::complex<float> *twiddle,
00053                      const float *window);
00054 
00055 /*!
00056  * \brief Compute twiddle factors 
00057  *
00058  * \param log2_fft_length is the log2 of the fft_length.
00059  * \param W is fft_length/4 twiddle factor output (must be 16-byte aligned).
00060  */
00061 void
00062 gcp_fft_1d_r2_twiddle(unsigned int log2_fft_length, std::complex<float> *W);
00063 
00064 #endif /* INCLUDED_GCP_FFT_1D_R2_H */