JayBeams
0.1
Another project to have fun coding.
|
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... | |
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
array_t | timeseries array type |
Definition at line 25 of file time_delay_estimator_many.hpp.
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.
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.
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.
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.
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.
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.
using jb::fftw::time_delay_estimator_many< array_t >::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.
Definition at line 48 of file time_delay_estimator_many.hpp.
using jb::fftw::time_delay_estimator_many< array_t >::iplan = jb::fftw::plan<frequency_array_type, output_array_type> |
The execution plan to apply the inverse (aka backward) DFT.
Definition at line 58 of file time_delay_estimator_many.hpp.
using jb::fftw::time_delay_estimator_many< array_t >::output_array_type = typename jb::detail::aligned_container< precision_type, array_type>::array_type |
The type used to store the inverse of the DFT.
Definition at line 52 of file time_delay_estimator_many.hpp.
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.
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.
|
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.
a | multi array timeseries |
b | multi array timeseries |
Definition at line 84 of file time_delay_estimator_many.hpp.
References jb::detail::array_shape().
|
inline |
Compute the time-delay estimate between two timeseries a and b.
confidence | to return the TDE(a,b) confidence |
estimated_delay | to return the result of TDE(a,b) |
a | input timeseries, FFTW library might modify their values |
b | input timeseries, FFTW library might modify their values |
sum2 | contains 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_.
|
inlinestaticprivate |
Determine the correct FFTW planning flags given the inputs.
Definition at line 157 of file time_delay_estimator_many.hpp.
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().