
#ifndef _Filter_H
#define _Filter_H

#include "PrGlobalDefn.h"

class PrVector;

class Filter
{
public:
  Filter(){};
  Filter(const Filter &);
  Filter &operator=(const Filter &);
 ~Filter();

  // Use this after a filter has been initialized to filter the data
  void filt(const PrVector &in, PrVector &out);


  // General digital filter: z_num/zden
  void init_zNumDen
       (const PrVector &r0, const PrVector &z_num, const PrVector &z_den);

  // Filters below are digital equivalents using Tustin's method
  void init_LowPass   // w/(s+w)
       (const PrVector &r0, Float sampFreq, Float cutOffFreq);
  void init_dLowPass  // (s*w)/(s+w)
       (const PrVector &r0, Float sampFreq, Float cutOffFreq);
  void init_d   //  s
       (const PrVector &r0, Float sampFreq);


private:
  int size_;
  int order_;
  Float period_;
  
  PrVector *a_;
  PrVector *b_;
  PrVector *w_;

  PrVector **f_;
  PrVector **r_;

  void Allocate( int size, int order );

};

#endif // _Filter_H
