RdChannelLinearPredictorRFISuppressor.h
Go to the documentation of this file.
1 
9 #ifndef _RdChannelLinearPredictorRFISuppressor_h_
10 #define _RdChannelLinearPredictorRFISuppressor_h_
11 
12 #include <vector>
13 
14 #include <fwk/VModule.h>
15 #include <revt/Channel.h>
16 #include <revt/Station.h>
17 
18 
20 
21  // A simple struct to store the information about the samples in the trace and the regions that they belong to
22  struct SampleData {
23  std::string HelpOutput();
24 
25  double fBinning = 0;
26  unsigned int fNumCoefficients = 0;
27  unsigned int fDelayLine = 0;
28  // N.B. TrainRegion (LP) and NoiseWindow are separate entities and should be disjoint!
29  unsigned int fTrainRegionStart = 0;
30  unsigned int fTrainRegionStop = 0;
31  unsigned int fMinimumTrainRegionLength = 0;
32  unsigned int fTraceLength = 0;
33  // These values will contain the regions that are occupied by the SignalSearchWindow and the SignalNoiseWindow with extra margins added
34  unsigned int fOccupiedRegion1Start = 0;
35  unsigned int fOccupiedRegion1Stop = 0;
36  unsigned int fOccupiedRegion2Start = 0;
37  unsigned int fOccupiedRegion2Stop = 0;
38  unsigned int fTotalTraceLength = 0;
39  // Values may become negative: then something is wrong and an error is generated but first it must be allowed to become negative
41  };
42 
44 
45  public:
46  fwk::VModule::ResultFlag Init() override;
47  fwk::VModule::ResultFlag Run(evt::Event& event) override;
49 
51  revt::ChannelTimeSeries const &timeseries, revt::Station const &station);
53  revt::ChannelTimeSeries const &timeseries);
54 
55  private:
56  double fSegmentLength = 0;
57  double fDelayLine = 0;
60  double fFudgeFactor = 0;
62  double fWindowMargins = 0;
63  unsigned int fNumChannels = 0;
64  unsigned int fOptimization = 0;
65 
66  unsigned int TranslateTimeToSample(double time, double binning, char const *name);
67  bool TestOverlap(int a1, int a2, int b1, int b2);
68 
69  REGISTER_MODULE("RdChannelLinearPredictorRFISuppressor", RdChannelLinearPredictorRFISuppressor);
70  };
71 
72 }
73 
74 
75 #endif
76 
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
class to hold data at the radio Station level.
void FillSampleDataWithRelevantValuesForFirstChannel(SampleData &samples, revt::ChannelTimeSeries const &timeseries, revt::Station const &station)
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
Module interface.
Definition: VModule.h:53
Linear Predictor. Trains on noise with RFI, predicts RFI given other noisy signal.
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
fwk::VModule::ResultFlag TestSampleDataForConsistency(SampleData &samples, revt::ChannelTimeSeries const &timeseries)
REGISTER_MODULE("RdChannelLinearPredictorRFISuppressor", RdChannelLinearPredictorRFISuppressor)

, generated on Tue Sep 26 2023.