LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches

Digital Peak Programme Meter (PPM). Let the latest maximum flow away with a certain amount of dB/s. If a new peak is found, it goes up again. Also detects clipping. More...

#include <lasp_ppm.h>

Inheritance diagram for PPMHandler:
Collaboration diagram for PPMHandler:

Public Member Functions

 PPMHandler (SmgrHandle mgr, const d decay_dBps=20.0)
 Constructs Peak Programme Meter.
 
 ~PPMHandler ()
 
std::tuple< vd, arma::uvec > getCurrentValue () const
 Get the current values of the PPM. Returns an array of levels in dB and a vector of True's.
 
void inCallback (const DaqData &d)
 Implements callback on thread.
 
void reset (const Daq *)
 
- Public Member Functions inherited from ThreadedInDataHandler< PPMHandler >
 ThreadedInDataHandler (SmgrHandle mgr)
 
void _reset (const Daq *daq)
 
void _inCallback (const DaqData &data)
 
- Public Member Functions inherited from ThreadedInDataHandlerBase
 ThreadedInDataHandlerBase (SmgrHandle mgr, InCallbackType cb, InResetType reset)
 
 ~ThreadedInDataHandlerBase ()
 
void startThread ()
 This method should be called from the derived class' constructor, to start the thread and data is incoming.
 
void stopThread ()
 This method SHOULD be called from all classes that derive on ThreadedInDataHandler. It is to make sure the inCallback_threaded() function is no longer called when the destructor of the derived class is called. Not calling this function is regarded as a BUG.
 

Detailed Description

Digital Peak Programme Meter (PPM). Let the latest maximum flow away with a certain amount of dB/s. If a new peak is found, it goes up again. Also detects clipping.

Definition at line 25 of file lasp_ppm.h.

Constructor & Destructor Documentation

◆ PPMHandler()

PPMHandler::PPMHandler ( SmgrHandle  mgr,
const d  decay_dBps = 20.0 
)

Constructs Peak Programme Meter.

Parameters
mgrStream Mgr to install callbacks for
decay_dBpsThe level decay in units dB/s, after a peak has been hit.

Definition at line 14 of file lasp_ppm.cpp.

◆ ~PPMHandler()

PPMHandler::~PPMHandler ( )

Definition at line 111 of file lasp_ppm.cpp.

Member Function Documentation

◆ getCurrentValue()

std::tuple< vd, arma::uvec > PPMHandler::getCurrentValue ( ) const

Get the current values of the PPM. Returns an array of levels in dB and a vector of True's.

Returns
Current levels in [dB], clipping indication

Definition at line 69 of file lasp_ppm.cpp.

◆ inCallback()

void PPMHandler::inCallback ( const DaqData d)

Implements callback on thread.

Parameters
dDaqData to work with
Returns
true when stream should continue.

Obtain max abs values for each column, convert this row-vec to a column vector, and scale with the max-range for each channel

Find indices for channels that have a clip

Find channels where the new maximum is higher than the previous one

Reset clip counter

Reset to 'unclipped'

Add a bit of clip time

Definition at line 21 of file lasp_ppm.cpp.

◆ reset()

void PPMHandler::reset ( const Daq daq)

Definition at line 80 of file lasp_ppm.cpp.


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