diff options
author | Maximilian Stiefel <stiefel.maximilian@online.de> | 2018-04-06 16:51:30 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-04-28 15:51:23 +0200 |
commit | 3068ab96dda9a05b4e3a6178354d6e228b4bf18d (patch) | |
tree | 8eddeee21a921f6c222391e0538d2f9049468010 /gr-fft | |
parent | 89f279aad64681b38a9b5fa8099c8e121cc7861d (diff) |
Improved documentation for FFT block.
Fixes #1694
Diffstat (limited to 'gr-fft')
-rw-r--r-- | gr-fft/include/gnuradio/fft/fft_vcc.h | 33 | ||||
-rw-r--r-- | gr-fft/include/gnuradio/fft/fft_vfc.h | 36 |
2 files changed, 64 insertions, 5 deletions
diff --git a/gr-fft/include/gnuradio/fft/fft_vcc.h b/gr-fft/include/gnuradio/fft/fft_vcc.h index 1e09521b4f..28f6d1d0d4 100644 --- a/gr-fft/include/gnuradio/fft/fft_vcc.h +++ b/gr-fft/include/gnuradio/fft/fft_vcc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008,2012 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2012,2018 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,6 +32,29 @@ namespace gr { /*! * \brief Compute forward or reverse FFT. complex vector in / complex vector out. * \ingroup fourier_analysis_blk + * + * The FFT operation is defined for a vector \f$x\f$ with \f$N\f$ uniformly + * sampled points by + * + * \f[ X(a) = \sum_{k=0}^{N-1} x(a) \cdot e^{-j 2\pi k a / N} \f] + * + * \f$ X = FFT\{x\} \f$ is the the FFT transform of \f$x(a)\f$, \f$j\f$ is + * the imaginary unit, \f$k\f$ and \f$a\f$ range from \f$0\f$ to \f$N-1\f$. + * + * The IFFT operation is defined for a vector \f$y\f$ with \f$N\f$ + * uniformly sampled points by + * + * \f[ Y(b) = \sum_{k=0}^{N-1} y(b) \cdot e^{j 2\pi k b / N} \f] + * + * \f$Y = IFFT\{y\}\f$ is the the inverse FFT transform of \f$y(b)\f$, + * \f$j\f$ is the imaginary unit, \f$k\f$ and \f$b\f$ range from \f$0\f$ to + * \f$N-1\f$. + * + * \b Note, that due to the underlying FFTW library, the output of a FFT + * followed by an IFFT (or the other way arround) will be scaled i.e. + * \f$FFT\{ \, IFFT\{x\} \,\} = N \cdot x \neq x\f$. + * + * \see http://www.fftw.org/faq/section3.html#whyscaled */ class FFT_API fft_vcc : virtual public sync_block { @@ -39,7 +62,13 @@ namespace gr { // gr::fft::fft_vcc::sptr typedef boost::shared_ptr<fft_vcc> sptr; - + /*! \brief + * \param[in] fft_size N. + * \param[in] forward True performs FFT, False performs IFFT. + * \param[in] window Window function to be used. + * \param[in] shifted True moves DC carrier to the middle. + * \param[in] nthreads Number of underlying threads. + */ static sptr make(int fft_size, bool forward, const std::vector<float> &window, bool shift=false, int nthreads=1); diff --git a/gr-fft/include/gnuradio/fft/fft_vfc.h b/gr-fft/include/gnuradio/fft/fft_vfc.h index 91ed81fb17..5639465ab5 100644 --- a/gr-fft/include/gnuradio/fft/fft_vfc.h +++ b/gr-fft/include/gnuradio/fft/fft_vfc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010,2012 Free Software Foundation, Inc. + * Copyright 2004,2010,2012,2018 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,16 +30,46 @@ namespace gr { namespace fft { /*! - * \brief Compute forward or reverse FFT. float vector in / complex vector out. + * \brief Compute forward or reverse FFT. complex vector in / complex vector out. * \ingroup fourier_analysis_blk + * + * The FFT operation is defined for a vector \f$x\f$ with \f$N\f$ uniformly + * sampled points by + * + * \f[ X(a) = \sum_{k=0}^{N-1} x(a) \cdot e^{-j 2\pi k a / N} \f] + * + * \f$ X = FFT\{x\} \f$ is the the FFT transform of \f$x(a)\f$, \f$j\f$ is + * the imaginary unit, \f$k\f$ and \f$a\f$ range from \f$0\f$ to \f$N-1\f$. + * + * The IFFT operation is defined for a vector \f$y\f$ with \f$N\f$ + * uniformly sampled points by + * + * \f[ Y(b) = \sum_{k=0}^{N-1} y(b) \cdot e^{j 2\pi k b / N} \f] + * + * \f$Y = IFFT\{y\}\f$ is the the inverse FFT transform of \f$y(b)\f$, + * \f$j\f$ is the imaginary unit, \f$k\f$ and \f$b\f$ range from \f$0\f$ to + * \f$N-1\f$. + * + * \b Note, that due to the underlying FFTW library, the output of a FFT + * followed by an IFFT (or the other way arround) will be scaled i.e. + * \f$FFT\{ \, IFFT\{x\} \,\} = N \cdot x \neq x\f$. + * + * \see http://www.fftw.org/faq/section3.html#whyscaled */ - class FFT_API fft_vfc : virtual public sync_block + class FFT_API fft_vfc : virtual public sync_block { public: // gr::fft::fft_vfc::sptr typedef boost::shared_ptr<fft_vfc> sptr; + /*! \brief + * \param[in] fft_size N. + * \param[in] forward True performs FFT, False performs IFFT. + * \param[in] window Window function to be used. + * \param[in] shifted True moves DC carrier to the middle. + * \param[in] nthreads Number of underlying threads. + */ static sptr make(int fft_size, bool forward, const std::vector<float> &window, int nthreads=1); |