InverseFilterbankEngine.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2011 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __InverseFilterbankEngine_h
10 #define __InverseFilterbankEngine_h
11 
12 #include <functional>
13 
14 #include "dsp/InverseFilterbank.h"
15 #include "EventEmitter.h"
16 #include "Functor.h"
17 
21 {
22 public:
23 
24  Engine () { scratch = output = 0; }
25 
27  virtual void setup (InverseFilterbank*) = 0;
28 
30  virtual void set_scratch (float *) = 0;
31 
33  virtual void perform (const dsp::TimeSeries * in,
34  dsp::TimeSeries * out,
35  uint64_t npart,
36  const uint64_t in_step,
37  const uint64_t out_step) = 0;
38 
39  virtual void perform (const dsp::TimeSeries * in,
40  dsp::TimeSeries * out,
41  dsp::TimeSeries* zero_DM_out,
42  uint64_t npart,
43  const uint64_t in_step,
44  const uint64_t out_step) = 0;
45 
47  virtual void finish () { }
48 
50  unsigned get_total_scratch_needed () const { return total_scratch_needed; }
51 
52  bool get_report () const { return report; }
53 
54  void set_report (bool _report) { report = _report; }
55 
56  class Reporter {
57  public:
58  virtual void operator() (float*, unsigned, unsigned, unsigned, unsigned) {};
59  };
60 
61  // A event emitter that takes a data array, and the nchan, npol, ndat and ndim
62  // associated with the data array
63  EventEmitter<Reporter> reporter;
64 
65 
66 protected:
67 
68  float* scratch;
69 
70  float* output;
71  unsigned output_span;
72 
73  unsigned total_scratch_needed;
74 
76  bool report;
77 
78 
79 };
80 
81 #endif
Abstract base class for derived engines that operate on data in order to perform inverse (synthesis) ...
Definition: InverseFilterbankEngine.h:20
virtual void set_scratch(float *)=0
provide some scratch space for the engine
virtual void finish()
Finish up.
Definition: InverseFilterbankEngine.h:52
Performs the PFB inversion synthesis operation.
Definition: InverseFilterbank.h:82
virtual void perform(const dsp::TimeSeries *in, dsp::TimeSeries *out, uint64_t npart, const uint64_t in_step, const uint64_t out_step)=0
Perform the filterbank operation on the input data.
unsigned get_total_scratch_needed() const
get the amount of scratch space the engine has calculated that it needs
Definition: InverseFilterbankEngine.h:55
virtual void setup(InverseFilterbank *)=0
If kernel is not set, then the engine should set up for benchmark only.
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
bool report
Flag indicating whether to report intermediate data products.
Definition: InverseFilterbankEngine.h:81

Generated using doxygen 1.8.17