Krotos Modules 3
Loading...
Searching...
No Matches
krotos::SlopeGenerator Class Reference

Calculates the slope of the Envelope Follower. More...

#include <SlopEnvelopeOnsetdetection.h>

Public Member Functions

 SlopeGenerator ()
 
std::vector< float > createSlopeVectorFromEnvelope (std::vector< float > envelopeVector)
 
void setNumRegressionPoints (int numRegressionPoints)
 

Private Attributes

float m_sampleRate
 
int m_numRegressionPoints {}
 

Detailed Description

Calculates the slope of the Envelope Follower.

This class caclulates the slope of the envelope using a linear regression scheme. This method was chosen over a derivative one as it is more resistant to noise. A moving window skips forward one sample at a time performing a m_numRegressionPoints linear regression to calculate the slope.

Constructor & Destructor Documentation

◆ SlopeGenerator()

krotos::SlopeGenerator::SlopeGenerator ( )
inline

Member Function Documentation

◆ createSlopeVectorFromEnvelope()

std::vector< float > krotos::SlopeGenerator::createSlopeVectorFromEnvelope ( std::vector< float > envelopeVector)

Returns the slope Vector of an Envelope follower vector.

Parameters
envelopeVectorthe envelope Follower vector returns a vector<float> containing the slope values

◆ setNumRegressionPoints()

void krotos::SlopeGenerator::setNumRegressionPoints ( int numRegressionPoints)
inline

Sets the number of linear regression points

Parameters
numRegressionPointsthe new parameter value

Member Data Documentation

◆ m_numRegressionPoints

int krotos::SlopeGenerator::m_numRegressionPoints {}
private

◆ m_sampleRate

float krotos::SlopeGenerator::m_sampleRate
private

The documentation for this class was generated from the following files: