LfFilter.cxx
Go to the documentation of this file.
2 
4 
7 
8 
9 using namespace WireCell;
10 
11 SigProc::LfFilter::LfFilter(double max_freq, double tau)
12  : m_max_freq(max_freq)
13  , m_tau(tau)
14 {
15 }
16 
17 SigProc::LfFilter::~LfFilter()
18 {
19 }
20 
21 WireCell::Configuration SigProc::LfFilter::default_configuration() const
22 {
24  cfg["tau"] = m_tau;
25  cfg["max_freq"] = m_max_freq;
26  return cfg;
27 }
28 
30 {
31  m_tau = get(cfg,"tau",m_tau);
32  m_max_freq = get(cfg,"max_freq",m_max_freq);
33 }
34 
35 
36 const Waveform::realseq_t SigProc::LfFilter::filter_waveform(int nbins) const
37 {
38  Waveform::realseq_t m_wfs(nbins);
39 
41 
42  for (size_t i=0; i!=m_wfs.size();i++){
43  double freq = i * 1.0 / int(m_wfs.size()) * 2 * m_max_freq;
44  if (freq > m_max_freq)
45  freq = freq - 2*m_max_freq;
46  m_wfs.at(i) = lf_filter(fabs(freq));
47  }
48  // std::cout << m_wfs.size() << std::endl;
49 
50  return m_wfs;
51 }
Sequence< real_t > realseq_t
Definition: Waveform.h:31
cfg
Definition: dbjson.py:29
WIRECELL_FACTORY(LfFilter, WireCell::SigProc::LfFilter, WireCell::IFilterWaveform, WireCell::IConfigurable) using namespace WireCell
def configure(cfg)
Definition: cuda.py:34
Definition: Main.h:22
Json::Value Configuration
Definition: Configuration.h:50
double lf_filter(double freq, double tau=0.02)
Definition: Response.cxx:386