JayBeams
0.1
Another project to have fun coding.
|
Wrappers for the FFTW3 library. More...
Namespaces | |
detail | |
Classes | |
class | allocator |
Define an allocator based on fftw_malloc()/fftw_free() More... | |
class | plan |
Wrap FFTW3 plan objects. More... | |
class | tde_result |
A time-delay estimator (TDE) is an algorithm to compare two families of timeseries and return the estimated delay of the first family vs. More... | |
class | tde_result< boost::multi_array< T, 1, A >, value_t > |
Handles TDE result for a multi array type timeseries with dimensionality 1. More... | |
class | tde_result< boost::multi_array< T, K, A >, value_t > |
Handles TDE result for a multi array type timeseries. More... | |
class | time_delay_estimator |
A simple time delay estimator based on cross-correlation. More... | |
class | time_delay_estimator_many |
A time delay estimator based on cross-correlation. More... | |
struct | traits |
Wrap fftw_* types and operations to treat floating point values generically. More... | |
struct | traits< double > |
Wrap the FFTW types and functions for double precision float point numbers. More... | |
struct | traits< float > |
Wrap the FFTW types and functions for single precision float point numbers. More... | |
struct | traits< long double > |
Wrap the FFTW types and functions for quad precision float point numbers. More... | |
struct | traits< std::complex< T > > |
Define traits for std::complex<T> in terms of the traits for T. More... | |
Typedefs | |
template<typename value_type , std::size_t num_dims> | |
using | aligned_multi_array = boost::multi_array< value_type, num_dims, jb::fftw::allocator< value_type > > |
Alias boost::multi_array with properly allocated storage for FFTW3. More... | |
template<typename T > | |
using | aligned_vector = std::vector< T, jb::fftw::allocator< T > > |
Alias std::vector with properly allocated storage for FFTW3. More... | |
Functions | |
template<typename F > | |
traits< F >::fftw_complex_type * | fftw_cast_array (std::complex< F > *ptr) |
template<typename F > | |
traits< F >::fftw_complex_type const * | fftw_cast_array (std::complex< F > const *ptr) |
template<typename F > | |
F * | fftw_cast_array (F *ptr) |
template<typename F > | |
F const * | fftw_cast_array (F const *ptr) |
template<typename vector > | |
auto | fftw_cast (vector &in) -> decltype(fftw_cast_array(&in[0])) |
template<typename vector > | |
auto | fftw_cast (vector const &in) -> decltype(fftw_cast_array(&in[0])) |
template<typename T , std::size_t K, typename A > | |
auto | fftw_cast (boost::multi_array< T, K, A > const &a) -> decltype(fftw_cast_array(a.data())) |
template<typename T , std::size_t K, typename A > | |
auto | fftw_cast (boost::multi_array< T, K, A > &a) -> decltype(fftw_cast_array(a.data())) |
template<typename in_array_type , typename out_array_type > | |
plan< in_array_type, out_array_type > | create_forward_plan (in_array_type const &in, out_array_type &out, int flags=default_plan_flags) |
Create a plan to compute many DFTs given the input and output arrays. More... | |
template<typename in_array_type , typename out_array_type > | |
plan< in_array_type, out_array_type > | create_backward_plan (in_array_type const &in, out_array_type &out, int flags=default_plan_flags) |
Create a plan to compute many inverse DFT given the input and output arrays. More... | |
Variables | |
int constexpr | default_plan_flags |
Wrappers for the FFTW3 library.
struct jb::fftw::traits |
Wrap fftw_* types and operations to treat floating point values generically.
Type traits to handle single-precision (float / fftwf_*), double-precision (double / fftw_*) and quad-precision (long double / fftwl_*) generically in C++ code.
precision_t | the type of floating point value, must be either float, double or long double. |
Definition at line 22 of file traits.hpp.
using jb::fftw::aligned_multi_array = typedef boost::multi_array<value_type, num_dims, jb::fftw::allocator<value_type> > |
Alias boost::multi_array with properly allocated storage for FFTW3.
FFTW3 recommends using storage aligned for SIMD operations. jb::fftw defines an STL allocator to take advantage of the FFTW3 memory allocation functions that guarantee this alignment. This type alias makes it easy to create boost::multi_arrays using the allocator.
value_type | the type stored by the multi_array |
num_dims | the number of dimensions in the multi array |
Definition at line 24 of file aligned_multi_array.hpp.
using jb::fftw::aligned_vector = typedef std::vector<T, jb::fftw::allocator<T> > |
Alias std::vector with properly allocated storage for FFTW3.
FFTW3 recommends using storage aligned for SIMD operations. jb::fftw defines an STL allocator to take advantage of the FFTW3 memory allocation functions that guarantee this alignment. This type alias makes it easy to create std::vectors using the allocator.
T | the type stored by the vector |
Definition at line 22 of file aligned_vector.hpp.
plan<in_array_type, out_array_type> jb::fftw::create_backward_plan | ( | in_array_type const & | in, |
out_array_type & | out, | ||
int | flags = default_plan_flags |
||
) |
Create a plan to compute many inverse DFT given the input and output arrays.
in | the input timeseries |
out | the output timeseries |
flags | the FFTW flags for the plan |
std::invalid_argument | if the input and output vectors are not compatible |
in_array_type | the type of the input timeseries |
out_array_type | the type of the output timeseries |
Definition at line 261 of file plan.hpp.
References jb::fftw::detail::check_plan_inputs(), jb::fftw::plan< in_timeseries_type, out_timeseries_type >::create_backward_impl(), jb::fftw::plan< in_timeseries_type, out_timeseries_type >::create_backward_many_impl(), jb::detail::element_count(), fftw_cast(), and jb::detail::nsamples().
Referenced by jb::fftw::plan< timeseries_type, frequency_timeseries_type >::create_backward_impl(), and jb::fftw::plan< timeseries_type, frequency_timeseries_type >::execute().
plan<in_array_type, out_array_type> jb::fftw::create_forward_plan | ( | in_array_type const & | in, |
out_array_type & | out, | ||
int | flags = default_plan_flags |
||
) |
Create a plan to compute many DFTs given the input and output arrays.
in | the input array of timeseries |
out | the output array of timeseries |
flags | the FFTW flags for the plan |
std::invalid_argument | if the input and output vectors are not compatible |
in_array_type | the type of the input array of timeseries |
out_array_type | the type of the output array of timeseries |
Definition at line 231 of file plan.hpp.
References jb::fftw::detail::check_plan_inputs(), jb::fftw::plan< in_timeseries_type, out_timeseries_type >::create_forward_impl(), jb::fftw::plan< in_timeseries_type, out_timeseries_type >::create_forward_many_impl(), jb::detail::element_count(), fftw_cast(), and jb::detail::nsamples().
Referenced by jb::fftw::plan< timeseries_type, frequency_timeseries_type >::create_forward_impl(), and jb::fftw::plan< timeseries_type, frequency_timeseries_type >::execute().
auto jb::fftw::fftw_cast | ( | vector & | in | ) | -> decltype(fftw_cast_array(&in[0])) |
Definition at line 33 of file cast.hpp.
References fftw_cast_array().
Referenced by create_backward_plan(), create_forward_plan(), and jb::fftw::plan< timeseries_type, frequency_timeseries_type >::execute().
auto jb::fftw::fftw_cast | ( | vector const & | in | ) | -> decltype(fftw_cast_array(&in[0])) |
Definition at line 38 of file cast.hpp.
References fftw_cast_array().
auto jb::fftw::fftw_cast | ( | boost::multi_array< T, K, A > const & | a | ) | -> decltype(fftw_cast_array(a.data())) |
Definition at line 43 of file cast.hpp.
References fftw_cast_array().
auto jb::fftw::fftw_cast | ( | boost::multi_array< T, K, A > & | a | ) | -> decltype(fftw_cast_array(a.data())) |
Definition at line 49 of file cast.hpp.
References fftw_cast_array().
traits<F>::fftw_complex_type* jb::fftw::fftw_cast_array | ( | std::complex< F > * | ptr | ) |
Definition at line 12 of file cast.hpp.
Referenced by fftw_cast().
traits<F>::fftw_complex_type const* jb::fftw::fftw_cast_array | ( | std::complex< F > const * | ptr | ) |
F* jb::fftw::fftw_cast_array | ( | F * | ptr | ) |
F const* jb::fftw::fftw_cast_array | ( | F const * | ptr | ) |