source: trunk/src/Utils/Hanning.hh @ 221

Last change on this file since 221 was 221, checked in by Matthew Whiting, 17 years ago

More documentation being added to source code, with a new file (src/Utils/Hanning.cc) added as well.

File size: 869 bytes
Line 
1#ifndef HANNING_H
2#define HANNING_H
3
4/**
5 *  Define a Hanning filter.
6 *
7 *  A simple class to define a Hanning filter.
8 *  It is characterised by a full width \f$2a-1\f$ (this is the number of coefficients
9 *   and a set of coefficients that follow the functional form of
10 *   \f$c(x) = 0.5 + 0.5\cos(\pi x / a)\f$.
11 */
12
13class Hanning
14{
15public:
16  Hanning();          ///< basic constructor -- no filter width set
17  virtual ~Hanning(); ///< destructor
18  Hanning(int size);  ///< specific constructor that sets width and coefficients
19
20  float *smooth(float *array, int npts);  ///< Smooth an array with the Hanning filter.
21   
22private:
23  int hanningSize; ///< The full width of the filter (number of coefficients)
24  float *coeffs;   ///< The coefficients of the filter
25  bool allocated;  ///< Have the coefficients been allocated in memory?
26
27};
28
29#endif  // HANNING_H
Note: See TracBrowser for help on using the repository browser.