JayBeams  0.1
Another project to have fun coding.
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
jb::fftw::time_delay_estimator_many< array_t > Class Template Reference

A time delay estimator based on cross-correlation. More...

#include <time_delay_estimator_many.hpp>

Public Types

Type traits
using array_type = array_t
 The input timeseries type. More...
 
using element_type = typename jb::detail::array_traits< array_type >::element_type
 The values stored in the input timeseries. More...
 
using precision_type = typename jb::extract_value_type< element_type >::precision
 Extract T out of std::complex<T>, otherwise simply T. More...
 
using complex_type = std::complex< precision_type >
 complex_type use by FFT plans frequency array type More...
 
using frequency_array_type = typename jb::detail::aligned_container< complex_type, array_type >::array_type
 The type used to store the DFT of the input timeseries. More...
 
using output_array_type = typename jb::detail::aligned_container< precision_type, array_type >::array_type
 The type used to store the inverse of the DFT. More...
 
using dplan = jb::fftw::plan< array_type, frequency_array_type >
 The execution plan to apply the (forward) DFT. More...
 
using iplan = jb::fftw::plan< frequency_array_type, output_array_type >
 The execution plan to apply the inverse (aka backward) DFT. More...
 
using confidence_type = jb::fftw::tde_result< array_t, precision_type >
 The type used to store the TDE confidence between two timeseries. More...
 
using estimated_delay_type = jb::fftw::tde_result< array_t, std::size_t >
 The type used to store the estimated_delay between two timeseries. More...
 
using sum2_type = jb::fftw::tde_result< array_t, precision_type >
 The sqr sum of a timeseries. More...
 

Public Member Functions

 time_delay_estimator_many (array_type &a, array_type &b)
 Constructs a time delay estimator using a and b as prototypes for the arguments. More...
 
void estimate_delay (confidence_type &confidence, estimated_delay_type &estimated_delay, array_type &a, array_type &b, sum2_type const &sum2)
 Compute the time-delay estimate between two timeseries a and b. More...
 

Static Private Member Functions

static int planning_flags ()
 Determine the correct FFTW planning flags given the inputs. More...
 

Private Attributes

frequency_array_type tmpa_
 tmpa_ : timeseries to store the result of FFT(a) More...
 
frequency_array_type tmpb_
 tmpb_ : timeseries to store the result of FFT(b) More...
 
dplan a2tmpa_
 a2tmpa_ : fftw plan to execute FFT(a) More...
 
dplan b2tmpb_
 b2tmpb_ : fftw plan to execute FFT(b) More...
 
output_array_type out_
 out_ : timeseries to store the result of inverse FFT More...
 
iplan tmpa2out_
 tmpa2out : fftw plan to execute inverse FFT of a timeseries More...
 
std::size_t nsamples_
 nsamples : num samples of timeseries More...
 
std::size_t num_timeseries_
 num_timeseries : num of timeseries contained in a and b More...
 

Detailed Description

template<typename array_t>
class jb::fftw::time_delay_estimator_many< array_t >

A time delay estimator based on cross-correlation.

Timeseries are implemented as standard containers (e.g. vector<>), as well as boost multi arrays of N dimensions

Template Parameters
array_ttimeseries array type

Definition at line 25 of file time_delay_estimator_many.hpp.

Member Typedef Documentation

◆ array_type

template<typename array_t >
using jb::fftw::time_delay_estimator_many< array_t >::array_type = array_t

The input timeseries type.

Definition at line 33 of file time_delay_estimator_many.hpp.

◆ complex_type

template<typename array_t >
using jb::fftw::time_delay_estimator_many< array_t >::complex_type = std::complex<precision_type>

complex_type use by FFT plans frequency array type

Definition at line 44 of file time_delay_estimator_many.hpp.

◆ confidence_type

template<typename array_t >
using jb::fftw::time_delay_estimator_many< array_t >::confidence_type = jb::fftw::tde_result<array_t, precision_type>

The type used to store the TDE confidence between two timeseries.

Definition at line 61 of file time_delay_estimator_many.hpp.

◆ dplan

template<typename array_t >
using jb::fftw::time_delay_estimator_many< array_t >::dplan = jb::fftw::plan<array_type, frequency_array_type>

The execution plan to apply the (forward) DFT.

Definition at line 55 of file time_delay_estimator_many.hpp.

◆ element_type

template<typename array_t >
using jb::fftw::time_delay_estimator_many< array_t >::element_type = typename jb::detail::array_traits<array_type>::element_type

The values stored in the input timeseries.

Definition at line 37 of file time_delay_estimator_many.hpp.

◆ estimated_delay_type

template<typename array_t >
using jb::fftw::time_delay_estimator_many< array_t >::estimated_delay_type = jb::fftw::tde_result<array_t, std::size_t>

The type used to store the estimated_delay between two timeseries.

Definition at line 64 of file time_delay_estimator_many.hpp.

◆ frequency_array_type

The type used to store the DFT of the input timeseries.

Definition at line 48 of file time_delay_estimator_many.hpp.

◆ iplan

The execution plan to apply the inverse (aka backward) DFT.

Definition at line 58 of file time_delay_estimator_many.hpp.

◆ output_array_type

The type used to store the inverse of the DFT.

Definition at line 52 of file time_delay_estimator_many.hpp.

◆ precision_type

template<typename array_t >
using jb::fftw::time_delay_estimator_many< array_t >::precision_type = typename jb::extract_value_type<element_type>::precision

Extract T out of std::complex<T>, otherwise simply T.

