JayBeams
0.1
Another project to have fun coding.
|
A simple time delay estimator based on cross-correlation. More...
#include <time_delay_estimator.hpp>
Public Types | |
Type traits | |
typedef timeseries_t | timeseries_type |
The input timeseries type. More... | |
typedef timeseries_type::value_type | value_type |
The values stored in the input timeseries. More... | |
typedef jb::extract_value_type< value_type >::precision | precision_type |
Extract T out of std::complex<T>, otherwise simply T. More... | |
typedef vector< std::complex< precision_type > > | frequency_timeseries_type |
The type used to store the DFT of the input timeseries. More... | |
typedef vector< precision_type > | output_timeseries_type |
The type used to stored the inverse of the DFT. More... | |
typedef jb::fftw::plan< timeseries_type, frequency_timeseries_type > | dplan |
The execution plan to apply the (forward) DFT. More... | |
typedef jb::fftw::plan< frequency_timeseries_type, output_timeseries_type > | iplan |
The execution plan to apply the inverse (aka backward) DFT. More... | |
Public Member Functions | |
time_delay_estimator (timeseries_type &a, timeseries_type &b) | |
Constructs a time delay estimator using. More... | |
std::pair< bool, precision_type > | estimate_delay (timeseries_type &a, timeseries_type &b) |
Compute the time-delay estimate between two timeseries. More... | |
Static Private Member Functions | |
static int | planning_flags () |
Determine the correct FFTW planning flags given the inputs. More... | |
Private Attributes | |
frequency_timeseries_type | tmpa_ |
frequency_timeseries_type | tmpb_ |
dplan | a2tmpa_ |
dplan | b2tmpb_ |
output_timeseries_type | out_ |
iplan | tmpa2out_ |
A simple time delay estimator based on cross-correlation.
Definition at line 17 of file time_delay_estimator.hpp.
typedef jb::fftw::plan<timeseries_type, frequency_timeseries_type> jb::fftw::time_delay_estimator< timeseries_t, vector >::dplan |
The execution plan to apply the (forward) DFT.
Definition at line 39 of file time_delay_estimator.hpp.
typedef vector<std::complex<precision_type> > jb::fftw::time_delay_estimator< timeseries_t, vector >::frequency_timeseries_type |
The type used to store the DFT of the input timeseries.
Definition at line 33 of file time_delay_estimator.hpp.
typedef jb::fftw::plan<frequency_timeseries_type, output_timeseries_type> jb::fftw::time_delay_estimator< timeseries_t, vector >::iplan |
The execution plan to apply the inverse (aka backward) DFT.
Definition at line 43 of file time_delay_estimator.hpp.
typedef vector<precision_type> jb::fftw::time_delay_estimator< timeseries_t, vector >::output_timeseries_type |
The type used to stored the inverse of the DFT.
Definition at line 36 of file time_delay_estimator.hpp.
typedef jb::extract_value_type<value_type>::precision jb::fftw::time_delay_estimator< timeseries_t, vector >::precision_type |
Extract T out of std::complex<T>, otherwise simply T.
Definition at line 30 of file time_delay_estimator.hpp.
typedef timeseries_t jb::fftw::time_delay_estimator< timeseries_t, vector >::timeseries_type |
The input timeseries type.
Definition at line 24 of file time_delay_estimator.hpp.
typedef timeseries_type::value_type jb::fftw::time_delay_estimator< timeseries_t, vector >::value_type |
The values stored in the input timeseries.
Definition at line 27 of file time_delay_estimator.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 | container type (e.g. vector<>) timeseries |
b | container type (e.g. vector<>) timeseries |
Definition at line 59 of file time_delay_estimator.hpp.
|
inline |
Compute the time-delay estimate between two timeseries.
Definition at line 73 of file time_delay_estimator.hpp.
References jb::fftw::time_delay_estimator< timeseries_t, vector >::a2tmpa_, jb::fftw::time_delay_estimator< timeseries_t, vector >::b2tmpb_, jb::fftw::plan< in_timeseries_type, out_timeseries_type >::execute(), jb::fftw::time_delay_estimator< timeseries_t, vector >::out_, jb::fftw::time_delay_estimator< timeseries_t, vector >::tmpa2out_, jb::fftw::time_delay_estimator< timeseries_t, vector >::tmpa_, and jb::fftw::time_delay_estimator< timeseries_t, vector >::tmpb_.
|
inlinestaticprivate |
Determine the correct FFTW planning flags given the inputs.
Definition at line 112 of file time_delay_estimator.hpp.
|
private |
Definition at line 122 of file time_delay_estimator.hpp.
Referenced by jb::fftw::time_delay_estimator< timeseries_t, vector >::estimate_delay().
|
private |
Definition at line 123 of file time_delay_estimator.hpp.
Referenced by jb::fftw::time_delay_estimator< timeseries_t, vector >::estimate_delay().
|
private |
Definition at line 124 of file time_delay_estimator.hpp.
Referenced by jb::fftw::time_delay_estimator< timeseries_t, vector >::estimate_delay().
|
private |
Definition at line 125 of file time_delay_estimator.hpp.
Referenced by jb::fftw::time_delay_estimator< timeseries_t, vector >::estimate_delay().
|
private |
Definition at line 120 of file time_delay_estimator.hpp.
Referenced by jb::fftw::time_delay_estimator< timeseries_t, vector >::estimate_delay().
|
private |
Definition at line 121 of file time_delay_estimator.hpp.
Referenced by jb::fftw::time_delay_estimator< timeseries_t, vector >::estimate_delay().