FilterbankEngineCPU.h
1 //-*-C++-*-
2 
3 /***************************************************************************
4  *
5  * Copyright (C) 2009 by Willem van Straten
6  * Licensed under the Academic Free License version 2.1
7  *
8  ***************************************************************************/
9 
10 // dspsr/Signal/General/dsp/FilterbankEngineCPU.h
11 
12 #ifndef __FilterbankEngineCPU_h
13 #define __FilterbankEngineCPU_h
14 
15 #include "dsp/FilterbankEngine.h"
16 
17 namespace dsp
18 {
20  class FilterbankEngineCPU : public Filterbank::Engine
21  {
22  public:
23 
26 
28 
29  void setup (dsp::Filterbank*);
30 
31  void set_scratch (float *);
32 
33  void perform (const dsp::TimeSeries* in, dsp::TimeSeries* out,
34  uint64_t npart, uint64_t in_step, uint64_t out_step);
35 
36  void perform (const dsp::TimeSeries* in, dsp::TimeSeries* out, dsp::TimeSeries* zero_DM_out,
37  uint64_t npart, uint64_t in_step, uint64_t out_step);
38 
39 
40  void finish ();
41 
42  FTransform::Plan* get_forward ();
43 
44  FTransform::Plan* get_backward ();
45 
46  protected:
47 
48  FTransform::Plan* forward;
49 
50  FTransform::Plan* backward;
51 
53  bool real_to_complex;
54 
56  float* scratch;
57 
62  float* freq_domain_scratch[3];
63 
65  float* time_domain_scratch;
66 
69 
71  const dsp::Response* response;
72 
75 
78  const dsp::Apodization* spectral_apodization;
79 
82 
85 
87  unsigned nchan_subband;
88 
90  unsigned freq_res;
91 
93  unsigned nfilt_pos;
94 
96  unsigned nfilt_neg;
97 
99  uint64_t nsamp_fft;
100 
104  unsigned nkeep;
105 
106  bool verbose;
107 
108  private:
109 
110  // size of the forward FFT size
111  unsigned bigfftsize;
112 
113  };
114 
115 }
116 
117 #endif
const In * get_input() const
Return pointer to the container from which input data will be read.
Definition: HasInput.h:41
unsigned nfilt_pos
positive impulse from response (dsp::Response::get_impulse_pos)
Definition: FilterbankEngineCPU.h:103
const dsp::Response * response
response kernel, from Filterbank
Definition: FilterbankEngineCPU.h:81
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
uint64_t nsamp_fft
number of samples in forward fft
Definition: FilterbankEngineCPU.h:109
bool matrix_convolution
Whether or not to do matrix convolution, from Filterbank.
Definition: FilterbankEngineCPU.h:94
virtual const Response * get_passband() const
Return a pointer to the integrated passband.
Definition: Convolution.C:105
bool get_matrix_convolution() const
get the matrix_convolution flag
Definition: Convolution.h:138
Signal::State get_state() const
Return the state of the signal.
Definition: Observation.h:70
float * get_datptr(unsigned ichan=0, unsigned ipol=0)
Return pointer to the specified data block.
Definition: TimeSeries.C:304
Describes a frequency (or impulse) response.
Definition: Response.h:34
float * windowed_time_domain_scratch
scratch space for apodization operation
Definition: FilterbankEngineCPU.h:78
virtual const Apodization * get_temporal_apodization() const
Return a pointer to to the temporal apodization object.
Definition: Convolution.C:115
float * freq_domain_scratch[3]
scratch space for forward fft This is an array of float pointers because we might be dealing not only...
Definition: FilterbankEngineCPU.h:72
const dsp::Apodization * temporal_apodization
apodization kernel, from Filterbank
Definition: FilterbankEngineCPU.h:87
virtual const Response * get_response() const
Return a pointer to the frequency response function.
Definition: Convolution.C:90
unsigned get_npol() const
Return the number of polarizations.
Definition: Observation.h:90
bool real_to_complex
Complex-valued data.
Definition: FilterbankEngineCPU.h:63
unsigned nchan_subband
number of output channels per input channel
Definition: FilterbankEngineCPU.h:97
bool has_passband() const
Return true if the passband attribute has been set.
Definition: Convolution.C:100
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
unsigned freq_res
frequency resolution of response (dsp::Response::get_ndat)
Definition: FilterbankEngineCPU.h:100
float * time_domain_scratch
scratch space for backward fft
Definition: FilterbankEngineCPU.h:75
bool has_zero_DM_response() const
Return true if the zero DM response attribute has been set.
Definition: Convolution.C:183
unsigned get_nfilt_pos()
get the response's positive impulse
Definition: Filterbank.h:80
bool has_temporal_apodization() const
Return true if the temporal apodization attribute has been set.
Definition: Convolution.C:126
static bool verbose
Global verbosity flag.
Definition: Operation.h:48
FilterbankEngineCPU()
Default Constructor.
Definition: FilterbankEngineCPU.C:24
Breaks a single-band TimeSeries into multiple frequency channels.
Definition: Filterbank.h:27
unsigned nkeep
number of samples to keep from each input sample.
Definition: FilterbankEngineCPU.h:114
unsigned get_nfilt_neg()
get the response's negative impulse
Definition: Filterbank.h:83
const dsp::Response * zero_DM_response
zero DM response, from Filterbank
Definition: FilterbankEngineCPU.h:84
float * scratch
device scratch sapce
Definition: FilterbankEngineCPU.h:66
virtual const Response * get_zero_DM_response() const
Return a pointer to the zero DM frequency response function.
Definition: Convolution.C:188
Various apodizing (window) functions.
Definition: Apodization.h:28
unsigned nfilt_neg
negative impulse from response (dsp::Response::get_impulse_neg)
Definition: FilterbankEngineCPU.h:106
void set_library(const std::string &name)
static Reference::To< Agent > current
Discrete convolution filterbank step for CPU.
Definition: FilterbankEngineCPU.h:25
bool has_response() const
Return true if the response attribute has been set.
Definition: Convolution.C:85
dsp::Response * passband
passband kernel, from Filterbank
Definition: FilterbankEngineCPU.h:91
bool has_spectral_apodization() const
Return true if the spectral apodization attribute has been set.
Definition: Convolution.C:146
virtual const Apodization * get_spectral_apodization() const
Return a pointer to to the spectral apodization object.
Definition: Convolution.C:136
uint64_t get_minimum_samples()
Get the minimum number of samples required for operation.
Definition: Filterbank.h:55
unsigned get_nchan() const
Return the number of channels into which the band is divided.
Definition: Observation.h:85

Generated using doxygen 1.8.17