Definition at line 41 of file time_delay_estimator_many.hpp.

◆ sum2_type

template<typename array_t >
using jb::fftw::time_delay_estimator_many< array_t >::sum2_type = jb::fftw::tde_result<array_t, precision_type>

The sqr sum of a timeseries.

Definition at line 67 of file time_delay_estimator_many.hpp.

Constructor & Destructor Documentation

◆ time_delay_estimator_many()

template<typename array_t >
jb::fftw::time_delay_estimator_many< array_t >::time_delay_estimator_many ( array_type a,
array_type b 
)
inline

Constructs a time delay estimator using a and b as prototypes for the arguments.

The optimal algorithm to compute the FFTs used in the cross correlation depends on the size of the input parameters and their memory alignment.

The FFTW library modifies the arguments to compute the optimal execution plan, do not assume the values are unmodified.

Parameters
amulti array timeseries
bmulti array timeseries

Definition at line 84 of file time_delay_estimator_many.hpp.

References jb::detail::array_shape().

Member Function Documentation

◆ estimate_delay()

template<typename array_t >
void jb::fftw::time_delay_estimator_many< array_t >::estimate_delay ( confidence_type confidence,
estimated_delay_type estimated_delay,
array_type a,
array_type b,
sum2_type const &  sum2 
)
inline

Compute the time-delay estimate between two timeseries a and b.

Parameters
confidenceto return the TDE(a,b) confidence
estimated_delayto return the result of TDE(a,b)
ainput timeseries, FFTW library might modify their values
binput timeseries, FFTW library might modify their values
sum2contains sqr sum of one of the timeseries (a or b)

Definition at line 107 of file time_delay_estimator_many.hpp.

References jb::fftw::time_delay_estimator_many< array_t >::a2tmpa_, jb::detail::array_shape(), jb::fftw::time_delay_estimator_many< array_t >::b2tmpb_, jb::detail::element_count(), jb::fftw::plan< in_timeseries_type, out_timeseries_type >::execute(), jb::fftw::time_delay_estimator_many< array_t >::nsamples_, jb::fftw::time_delay_estimator_many< array_t >::num_timeseries_, jb::fftw::time_delay_estimator_many< array_t >::out_, jb::fftw::time_delay_estimator_many< array_t >::tmpa2out_, jb::fftw::time_delay_estimator_many< array_t >::tmpa_, and jb::fftw::time_delay_estimator_many< array_t >::tmpb_.

◆ planning_flags()

template<typename array_t >
static int jb::fftw::time_delay_estimator_many< array_t >::planning_flags ( )
inlinestaticprivate

Determine the correct FFTW planning flags given the inputs.

Definition at line 157 of file time_delay_estimator_many.hpp.

Member Data Documentation

◆ a2tmpa_

template<typename array_t >
dplan jb::fftw::time_delay_estimator_many< array_t >::a2tmpa_
private

a2tmpa_ : fftw plan to execute FFT(a)

Definition at line 170 of file time_delay_estimator_many.hpp.

Referenced by jb::fftw::time_delay_estimator_many< array_t >::estimate_delay().

◆ b2tmpb_

template<typename array_t >
dplan jb::fftw::time_delay_estimator_many< array_t >::b2tmpb_
private

b2tmpb_ : fftw plan to execute FFT(b)

Definition at line 172 of file time_delay_estimator_many.hpp.

Referenced by jb::fftw::time_delay_estimator_many< array_t >::estimate_delay().

◆ nsamples_

template<typename array_t >
std::size_t jb::fftw::time_delay_estimator_many< array_t >::nsamples_
private

nsamples : num samples of timeseries

Definition at line 178 of file time_delay_estimator_many.hpp.

Referenced by jb::fftw::time_delay_estimator_many< array_t >::estimate_delay().

◆ num_timeseries_

template<typename array_t >
std::size_t jb::fftw::time_delay_estimator_many< array_t >::num_timeseries_
private

num_timeseries : num of timeseries contained in a and b

Definition at line 180 of file time_delay_estimator_many.hpp.

Referenced by jb::fftw::time_delay_estimator_many< array_t >::estimate_delay().

◆ out_

template<typename array_t >
output_array_type jb::fftw::time_delay_estimator_many< array_t >::out_
private

out_ : timeseries to store the result of inverse FFT

Definition at line 174 of file time_delay_estimator_many.hpp.

Referenced by jb::fftw::time_delay_estimator_many< array_t >::estimate_delay().

◆ tmpa2out_

template<typename array_t >
iplan jb::fftw::time_delay_estimator_many< array_t >::tmpa2out_
private

tmpa2out : fftw plan to execute inverse FFT of a timeseries

Definition at line 176 of file time_delay_estimator_many.hpp.

Referenced by jb::fftw::time_delay_estimator_many< array_t >::estimate_delay().

◆ tmpa_

template<typename array_t >
frequency_array_type jb::fftw::time_delay_estimator_many< array_t >::tmpa_
private

tmpa_ : timeseries to store the result of FFT(a)

Definition at line 166 of file time_delay_estimator_many.hpp.

Referenced by jb::fftw::time_delay_estimator_many< array_t >::estimate_delay().

◆ tmpb_

template<typename array_t >
frequency_array_type jb::fftw::time_delay_estimator_many< array_t >::tmpb_
private

tmpb_ : timeseries to store the result of FFT(b)

Definition at line 168 of file time_delay_estimator_many.hpp.

Referenced by jb::fftw::time_delay_estimator_many< array_t >::estimate_delay().


The documentation for this class was generated from the following file: