SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Attributes | List of all members
RemoteOutputExpAvg Class Reference

#include <remoteoutputgui.h>

Public Member Functions

 RemoteOutputExpAvg (float alpha)
 
int put (int y)
 
void reset ()
 

Private Attributes

float m_alpha
 
bool m_start
 
float m_s
 

Detailed Description

Definition at line 45 of file remoteoutputgui.h.

Constructor & Destructor Documentation

◆ RemoteOutputExpAvg()

RemoteOutputExpAvg::RemoteOutputExpAvg ( float  alpha)
inline

Definition at line 47 of file remoteoutputgui.h.

47  :
48  m_alpha(alpha),
49  m_start(true),
50  m_s(0)
51  {}

Member Function Documentation

◆ put()

int RemoteOutputExpAvg::put ( int  y)
inline

Definition at line 52 of file remoteoutputgui.h.

53  {
54  if (m_start) {
55  m_start = false;
56  m_s = y;
57  } else {
58  m_s = m_alpha*y + (1.0-m_alpha)*m_s;
59  }
60  return roundf(m_s);
61  }

◆ reset()

void RemoteOutputExpAvg::reset ( )
inline

Definition at line 62 of file remoteoutputgui.h.

62  {
63  m_start = true;
64  }

Member Data Documentation

◆ m_alpha

float RemoteOutputExpAvg::m_alpha
private

Definition at line 67 of file remoteoutputgui.h.

◆ m_s

float RemoteOutputExpAvg::m_s
private

Definition at line 69 of file remoteoutputgui.h.

◆ m_start

bool RemoteOutputExpAvg::m_start
private

Definition at line 68 of file remoteoutputgui.h.


The documentation for this class was generated from the following file: