Onset detector.
More...
#include <onsetdetector.h>
|
result_t | getSegAvg () |
| Get average of current segment.
|
|
std::pair< bool, std::size_t > | findExactTime (std::size_t incStart, std::size_t incStop) |
| Verify or reject onsets found by analyse
|
|
result_t | logResult (std::size_t channel, std::size_t idx) |
| Get item from DetectorCache and calculate log. More...
|
|
|
DetectorBank & | db |
| The DetectorBank which produces the results.
|
|
const std::size_t | offset |
| Number of pad samples at beginning of input buffer.
|
|
const std::size_t | chans |
| Number of channels.
|
|
const parameter_t | sr |
| Sample rate.
|
|
std::unique_ptr< detectorcache::Producer > | p |
| DetectorCache Producer.
|
|
const std::size_t | seg_len |
| OnsetDetector and DetectorCache segment length.
|
|
const std::size_t | num_segs |
| Number of segments to be stored.
|
|
std::unique_ptr< detectorcache::DetectorCache > | cache |
| DetectorCache from which to get abs(z) values.
|
|
std::size_t | n |
| Current sample number.
|
|
std::size_t | end |
| Total number of samples in cache.
|
|
std::ofstream | logfile |
|
std::ofstream | segfile |
|
Onset detector.
Definition at line 18 of file onsetdetector.h.
◆ OnsetDetector()
OnsetDetector::OnsetDetector |
( |
DetectorBank & |
db, |
|
|
const std::size_t |
offset, |
|
|
std::string |
csvfile |
|
) |
| |
Construct an onset detector, given a DetectorBank.
- Parameters
-
db | DetectorBank for this critical band |
offset | Number of pad samples at beginning of the input buffer |
◆ analyse()
void OnsetDetector::analyse |
( |
std::vector< std::size_t > & |
onsets, |
|
|
result_t |
threshold |
|
) |
| |
Analyse the input and return any onsets.
- Parameters
-
threshold | amplitude above which DetectorBank output must be in order to qualify as an onset |
- Returns
- vector of onset sample times
◆ logResult()
result_t OnsetDetector::logResult |
( |
std::size_t |
channel, |
|
|
std::size_t |
idx |
|
) |
| |
|
protected |
Get item from DetectorCache and calculate log.
If item is 0, 0 is returned
The documentation for this class was generated from the following file: