LASP 1.0
Library for Acoustic Signal Processing
|
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>
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. | |
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.
PPMHandler::PPMHandler | ( | SmgrHandle | mgr, |
const d | decay_dBps = 20.0 |
||
) |
Constructs Peak Programme Meter.
mgr | Stream Mgr to install callbacks for |
decay_dBps | The level decay in units dB/s, after a peak has been hit. |
Definition at line 14 of file lasp_ppm.cpp.
PPMHandler::~PPMHandler | ( | ) |
Definition at line 111 of file lasp_ppm.cpp.
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.
Definition at line 69 of file lasp_ppm.cpp.
void PPMHandler::inCallback | ( | const DaqData & | d | ) |
Implements callback on thread.
d | DaqData to work with |
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.
void PPMHandler::reset | ( | const Daq * | daq | ) |
Definition at line 80 of file lasp_ppm.cpp.