Skip to content
Snippets Groups Projects
Commit 0d63f150 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

change comments

parent af14829c
No related branches found
No related tags found
1 merge request!2653Add inverse FFT
...@@ -23,15 +23,6 @@ ...@@ -23,15 +23,6 @@
#include <vector> #include <vector>
//! Fourier transform of vectors (in 1D or 2D) using Fast Fourier Transform (fftw package). //! Fourier transform of vectors (in 1D or 2D) using Fast Fourier Transform (fftw package).
//!
//! Usage:
//! std::vector<double> signal, result;
//! FourierTransform ft;
//! ft.fft(signal, result)
//!
//! Given code rely on code from Jeremy Fix page, http://jeremy.fix.free.fr/spip.php?article15,
//! see also "Efficient convolution using the Fast Fourier Transform, Application in C++"
//! by Jeremy Fix, May 30, 2011
class FourierTransform { class FourierTransform {
public: public:
// 1D and 2D vectors // 1D and 2D vectors
...@@ -42,29 +33,31 @@ public: ...@@ -42,29 +33,31 @@ public:
FourierTransform(); FourierTransform();
//! FT in 1D // forward transform
void rfft(const double1d_t& source, complex1d_t& result); void rfft(const double1d_t& source, complex1d_t& result);
void irfft(const complex1d_t& source, double1d_t& result, int w_src); void rfft(const double2d_t& source, complex2d_t& result);
void ramplitude(const double1d_t& source, double1d_t& result);
//! Shift low frequency to the center of 1D FT array
static void fftshift(double1d_t& result);
static void fftshift(complex1d_t& result);
//! Shift low frequency to the edges of 1D FT array // forward transform with real-valued amplitudes in output
static void ifftshift(double1d_t& result); void ramplitude(const double1d_t& source, double1d_t& result);
static void ifftshift(complex1d_t& result); void ramplitude(const double2d_t& source, double2d_t& result);
//! FT in 2D // backward transform
void rfft(const double2d_t& source, complex2d_t& result); void irfft(const complex1d_t& source, double1d_t& result, int w_src);
void irfft(const complex2d_t& source, double2d_t& result, int w_real); void irfft(const complex2d_t& source, double2d_t& result, int w_real);
void ramplitude(const double2d_t& source, double2d_t& result);
//! Shift low frequency to the center of 2D FT array // Frequency shifts are useful for providing different representations of spectrum: with lowest
// frequency at edges of array (default output of fft) or with lowest frequency in center of
// array
// shift low frequency from corners to center
static void fftshift(double1d_t& result);
static void fftshift(complex1d_t& result);
static void fftshift(double2d_t& result); static void fftshift(double2d_t& result);
static void fftshift(complex2d_t& result); static void fftshift(complex2d_t& result);
//! Shift low frequency to the corners of 2D FT array // shift low frequency from center to corners
static void ifftshift(double1d_t& result);
static void ifftshift(complex1d_t& result);
static void ifftshift(double2d_t& result); static void ifftshift(double2d_t& result);
static void ifftshift(complex2d_t& result); static void ifftshift(complex2d_t& result);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment