A class calculating onset positions of signal based on a slope vector describing it's envelope.
More...
#include <SlopEnvelopeOnsetdetection.h>
|
| std::pair< int, int > | detectAttackSegment (const std::vector< float > &slopeFrame, const std::vector< float > &normalisedEnvelopeFrame, float thresholdValue) |
| |
A class calculating onset positions of signal based on a slope vector describing it's envelope.
This class handles the segmentation process using an iterative scheme. Each time a new onset-attackPosition is found the segment is extracted and the detection process is repeated until the next is found. Segmentation results are heavily influenced by the values of the segmentation parameters. Play around to fine tune to your signal.
◆ OnsetDetector()
| krotos::OnsetDetector::OnsetDetector |
( |
float | sampleRate | ) |
|
◆ calculateOnsetsGlobal()
| std::vector< int > krotos::OnsetDetector::calculateOnsetsGlobal |
( |
std::vector< float > | slopeVector, |
|
|
std::vector< float > | normalisedEnvelopeVector ) |
Contains the overall structure of the iterative routine. Terminates either if no more attacks-onsets are present in the signal or the whole signal has been consumed. Performs a search based on the slope Vector and assigns the normalised Envelope Vector to detectAttackSegment which is called iteratively.
- Parameters
-
| slopeVector | the slope of the envelope Vector |
| normalisedEnvelopeVector | the normalised envelope follower Vector |
◆ detectAttackSegment()
| std::pair< int, int > krotos::OnsetDetector::detectAttackSegment |
( |
const std::vector< float > & | slopeFrame, |
|
|
const std::vector< float > & | normalisedEnvelopeFrame, |
|
|
float | thresholdValue ) |
|
private |
Detects the first attack segment in a region of the signal and returns a pair of attackPosition and finishPositions to move the iteration forward.
◆ setDecayLengthMiliSeconds()
| void krotos::OnsetDetector::setDecayLengthMiliSeconds |
( |
float | decayLengthMiliSeconds | ) |
|
◆ setOnsetMiliSeconds()
| void krotos::OnsetDetector::setOnsetMiliSeconds |
( |
float | onsetMiliSeconds | ) |
|
◆ setThresholdPercentage()
| void krotos::OnsetDetector::setThresholdPercentage |
( |
float | thresholdPercentage | ) |
|
Setters for the 3 main segmentation Parameters.
◆ m_decayLength
| int krotos::OnsetDetector::m_decayLength {} |
|
private |
◆ m_epsilon
| float krotos::OnsetDetector::m_epsilon = 1e-6f |
|
private |
◆ m_finishFlag
| bool krotos::OnsetDetector::m_finishFlag {false} |
|
private |
◆ m_onset
| int krotos::OnsetDetector::m_onset {} |
|
private |
◆ m_sampleRate
| float krotos::OnsetDetector::m_sampleRate |
|
private |
◆ m_threshold
| float krotos::OnsetDetector::m_threshold {0.0f} |
|
private |
The documentation for this class was generated from the following files: