class Filter Digital filter design and implementation API.
The Filter class object implements a digital FIR filter that can be used to filter time series (TSeries) data. Filter class instances carry the signal history as well as the filter coefficients to prevent the introduction of edge effect when filtering a long series in serveral pieces. Each signal (channel) to be filtered must use a separate Filter instance.
Filter(int length, float Sample)
Sample - Nominal sampling rate.
~Filter(void)
int getLength(void) const
double getRate(void) const
bool getStat(void) const
int estLen(int nBand, const double* Bands, const double* Ripple) const
Bands - A list of band frequency edges.
Ripple - The desired ripple in a pass-band or attenuation in a
stop-band for each frequency band.
int estLPLen(double Fpass, double Fstop, double rip, double atten) const
FStop - Lower edge frequency in Hz of the stop band.
rip - Desired maximum pass band ripple (as a fraction).
atten - Desired stop band attenuation (as a fraction).
void design(int nPoles, const dComplex* Poles, int nZeros=0, const dComplex* Zeros=0)
void dRemez(int nBand, const double* Bands, const double* Func, const double* Weight=0)
Bands - Band limit frequencies in Hz.
Func - Desired response in each band.
Weight - Weighting factor for each band. If not specified, Weight
is assumed to be 1.0 for each band.
void dFirW(int N, const char* window, const char* type, double Flow, double Fhigh=0, double dF=0, double Ripple=0)
window - Type of window on which to base the design.
type - Type of filter.
Flow - Transition frequency of a low-pass or high-pass filter,
or lower edge of a band-pass or band-stop filter.
Fhigh - Upper edge of a band-pass or band-stop filter.
dF - Transition band width in Kaiser and Chebyshev filters.
Ripple - Desired attenuation for Kaiser filters or the desired
pass-band ripple for Chebyshev filters (in dB).
void dump(ostream& ostr) const
DVector& operator)(DVector& in)
TSeries operator)(const TSeries& in)
TSeries& apply(const TSeries& in, TSeries& out)
out - Time series into which the filter response will be stored.
TSeries& apply(TSeries& in)
void apply(int N, const float* in, float* out)
in - Float array containing the input series.
out - Float array to contain the filter response. the end of
out may overlap the start of in.
void apply(int N, const fComplex* in, fComplex* out)
in - Float array containing the input series.
out - Float array to contain the filter response. the end of
out may overlap the start of in.
void setCoefs(int N, const double* Coefs)
Coefs - A list of filter coefficients (filter impulse response).
void setHistory(int N, const float* Hist=0, Time t=Time(0))
Hist - Filter history vector.
t - Time of the last sample in the history list.
void setHistory(int N, const fComplex* Hist, Time t=Time(0))
Hist - Filter history vector.
t - Time of the last sample in the history list.
void setLength(int N)
void setRate(double F)
FSeries Xfer(float Fmin=0.0, float Fmax=0.0, float dF=1.0) const
Fmax - Maximum frequency at which to sample the transfer function.
dF - Frequency step.
alphabetic index hierarchy of classes
generated by doc++