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
ATVDemod::AvgExpInt Class Reference

Public Member Functions

 AvgExpInt (int log2Alpha)
 
void reset ()
 
int run (int m0)
 

Private Attributes

int m_log2Alpha
 
int m_m1
 
bool m_start
 

Detailed Description

Exponential average using integers and alpha as the inverse of a power of two

Definition at line 391 of file atvdemod.h.

Constructor & Destructor Documentation

◆ AvgExpInt()

ATVDemod::AvgExpInt::AvgExpInt ( int  log2Alpha)
inline

Definition at line 394 of file atvdemod.h.

394 : m_log2Alpha(log2Alpha), m_m1(0), m_start(true) {}

Member Function Documentation

◆ reset()

void ATVDemod::AvgExpInt::reset ( )
inline

Definition at line 395 of file atvdemod.h.

395 { m_start = true; }

◆ run()

int ATVDemod::AvgExpInt::run ( int  m0)
inline

Definition at line 397 of file atvdemod.h.

398  {
399  if (m_start)
400  {
401  m_m1 = m0;
402  m_start = false;
403  return m0;
404  }
405  else
406  {
407  m_m1 = m0 + m_m1 - (m_m1>>m_log2Alpha);
408  return m_m1>>m_log2Alpha;
409  }
410  }

Member Data Documentation

◆ m_log2Alpha

int ATVDemod::AvgExpInt::m_log2Alpha
private

Definition at line 413 of file atvdemod.h.

◆ m_m1

int ATVDemod::AvgExpInt::m_m1
private

Definition at line 414 of file atvdemod.h.

◆ m_start

bool ATVDemod::AvgExpInt::m_start
private

Definition at line 415 of file atvdemod.h.


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