LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp_ppm.h
Go to the documentation of this file.
1// lasp_ppm.h
2//
3// Author: J.A. de Jong - ASCEE
4//
5// Description: Peak Programme Meter
6#pragma once
7#include "lasp_filter.h"
8#include "lasp_mathtypes.h"
10
25class PPMHandler : public ThreadedInDataHandler<PPMHandler> {
26
30 static inline const d clip_point = 0.98;
31
36 static inline const d clip_indication_time = 3.0;
37
38 const d _decay_dBps;
39
43 d _dt;
44
48 d _alpha;
49
50 mutable std::mutex _mtx;
54 vd _cur_max;
55
60 vd _clip_time;
61
65 vd _max_range;
66
67 public:
75 PPMHandler(SmgrHandle mgr,const d decay_dBps = 20.0);
77
84 std::tuple<vd,arma::uvec> getCurrentValue() const;
85
93 void inCallback(const DaqData& d);
94 void reset(const Daq*);
95
96};
97
Data coming from / going to DAQ. Non-interleaved format, which means data in buffer is ordered by cha...
Base cass for all DAQ (Data Acquisition) interfaces. A DAQ can be a custom device,...
Definition lasp_daq.h:29
Digital Peak Programme Meter (PPM). Let the latest maximum flow away with a certain amount of dB/s....
Definition lasp_ppm.h:25
void inCallback(const DaqData &d)
Implements callback on thread.
Definition lasp_ppm.cpp:21
void reset(const Daq *)
Definition lasp_ppm.cpp:80
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.
Definition lasp_ppm.cpp:69
A bit of curiously recurring template pattern, to connect the specific handlers and connect the prope...
std::shared_ptr< StreamMgr > SmgrHandle
arma::Col< d > vd