add doxygen via opencode
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
/*! \file pifft.h
|
||||
* \ingroup Math
|
||||
* \ingroup FFTW
|
||||
* \~\brief
|
||||
* \~english FFT, IFFT and Hilbert transformations
|
||||
* \~russian БПФ, ОБПФ и преобразования Гильберта
|
||||
*/
|
||||
//! \addtogroup Math
|
||||
//! \{
|
||||
//! \file pifft.h
|
||||
//! \brief
|
||||
//! \~english Declares \a PIFFT classes
|
||||
//! \~russian Объявление классов \a PIFFT
|
||||
//! \~\authors
|
||||
//! \~english Ivan Pelipenko peri4ko@yandex.ru; Andrey Bychkov work.a.b@yandex.ru
|
||||
//! \~russian Иван Пелипенко peri4ko@yandex.ru; Андрей Бычков work.a.b@yandex.ru
|
||||
//! \~\}
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Class for FFT, IFFT and Hilbert transformations
|
||||
@@ -64,16 +67,40 @@
|
||||
|
||||
# include "pip_fftw_export.h"
|
||||
|
||||
//! \addtogroup Math
|
||||
//! \{
|
||||
//! \class PIFFT_double
|
||||
//! \brief
|
||||
//! \~english Fast Fourier Transform implementation for double precision.
|
||||
//! \~russian Реализация быстрого преобразования Фурье для двойной точности.
|
||||
//! \~\}
|
||||
//! \sa \a PIFFT_float, \a PIFFTW
|
||||
class PIP_EXPORT PIFFT_double {
|
||||
public:
|
||||
//! \~english Default constructor.
|
||||
//! \~russian Конструктор по умолчанию.
|
||||
PIFFT_double();
|
||||
|
||||
//! \~english Calculate FFT from complex vector.
|
||||
//! \~russian Вычисление БПФ из комплексного вектора.
|
||||
PIVector<complexd> * calcFFT(const PIVector<complexd> & val);
|
||||
//! \~english Calculate FFT from real vector.
|
||||
//! \~russian Вычисление БПФ из вещественного вектора.
|
||||
PIVector<complexd> * calcFFT(const PIVector<double> & val);
|
||||
//! \~english Calculate inverse FFT.
|
||||
//! \~russian Вычисление обратного БПФ.
|
||||
PIVector<complexd> * calcFFTinverse(const PIVector<complexd> & val);
|
||||
//! \~english Calculate Hilbert transform.
|
||||
//! \~russian Вычисление преобразования Гильберта.
|
||||
PIVector<complexd> * calcHilbert(const PIVector<double> & val);
|
||||
//! \~english Get amplitude spectrum.
|
||||
//! \~russian Получить амплитудный спектр.
|
||||
PIVector<double> getAmplitude() const;
|
||||
//! \~english Get real part.
|
||||
//! \~russian Получить действительную часть.
|
||||
PIVector<double> getReal() const;
|
||||
//! \~english Get imaginary part.
|
||||
//! \~russian Получить мнимую часть.
|
||||
PIVector<double> getImag() const;
|
||||
|
||||
private:
|
||||
@@ -118,16 +145,40 @@ private:
|
||||
void ftbase_ffttwcalc(PIVector<double> * a, int aoffset, int n1, int n2);
|
||||
};
|
||||
|
||||
//! \addtogroup Math
|
||||
//! \{
|
||||
//! \class PIFFT_float
|
||||
//! \brief
|
||||
//! \~english Fast Fourier Transform implementation for single precision.
|
||||
//! \~russian Реализация быстрого преобразования Фурье для одинарной точности.
|
||||
//! \~\}
|
||||
//! \sa \a PIFFT_double, \a PIFFTW
|
||||
class PIP_EXPORT PIFFT_float {
|
||||
public:
|
||||
//! \~english Default constructor.
|
||||
//! \~russian Конструктор по умолчанию.
|
||||
PIFFT_float();
|
||||
|
||||
//! \~english Calculate FFT from complex vector.
|
||||
//! \~russian Вычисление БПФ из комплексного вектора.
|
||||
PIVector<complexf> * calcFFT(const PIVector<complexf> & val);
|
||||
//! \~english Calculate FFT from real vector.
|
||||
//! \~russian Вычисление БПФ из вещественного вектора.
|
||||
PIVector<complexf> * calcFFT(const PIVector<float> & val);
|
||||
//! \~english Calculate inverse FFT.
|
||||
//! \~russian Вычисление обратного БПФ.
|
||||
PIVector<complexf> * calcFFTinverse(const PIVector<complexf> & val);
|
||||
//! \~english Calculate Hilbert transform.
|
||||
//! \~russian Вычисление преобразования Гильберта.
|
||||
PIVector<complexf> * calcHilbert(const PIVector<float> & val);
|
||||
//! \~english Get amplitude spectrum.
|
||||
//! \~russian Получить амплитудный спектр.
|
||||
PIVector<float> getAmplitude() const;
|
||||
//! \~english Get real part.
|
||||
//! \~russian Получить действительную часть.
|
||||
PIVector<float> getReal() const;
|
||||
//! \~english Get imaginary part.
|
||||
//! \~russian Получить мнимую часть.
|
||||
PIVector<float> getImag() const;
|
||||
|
||||
private:
|
||||
@@ -171,6 +222,7 @@ private:
|
||||
void ftbase_fftirltrec(PIVector<float> * a, int astart, int astride, PIVector<float> * b, int bstart, int bstride, int m, int n);
|
||||
void ftbase_ffttwcalc(PIVector<float> * a, int aoffset, int n1, int n2);
|
||||
};
|
||||
//! \~\}
|
||||
|
||||
typedef PIFFT_double PIFFT;
|
||||
typedef PIFFT_double PIFFTd;
|
||||
@@ -178,40 +230,63 @@ typedef PIFFT_float PIFFTf;
|
||||
|
||||
# ifndef CC_VC
|
||||
|
||||
# define _PIFFTW_H(type) \
|
||||
class PIP_FFTW_EXPORT _PIFFTW_P_##type##_ { \
|
||||
public: \
|
||||
_PIFFTW_P_##type##_(); \
|
||||
~_PIFFTW_P_##type##_(); \
|
||||
const PIVector<complex<type>> & calcFFT(const PIVector<complex<type>> & in); \
|
||||
const PIVector<complex<type>> & calcFFTR(const PIVector<type> & in); \
|
||||
const PIVector<complex<type>> & calcFFTI(const PIVector<complex<type>> & in); \
|
||||
void preparePlan(int size, int op); \
|
||||
void * impl; \
|
||||
};
|
||||
# define _PIFFTW_H(type) \
|
||||
class PIP_FFTW_EXPORT _PIFFTW_P_##type##_ { \
|
||||
public: \
|
||||
_PIFFTW_P_##type##_(); \
|
||||
~_PIFFTW_P_##type##_(); \
|
||||
const PIVector<complex<type>> & calcFFT(const PIVector<complex<type>> & in); \
|
||||
const PIVector<complex<type>> & calcFFTR(const PIVector<type> & in); \
|
||||
const PIVector<complex<type>> & calcFFTI(const PIVector<complex<type>> & in); \
|
||||
void preparePlan(int size, int op); \
|
||||
void * impl; \
|
||||
};
|
||||
_PIFFTW_H(float)
|
||||
_PIFFTW_H(double)
|
||||
_PIFFTW_H(ldouble)
|
||||
|
||||
//! \addtogroup FFTW
|
||||
//! \{
|
||||
//! \class PIFFTW
|
||||
//! \brief
|
||||
//! \~english FFTW wrapper for arbitrary precision types.
|
||||
//! \~russian Обёртка FFTW для типов произвольной точности.
|
||||
//! \~\}
|
||||
//! \note Requires linking against libfftw3
|
||||
//! \sa \a PIFFT_double, \a PIFFT_float
|
||||
template<typename T>
|
||||
class PIFFTW {
|
||||
public:
|
||||
//! \~english Default constructor.
|
||||
//! \~russian Конструктор по умолчанию.
|
||||
explicit PIFFTW() {
|
||||
p = 0;
|
||||
newP(p);
|
||||
}
|
||||
//! \~english Destructor.
|
||||
//! \~russian Деструктор.
|
||||
~PIFFTW() { deleteP(p); }
|
||||
|
||||
//! \~english Calculate FFT from complex vector.
|
||||
//! \~russian Вычисление БПФ из комплексного вектора.
|
||||
inline const PIVector<complex<T>> & calcFFT(const PIVector<complex<T>> & in) { return PIVector<complex<T>>().resize(in.size()); }
|
||||
//! \~english Calculate FFT from real vector.
|
||||
//! \~russian Вычисление БПФ из вещественного вектора.
|
||||
inline const PIVector<complex<T>> & calcFFT(const PIVector<T> & in) { return PIVector<complex<T>>().resize(in.size()); }
|
||||
//! \~english Calculate inverse FFT.
|
||||
//! \~russian Вычисление обратного БПФ.
|
||||
inline const PIVector<complex<T>> & calcFFTinverse(const PIVector<complex<T>> & in) { return PIVector<complex<T>>().resize(in.size()); }
|
||||
|
||||
//! \~english FFT operation type.
|
||||
//! \~russian Тип операции БПФ.
|
||||
enum FFT_Operation {
|
||||
foReal,
|
||||
foComplex,
|
||||
foInverse
|
||||
};
|
||||
|
||||
//! \~english Prepare computation plan.
|
||||
//! \~russian Подготовить план вычислений.
|
||||
inline void preparePlan(int size, FFT_Operation op) {}
|
||||
|
||||
private:
|
||||
@@ -222,6 +297,7 @@ private:
|
||||
|
||||
void * p;
|
||||
};
|
||||
//! \~\}
|
||||
|
||||
|
||||
template<>
|
||||
|
||||
Reference in New Issue
Block a user