Mercurial > hg > btrack
comparison src/BTrack.h @ 59:ba3fc238ccad
Renamed many variables, functions and arguments so they have more sensible names. Also removed an apparently redundant variable in OnsetDetectionFunction called wframe
author | Adam Stark <adamstark@users.noreply.github.com> |
---|---|
date | Fri, 24 Jan 2014 21:45:55 +0000 |
parents | f84ccd07e17f |
children | bf256abf1dd4 |
comparison
equal
deleted
inserted
replaced
58:f84ccd07e17f | 59:ba3fc238ccad |
---|---|
88 | 88 |
89 /** Convert detection function from N samples to 512 */ | 89 /** Convert detection function from N samples to 512 */ |
90 void resampleOnsetDetectionFunction(); | 90 void resampleOnsetDetectionFunction(); |
91 | 91 |
92 /** update the cumulative score */ | 92 /** update the cumulative score */ |
93 void updateCumulativeScore(double df_sample); | 93 void updateCumulativeScore(double odfSample); |
94 | 94 |
95 /** predicts the next beat */ | 95 /** predicts the next beat */ |
96 void predictBeat(); | 96 void predictBeat(); |
97 | 97 |
98 /** Calculates the current tempo expressed as the beat period in detection function samples */ | 98 /** Calculates the current tempo expressed as the beat period in detection function samples */ |
101 /** calculates an adaptive threshold which is used to remove low level energy from detection | 101 /** calculates an adaptive threshold which is used to remove low level energy from detection |
102 * function and emphasise peaks | 102 * function and emphasise peaks |
103 */ | 103 */ |
104 void adaptiveThreshold(double *x,int N); | 104 void adaptiveThreshold(double *x,int N); |
105 | 105 |
106 /** calculates the mean of values in an array from index locations [start,end] */ | 106 /** calculates the mean of values in an array from index locations [startIndex,endIndex] */ |
107 double calculateMeanOfArray(double *array,int start,int end); | 107 double calculateMeanOfArray(double *array,int startIndex,int endIndex); |
108 | 108 |
109 /** normalises a given array */ | 109 /** normalises a given array */ |
110 void normaliseArray(double *array,int N); | 110 void normaliseArray(double *array,int N); |
111 | 111 |
112 /** calculates the balanced autocorrelation of the smoothed detection function */ | 112 /** calculates the balanced autocorrelation of the smoothed detection function */ |
148 | 148 |
149 double estimatedTempo; /**< the current tempo estimation being used by the algorithm */ | 149 double estimatedTempo; /**< the current tempo estimation being used by the algorithm */ |
150 | 150 |
151 double latestCumulativeScoreValue; /**< holds the latest value of the cumulative score function */ | 151 double latestCumulativeScoreValue; /**< holds the latest value of the cumulative score function */ |
152 | 152 |
153 double p_fact; | 153 double tempoToLagFactor; /**< factor for converting between lag and tempo */ |
154 | 154 |
155 int m0; // indicates when the next point to predict the next beat is | 155 int m0; /**< indicates when the next point to predict the next beat is */ |
156 | 156 |
157 int beatCounter; /**< keeps track of when the next beat is - will be zero when the beat is due, and is set elsewhere in the algorithm to be positive once a beat prediction is made */ | 157 int beatCounter; /**< keeps track of when the next beat is - will be zero when the beat is due, and is set elsewhere in the algorithm to be positive once a beat prediction is made */ |
158 | 158 |
159 int hopSize; /**< the hop size being used by the algorithm */ | 159 int hopSize; /**< the hop size being used by the algorithm */ |
160 | 160 |