22 std::unique_ptr<Filter> _pre_filter;
27 std::vector<std::unique_ptr<Filter>> _bandpass;
71 SLM(
const d fs,
const d Lref,
const us downsampling_fac,
const d tau,
72 std::unique_ptr<Filter> pre_filter,
73 std::vector<std::unique_ptr<Filter>> bandpass);
91 const d tau,
const vd &pre_filter_coefs,
92 const dmat &bandpass_coefs);
109 const d tau,
const dmat &bandpass_coefs);
146 vd Leq()
const {
return 10 * arma::log10(
Pm / Lrefsq); };
170 vd run_single(
vd input,
const us filter_no);
Simple wrapper around BS::thread_pool that makes a BS::thread_pool a singleton, such that a thread po...
Sound Level Meter implementation that gives a result for each channel. A channel is the result of a f...
vd Pmax
Public storage for the maximum signal power, after single pole low-pass filter.
vd Leq() const
Calculates equivalent (time-averaged) levels measured for each filter channel.
vd Pm
Public storage for the mean of the square of the signal.
static us suggestedDownSamplingFac(const d fs, const d tw)
Comput a 'suggested' downsampling factor, i.e. a lower frame rate at which sound level meter values a...
SLM & operator=(const SLM &o)=delete
dmat run(const vd &input)
Run the sound level meter on given input data. Return downsampled level data for each filterbank chan...
vd Lpeak() const
Calculates peak levels measured for each filter channel. The peak level is just the highest instantan...
vd Lmax() const
Calculates max levels measured for each filter channel. The max value is the maximum time-filtered (F...
void reset()
Reset state related to samples acquired. All filters reset to zero. Start again from no history.
vd Ppeak
Storage for maximum computed signal power so far.
static SLM fromBiquads(const d fs, const d Lref, const us downsampling_fac, const d tau, const vd &pre_filter_coefs, const dmat &bandpass_coefs)
Convenience function to create a Sound Level meter from Biquad filters only.
size_t us
We often use boolean values.