home *** CD-ROM | disk | FTP | other *** search
/ PC Musician 2000 / PC_Musician_2000.iso / PCMUSIC / NOTATION / SILENCE / ONEPOLE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-17  |  983 b   |  36 lines

  1. /*******************************************/
  2. /*  One Pole Filter Class,                 */
  3. /*  by Perry R. Cook, 1995-96              */ 
  4. /*  The parameter gain is an additional    */
  5. /*  gain parameter applied to the filter   */  
  6. /*  on top of the normalization that takes */
  7. /*  place automatically.  So the net max   */
  8. /*  gain through the system equals the     */
  9. /*  value of gain.  sgain is the combina-  */
  10. /*  tion of gain and the normalization     */
  11. /*  parameter, so if you set the poleCoeff */
  12. /*  to alpha, sgain is always set to       */
  13. /*  gain * (1.0 - fabs(alpha)).            */
  14. /*******************************************/
  15.  
  16. #if !defined(__OnePole_h)
  17. #define __OnePole_h
  18.  
  19. #include "Filter.h"
  20.  
  21. class OnePole : public Filter
  22. {
  23.   protected:  
  24.     MY_FLOAT poleCoeff;
  25.     MY_FLOAT sgain;
  26.   public:
  27.     OnePole();
  28.     ~OnePole();
  29.     void clear();
  30.     void setPole(MY_FLOAT aValue);
  31.     void setGain(MY_FLOAT aValue);
  32.     MY_FLOAT tick(MY_FLOAT sample);
  33. };
  34.  
  35. #endif
  36.