Namespaces | Typedefs | Functions
Waveform.h File Reference
#include <map>
#include <cstdint>
#include <vector>
#include <complex>
#include <numeric>
#include <algorithm>
#include <string>

Go to the source code of this file.

Namespaces

 WireCell
 
 WireCell::Waveform
 

Typedefs

typedef float WireCell::Waveform::real_t
 The type for the signal in each bin. More...
 
typedef std::complex< float > WireCell::Waveform::complex_t
 The type for the spectrum in each bin. More...
 
template<typename Val >
using WireCell::Waveform::Sequence = std::vector< Val >
 
typedef Sequence< real_t > WireCell::Waveform::realseq_t
 
typedef Sequence< complex_tWireCell::Waveform::compseq_t
 A complex-valued sequence, eg for discrete spectrum powers. More...
 
typedef std::pair< int, int > WireCell::Waveform::BinRange
 A half-open range of bins (from first bin to one past last bin) More...
 
typedef std::vector< BinRange > WireCell::Waveform::BinRangeList
 A list of bin ranges. More...
 
typedef std::map< int, BinRangeList > WireCell::Waveform::ChannelMasks
 Map channel number to a vector of BinRanges. More...
 
typedef std::map< std::string, ChannelMasks > WireCell::Waveform::ChannelMaskMap
 Collect channel masks by some label. More...
 
typedef std::pair< double, double > WireCell::Waveform::Period
 A range of time. More...
 
typedef std::pair< double, double > WireCell::Waveform::Band
 A range of frequency. More...
 
typedef std::pair< double, double > WireCell::Waveform::Domain
 

Functions

BinRangeList WireCell::Waveform::merge (const BinRangeList &br)
 Return a new list with any overlaps formed into unions. More...
 
BinRangeList WireCell::Waveform::merge (const BinRangeList &br1, const BinRangeList &br2)
 Merge two bin range lists, forming a union from any overlapping ranges. More...
 
ChannelMasks WireCell::Waveform::merge (const ChannelMasks &one, const ChannelMasks &two)
 Return a new mapping which is the union of all same channel masks. More...
 
void WireCell::Waveform::merge (ChannelMaskMap &one, ChannelMaskMap &two, std::map< std::string, std::string > &name_map)
 
int WireCell::Waveform::sample_count (const Domain &domain, double width)
 Return the number of samples needed to cover the domain with sample size width. More...
 
double WireCell::Waveform::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 > 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. More...
 
template<typename Val >
Sequence< Val > WireCell::Waveform::resample (const Sequence< Val > &wave, const Domain &domain, int nsamples, const Domain &newdomain)
 
realseq_t WireCell::Waveform::real (const compseq_t &seq)
 Return the real part of the sequence. More...
 
realseq_t WireCell::Waveform::imag (const compseq_t &seq)
 Return the imaginary part of the sequence. More...
 
realseq_t WireCell::Waveform::magnitude (const compseq_t &seq)
 Return the magnitude or absolute value of the sequence. More...
 
realseq_t WireCell::Waveform::phase (const compseq_t &seq)
 Return the phase or arg part of the sequence. More...
 
template<typename Val >
void WireCell::Waveform::increase (Sequence< Val > &seq, Val scalar)
 Increase (shift) sequence values by scalar. More...
 
void WireCell::Waveform::increase (Sequence< float > &seq, double scalar)
 
template<typename Val >
void WireCell::Waveform::increase (Sequence< Val > &seq, const Sequence< Val > &other)
 Increase (shift) sequence values by values in another sequence. More...
 
template<typename Val >
void WireCell::Waveform::scale (Sequence< Val > &seq, Val scalar)
 Scale (multiply) sequence values by scalar. More...
 
void WireCell::Waveform::scale (Sequence< float > &seq, double scalar)
 
template<typename Val >
void WireCell::Waveform::scale (Sequence< Val > &seq, const Sequence< Val > &other)
 Scale (multiply) seq values by values from the other sequence. More...
 
template<typename Val >
void WireCell::Waveform::shrink (Sequence< Val > &seq, const Sequence< Val > &other)
 Shrink (divide) seq values by values from the other sequence. More...
 
std::pair< int, int > WireCell::Waveform::edge (const realseq_t &wave)
 
template<typename Val >
Val WireCell::Waveform::sum (const Sequence< Val > &seq)
 Return sum of all entries in sequence. More...
 
template<typename Val >
Val WireCell::Waveform::sum2 (const Sequence< Val > &seq)
 Return sum of square of all entries in sequence. More...
 
std::pair< double, double > WireCell::Waveform::mean_rms (const realseq_t &wave)
 
real_t WireCell::Waveform::median (realseq_t &wave)
 
real_t WireCell::Waveform::median_binned (realseq_t &wave)
 
real_t WireCell::Waveform::percentile (realseq_t &wave, real_t percentage)
 
real_t WireCell::Waveform::percentile_binned (realseq_t &wave, real_t percentage)
 
compseq_t WireCell::Waveform::dft (realseq_t seq)
 
realseq_t WireCell::Waveform::linear_convolve (Waveform::realseq_t in1, Waveform::realseq_t in2, bool truncate=true)
 
realseq_t WireCell::Waveform::replace_convolve (Waveform::realseq_t wave, Waveform::realseq_t newres, Waveform::realseq_t oldres, bool truncate=true)
 
realseq_t WireCell::Waveform::idft (compseq_t spec)
 
short WireCell::Waveform::most_frequent (const std::vector< short > &vals)
 Return the smallest, most frequent value to appear in vector. More...