40 ZPGFilter(
const unsigned int aNumZeros,
const unsigned int aNumPoles);
61 inline void SetPole(
const unsigned int aPoleIndex,
62 const double aPoleRe,
const double aPoleIm){
63 poles[0][aPoleIndex] = aPoleRe;
64 poles[1][aPoleIndex] = aPoleIm;
73 inline void SetZero(
const unsigned int aZeroIndex,
74 const double aZeroRe,
const double aZeroIm){
75 zeros[0][aZeroIndex] = aZeroRe;
76 zeros[1][aZeroIndex] = aZeroIm;
84 inline void SetGain(
const double aGainRe,
const double aGainIm){
132 void Apply(
const unsigned int aSize,
double *aData);
208 bool Transform(
const unsigned int aInSize,
double *aInData,
const unsigned int aOutSize,
double *aOutData);
223 inline void SetWindow(
const unsigned int aWindowSize,
double *aWindow){
246 const unsigned int aWorkingFrequency,
247 const double aHighPassFrequency=0.0);
332 void RemoveDC(
const unsigned int aSize,
double *aData);
340 void HighPass(
const unsigned int aSize,
double *aData);
349 void PreSample(
unsigned int &aSize,
double *aData);
360 void Resample(
unsigned int aSize,
double *aInData,
double *aOutData);
#define NORDER
Definition Sample.h:13
#define NORDERHP
Definition Sample.h:14
Produce an infinite impulse response filter.
Definition Sample.h:104
void Apply(const unsigned int aSize, double *aData)
Applies filter.
Definition Sample.cc:714
double * directCoef
The direct filter coefficients.
Definition Sample.h:144
double * recursCoef
The recursive filter coefficients.
Definition Sample.h:145
virtual ~IIRFilter(void)
Destructor of the IIRFilter class.
Definition Sample.cc:701
unsigned int npoles
Number of poles.
Definition Sample.h:138
unsigned int numRecurs
The number of recursive filter coefficients.
Definition Sample.h:143
double * history
The previous values of w.
Definition Sample.h:146
double * history_init
The initial values of w.
Definition Sample.h:147
unsigned int numDirect
The number of direct filter coefficients.
Definition Sample.h:142
double * poles[2]
Poles (complex).
Definition Sample.h:140
unsigned int nzeros
Number of zeros.
Definition Sample.h:137
double gain[2]
Gain (complex).
Definition Sample.h:141
double * zeros[2]
Zeros (complex).
Definition Sample.h:139
Monitor a GWOLLUM processing.
Definition Monitor.h:39
bool GetStatus(void)
Returns the object status.
Definition Monitor.h:109
Transform discrete time series.
Definition Sample.h:162
unsigned int GetWindowSize(void)
Returns the window size (=0 if no windowing).
Definition Sample.h:231
void MakeHighPassFilters(void)
Constructs the highpass filters.
Definition Sample.cc:268
void SetDCRemoval(const bool aDCremove=true)
Activates/Deactivates the DC removal.
Definition Sample.h:216
bool presample
Pre-sample flag.
Definition Sample.h:309
IIRFilter * iirFilter[NORDER]
Downsampling filters.
Definition Sample.h:312
bool SetHighPassFrequency(const double aHighPassFrequency)
Defines a highpass frequency.
Definition Sample.h:278
unsigned int fResampleFactor
Resampling factor (>=1).
Definition Sample.h:310
unsigned int GetNativeFrequency(void)
Returns the current native sampling frequency [Hz].
Definition Sample.h:285
IIRFilter * iirFilterHP[NORDERHP]
Highpass filters.
Definition Sample.h:313
virtual ~Sample(void)
Destructor of the Sample class.
Definition Sample.cc:40
void PreSample(unsigned int &aSize, double *aData)
Pre-samples the data.
Definition Sample.cc:332
bool SetFrequencies(const unsigned int aNativeFrequency, const unsigned int aWorkingFrequency, const double aHighPassFrequency=0.0)
Defines frequencies for the transformation.
Definition Sample.cc:129
unsigned int GetWorkingFrequency(void)
Returns the current working sampling frequency [Hz].
Definition Sample.h:290
void HighPass(const unsigned int aSize, double *aData)
Highpasses the data.
Definition Sample.cc:321
void RemoveDC(const unsigned int aSize, double *aData)
Removes the DC component.
Definition Sample.cc:308
unsigned int fWorkingFrequency
Working sampling frequency.
Definition Sample.h:301
bool SetWorkingFrequency(const unsigned int aWorkingFrequency)
Sets a new working sampling frequency.
Definition Sample.h:266
double GetHighPassFrequency(void)
Returns the current highpass frequency.
Definition Sample.h:295
double fHighPassFrequency
Cutoff frequency.
Definition Sample.h:303
bool fRemoveDC
DC removal flag.
Definition Sample.h:300
unsigned int fIntermediateFrequency
Intermediate sampling frequency.
Definition Sample.h:311
Sample(const unsigned int aVerbosity=0)
Constructor of the Sample class.
bool Transform(const unsigned int aInSize, double *aInData, const unsigned int aOutSize, double *aOutData)
Transforms data.
Definition Sample.cc:50
bool SetNativeFrequency(const int aNativeFrequency)
Sets a new native sampling frequency.
Definition Sample.h:254
void MakeSamplingFilters(void)
Constructs the re-sampling filters.
Definition Sample.cc:211
unsigned int fNativeFrequency
Native sampling frequency.
Definition Sample.h:302
double * fWindow
Window.
Definition Sample.h:304
void SetWindow(const unsigned int aWindowSize, double *aWindow)
Defines the window.
Definition Sample.h:223
void Resample(unsigned int aSize, double *aInData, double *aOutData)
Re-samples the data.
Definition Sample.cc:371
unsigned int fWindowSize
Window size.
Definition Sample.h:305
Monitor * mon
Class monitor.
Definition Sample.h:299
bool GetStatus(void)
Returns the class status.
Definition Sample.h:187
Produce a filter defined by a set of zeros, poles and a gain factor.
Definition Sample.h:24
double * poles[2]
Complex poles.
Definition Sample.h:95
void SetPole(const unsigned int aPoleIndex, const double aPoleRe, const double aPoleIm)
Set a filter pole.
Definition Sample.h:61
unsigned int npoles
Number of poles.
Definition Sample.h:93
void SetZero(const unsigned int aZeroIndex, const double aZeroRe, const double aZeroIm)
Set a filter zero.
Definition Sample.h:73
void SetGain(const double aGainRe, const double aGainIm)
Set a filter gain.
Definition Sample.h:84
virtual ~ZPGFilter(void)
Destructor of the ZPGFilter class.
Definition Sample.cc:419
unsigned int nzeros
Number of zeros.
Definition Sample.h:92
double gain[2]
Complex gain.
Definition Sample.h:96
void WToZ(void)
Move from the W- to Z-plane.
Definition Sample.cc:428
double * zeros[2]
Complex zeros.
Definition Sample.h:94