Typedefs | |
typedef float | real_t |
The type for the signal in each bin. More... | |
typedef std::complex< float > | complex_t |
The type for the spectrum in each bin. More... | |
template<typename Val > | |
using | Sequence = std::vector< Val > |
typedef Sequence< real_t > | realseq_t |
typedef Sequence< complex_t > | compseq_t |
A complex-valued sequence, eg for discrete spectrum powers. More... | |
typedef std::pair< int, int > | BinRange |
A half-open range of bins (from first bin to one past last bin) More... | |
typedef std::vector< BinRange > | BinRangeList |
A list of bin ranges. More... | |
typedef std::map< int, BinRangeList > | ChannelMasks |
Map channel number to a vector of BinRanges. More... | |
typedef std::map< std::string, ChannelMasks > | ChannelMaskMap |
Collect channel masks by some label. More... | |
typedef std::pair< double, double > | Period |
A range of time. More... | |
typedef std::pair< double, double > | Band |
A range of frequency. More... | |
typedef std::pair< double, double > | Domain |
Functions | |
BinRangeList | merge (const BinRangeList &br) |
Return a new list with any overlaps formed into unions. More... | |
BinRangeList | merge (const BinRangeList &br1, const BinRangeList &br2) |
Merge two bin range lists, forming a union from any overlapping ranges. More... | |
ChannelMasks | merge (const ChannelMasks &one, const ChannelMasks &two) |
Return a new mapping which is the union of all same channel masks. More... | |
void | merge (ChannelMaskMap &one, ChannelMaskMap &two, std::map< std::string, std::string > &name_map) |
int | sample_count (const Domain &domain, double width) |
Return the number of samples needed to cover the domain with sample size width. More... | |
double | sample_width (const Domain &domain, int count) |
Return the sample size if domain is equally sampled with given number of samples. More... | |
std::pair< int, int > | sub_sample (const Domain &domain, int nsamples, const Domain &subdomain) |
Return the begin/end sample numbers inside the a subdomain of a domain with nsamples total. More... | |
template<typename Val > | |
Sequence< Val > | resample (const Sequence< Val > &wave, const Domain &domain, int nsamples, const Domain &newdomain) |
realseq_t | real (const compseq_t &seq) |
Return the real part of the sequence. More... | |
realseq_t | imag (const compseq_t &seq) |
Return the imaginary part of the sequence. More... | |
realseq_t | magnitude (const compseq_t &seq) |
Return the magnitude or absolute value of the sequence. More... | |
realseq_t | phase (const compseq_t &seq) |
Return the phase or arg part of the sequence. More... | |
template<typename Val > | |
void | increase (Sequence< Val > &seq, Val scalar) |
Increase (shift) sequence values by scalar. More... | |
void | increase (Sequence< float > &seq, double scalar) |
template<typename Val > | |
void | increase (Sequence< Val > &seq, const Sequence< Val > &other) |
Increase (shift) sequence values by values in another sequence. More... | |
template<typename Val > | |
void | scale (Sequence< Val > &seq, Val scalar) |
Scale (multiply) sequence values by scalar. More... | |
void | scale (Sequence< float > &seq, double scalar) |
template<typename Val > | |
void | scale (Sequence< Val > &seq, const Sequence< Val > &other) |
Scale (multiply) seq values by values from the other sequence. More... | |
template<typename Val > | |
void | shrink (Sequence< Val > &seq, const Sequence< Val > &other) |
Shrink (divide) seq values by values from the other sequence. More... | |
std::pair< int, int > | edge (const realseq_t &wave) |
template<typename Val > | |
Val | sum (const Sequence< Val > &seq) |
Return sum of all entries in sequence. More... | |
template<typename Val > | |
Val | sum2 (const Sequence< Val > &seq) |
Return sum of square of all entries in sequence. More... | |
std::pair< double, double > | mean_rms (const realseq_t &wave) |
real_t | median (realseq_t &wave) |
real_t | median_binned (realseq_t &wave) |
real_t | percentile (realseq_t &wave, real_t percentage) |
real_t | percentile_binned (realseq_t &wave, real_t percentage) |
compseq_t | dft (realseq_t seq) |
realseq_t | linear_convolve (Waveform::realseq_t in1, Waveform::realseq_t in2, bool truncate=true) |
realseq_t | replace_convolve (Waveform::realseq_t wave, Waveform::realseq_t newres, Waveform::realseq_t oldres, bool truncate=true) |
realseq_t | idft (compseq_t spec) |
short | most_frequent (const std::vector< short > &vals) |
Return the smallest, most frequent value to appear in vector. More... | |
typedef std::pair<double,double> WireCell::Waveform::Band |
A range of frequency.
Definition at line 69 of file Waveform.h.
typedef std::pair<int,int> WireCell::Waveform::BinRange |
A half-open range of bins (from first bin to one past last bin)
Definition at line 38 of file Waveform.h.
A list of bin ranges.
Definition at line 41 of file Waveform.h.
typedef std::map<std::string, ChannelMasks> WireCell::Waveform::ChannelMaskMap |
Collect channel masks by some label.
Definition at line 59 of file Waveform.h.
typedef std::map<int, BinRangeList > WireCell::Waveform::ChannelMasks |
Map channel number to a vector of BinRanges.
Definition at line 50 of file Waveform.h.
typedef std::complex<float> WireCell::Waveform::complex_t |
The type for the spectrum in each bin.
Definition at line 21 of file Waveform.h.
A complex-valued sequence, eg for discrete spectrum powers.
Definition at line 34 of file Waveform.h.
typedef std::pair<double,double> WireCell::Waveform::Domain |
A domain of a sequence is bounded by the time or frequency at the start of its first element and that at the end of its last.
Definition at line 75 of file Waveform.h.
typedef std::pair<double,double> WireCell::Waveform::Period |
A range of time.
Definition at line 66 of file Waveform.h.
typedef float WireCell::Waveform::real_t |
The type for the signal in each bin.
Definition at line 18 of file Waveform.h.
typedef Sequence<real_t> WireCell::Waveform::realseq_t |
Definition at line 31 of file Waveform.h.
using WireCell::Waveform::Sequence = typedef std::vector<Val> |
A sequence is an ordered array of values (real or complex). By itself it is not associated with a domain.
Definition at line 27 of file Waveform.h.
Waveform::compseq_t WireCell::Waveform::dft | ( | realseq_t | seq | ) |
Discrete Fourier transform of real sequence. Returns full spectrum. No normalization scaling applied
Definition at line 141 of file Waveform.cxx.
std::pair< int, int > WireCell::Waveform::edge | ( | const realseq_t & | wave | ) |
Return a pair of indices into wave which bound non-zero region. First index is of first non-zero sample, second index is one past last non-zero sample. If entire wave is empty then both are set to size().
Definition at line 121 of file Waveform.cxx.
Waveform::realseq_t WireCell::Waveform::idft | ( | compseq_t | spec | ) |
Inverse, discrete Fourier transform. Expects full spectrum (twice Nyquist frequency). Applies the 1/Nsamples normalization.
Definition at line 149 of file Waveform.cxx.
Waveform::realseq_t WireCell::Waveform::imag | ( | const compseq_t & | seq | ) |
Return the imaginary part of the sequence.
Definition at line 60 of file Waveform.cxx.
void WireCell::Waveform::increase | ( | Sequence< Val > & | seq, |
Val | scalar | ||
) |
Increase (shift) sequence values by scalar.
Definition at line 129 of file Waveform.h.
|
inline |
Definition at line 133 of file Waveform.h.
void WireCell::Waveform::increase | ( | Sequence< Val > & | seq, |
const Sequence< Val > & | other | ||
) |
Increase (shift) sequence values by values in another sequence.
Definition at line 139 of file Waveform.h.
Waveform::realseq_t WireCell::Waveform::linear_convolve | ( | Waveform::realseq_t | in1, |
Waveform::realseq_t | in2, | ||
bool | truncate = true |
||
) |
Definition at line 159 of file Waveform.cxx.
Waveform::realseq_t WireCell::Waveform::magnitude | ( | const compseq_t & | seq | ) |
Return the magnitude or absolute value of the sequence.
Definition at line 65 of file Waveform.cxx.
std::pair< double, double > WireCell::Waveform::mean_rms | ( | const realseq_t & | wave | ) |
Definition at line 24 of file Waveform.cxx.
Waveform::real_t WireCell::Waveform::median | ( | Waveform::realseq_t & | wave | ) |
Definition at line 76 of file Waveform.cxx.
Waveform::real_t WireCell::Waveform::median_binned | ( | Waveform::realseq_t & | wave | ) |
Definition at line 81 of file Waveform.cxx.
WireCell::Waveform::BinRangeList WireCell::Waveform::merge | ( | const BinRangeList & | br | ) |
Return a new list with any overlaps formed into unions.
Definition at line 222 of file Waveform.cxx.
WireCell::Waveform::BinRangeList WireCell::Waveform::merge | ( | const BinRangeList & | br1, |
const BinRangeList & | br2 | ||
) |
Merge two bin range lists, forming a union from any overlapping ranges.
Definition at line 243 of file Waveform.cxx.
WireCell::Waveform::ChannelMasks WireCell::Waveform::merge | ( | const ChannelMasks & | one, |
const ChannelMasks & | two | ||
) |
Return a new mapping which is the union of all same channel masks.
Definition at line 258 of file Waveform.cxx.
void WireCell::Waveform::merge | ( | ChannelMaskMap & | one, |
ChannelMaskMap & | two, | ||
std::map< std::string, std::string > & | name_map | ||
) |
Definition at line 270 of file Waveform.cxx.
short WireCell::Waveform::most_frequent | ( | const std::vector< short > & | vals | ) |
Return the smallest, most frequent value to appear in vector.
Definition at line 289 of file Waveform.cxx.
Waveform::real_t WireCell::Waveform::percentile | ( | Waveform::realseq_t & | wave, |
real_t | percentage | ||
) |
Definition at line 87 of file Waveform.cxx.
Waveform::real_t WireCell::Waveform::percentile_binned | ( | Waveform::realseq_t & | wave, |
real_t | percentage | ||
) |
Definition at line 93 of file Waveform.cxx.
Waveform::realseq_t WireCell::Waveform::phase | ( | const compseq_t & | seq | ) |
Return the phase or arg part of the sequence.
Definition at line 70 of file Waveform.cxx.
Waveform::realseq_t WireCell::Waveform::real | ( | const compseq_t & | seq | ) |
Return the real part of the sequence.
Definition at line 55 of file Waveform.cxx.
Waveform::realseq_t WireCell::Waveform::replace_convolve | ( | Waveform::realseq_t | wave, |
Waveform::realseq_t | newres, | ||
Waveform::realseq_t | oldres, | ||
bool | truncate = true |
||
) |
Definition at line 187 of file Waveform.cxx.
Sequence<Val> WireCell::Waveform::resample | ( | const Sequence< Val > & | wave, |
const Domain & | domain, | ||
int | nsamples, | ||
const Domain & | newdomain | ||
) |
Return a new sequence resampled and interpolated from the original wave defined over the domain to a new domain of nsamples.
Definition at line 92 of file Waveform.h.
|
inline |
Return the number of samples needed to cover the domain with sample size width.
Definition at line 77 of file Waveform.h.
|
inline |
Return the sample size if domain is equally sampled with given number of samples.
Definition at line 81 of file Waveform.h.
void WireCell::Waveform::scale | ( | Sequence< Val > & | seq, |
Val | scalar | ||
) |
Scale (multiply) sequence values by scalar.
Definition at line 146 of file Waveform.h.
|
inline |
Definition at line 150 of file Waveform.h.
void WireCell::Waveform::scale | ( | Sequence< Val > & | seq, |
const Sequence< Val > & | other | ||
) |
Scale (multiply) seq values by values from the other sequence.
Definition at line 156 of file Waveform.h.
void WireCell::Waveform::shrink | ( | Sequence< Val > & | seq, |
const Sequence< Val > & | other | ||
) |
Shrink (divide) seq values by values from the other sequence.
Definition at line 162 of file Waveform.h.
std::pair< int, int > WireCell::Waveform::sub_sample | ( | const Domain & | domain, |
int | nsamples, | ||
const Domain & | subdomain | ||
) |
Return the begin/end sample numbers inside the a subdomain of a domain with nsamples total.
Definition at line 15 of file Waveform.cxx.
Val WireCell::Waveform::sum | ( | const Sequence< Val > & | seq | ) |
Return sum of all entries in sequence.
Definition at line 178 of file Waveform.h.
Val WireCell::Waveform::sum2 | ( | const Sequence< Val > & | seq | ) |