Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

HLF Class Reference

#include <ew.h>

Collaboration diagram for HLF:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HLF ()
void setAlpha (double)
void reset (double value)
void reset ()
double getHigh ()
double getLow ()
void update (double)

Private Attributes

double alpha
double high
double low

Constructor & Destructor Documentation

HLF::HLF  ) 
 

Definition at line 36 of file ew.cc.

References alpha, high, and low.

00036          {
00037   alpha = 0;
00038   high = low = 0;
00039 }


Member Function Documentation

double HLF::getHigh  ) 
 

Definition at line 61 of file ew.cc.

References high.

Referenced by EWdetector::updateAvg().

00061                     {
00062   return(high);
00063 }

double HLF::getLow  ) 
 

Definition at line 65 of file ew.cc.

References low.

Referenced by EWdetector::updateAvg().

00065                    {
00066   return(low);
00067 }

void HLF::reset  ) 
 

Definition at line 45 of file ew.cc.

00045                 {
00046   reset(0);
00047 }

void HLF::reset double  value  ) 
 

Definition at line 41 of file ew.cc.

References high, and low.

Referenced by EWdetector::resetAlarm(), and EWdetector::setAlarm().

00041                             {
00042   high = low = value;
00043 }

void HLF::setAlpha double   ) 
 

Definition at line 50 of file ew.cc.

References alpha.

Referenced by EWdetector::EWdetector().

00050                                {
00051   if (value > 1 || value < 0)
00052     return;
00053 
00054   if (value >= 0.5)
00055     alpha = value;
00056   else
00057     alpha = 1 - value;
00058 }

void HLF::update double   ) 
 

Definition at line 72 of file ew.cc.

References alpha, high, and low.

Referenced by EWdetector::updateAvg().

00072                              {
00073   high = alpha * high + (1 - alpha) * input;
00074   low = (1 - alpha) * low + alpha * input;
00075   //  printf("HLF %d %.2f, %.2f\n", (int)now, high, low);
00076 }


Member Data Documentation

double HLF::alpha [private]
 

Definition at line 126 of file ew.h.

Referenced by HLF(), setAlpha(), and update().

double HLF::high [private]
 

Definition at line 129 of file ew.h.

Referenced by getHigh(), HLF(), reset(), and update().

double HLF::low [private]
 

Definition at line 129 of file ew.h.

Referenced by getLow(), HLF(), reset(), and update().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 12:51:07 2004 for NS2.26SourcesOriginal by doxygen 1.3.3