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 | Public Attributes | List of all members
FreeDVDemod::LevelRMS Struct Reference

Public Member Functions

 LevelRMS ()
 
void accumulate (float fsample)
 

Public Attributes

double m_sum
 
float m_peak
 
int m_n
 
bool m_reset
 

Detailed Description

Definition at line 249 of file freedvdemod.h.

Constructor & Destructor Documentation

◆ LevelRMS()

FreeDVDemod::LevelRMS::LevelRMS ( )

Definition at line 123 of file freedvdemod.cpp.

References FreeDVDemod::m_sum.

124 {
125  m_sum = 0.0f;
126  m_peak = 0.0f;
127  m_n = 0;
128  m_reset = true;
129 }

Member Function Documentation

◆ accumulate()

void FreeDVDemod::LevelRMS::accumulate ( float  fsample)

Definition at line 131 of file freedvdemod.cpp.

References FreeDVDemod::m_sum, and leansdr::max().

Referenced by FreeDVDemod::pushSampleToDV().

132 {
133  if (m_reset)
134  {
135  m_sum = level * level;
136  m_peak = std::fabs(level);
137  m_n = 1;
138  m_reset = false;
139  }
140  else
141  {
142  m_sum += level * level;
143  m_peak = std::max(m_peak, std::fabs(level));
144  m_n++;
145  }
146 }
T max(const T &x, const T &y)
Definition: framework.h:446
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_n

int FreeDVDemod::LevelRMS::m_n

Definition at line 256 of file freedvdemod.h.

Referenced by FreeDVDemod::pushSampleToDV().

◆ m_peak

float FreeDVDemod::LevelRMS::m_peak

Definition at line 255 of file freedvdemod.h.

Referenced by FreeDVDemod::pushSampleToDV().

◆ m_reset

bool FreeDVDemod::LevelRMS::m_reset

Definition at line 257 of file freedvdemod.h.

Referenced by FreeDVDemod::pushSampleToDV().

◆ m_sum

double FreeDVDemod::LevelRMS::m_sum

Definition at line 254 of file freedvdemod.h.

Referenced by FreeDVDemod::pushSampleToDV().


The documentation for this struct was generated from the following files: