comparison src/OnsetDetectionFunction.h @ 64:d3c52c6b3905

Changed all pointers to arrays in OnsetDetectionFunction into vectors
author Adam Stark <adamstark@users.noreply.github.com>
date Tue, 28 Jan 2014 00:19:21 +0000
parents ce806db4468b
children bddd59087c36
comparison
equal deleted inserted replaced
63:1395895f6cdf 64:d3c52c6b3905
21 21
22 #ifndef __ONSETDETECTIONFUNCTION_H 22 #ifndef __ONSETDETECTIONFUNCTION_H
23 #define __ONSETDETECTIONFUNCTION_H 23 #define __ONSETDETECTIONFUNCTION_H
24 24
25 #include "fftw3.h" 25 #include "fftw3.h"
26 #include <vector>
26 27
27 //======================================================================= 28 //=======================================================================
28 /** The type of onset detection function to calculate */ 29 /** The type of onset detection function to calculate */
29 enum OnsetDetectionFunctionType 30 enum OnsetDetectionFunctionType
30 { 31 {
155 156
156 fftw_plan p; /**< fftw plan */ 157 fftw_plan p; /**< fftw plan */
157 fftw_complex *complexIn; /**< to hold complex fft values for input */ 158 fftw_complex *complexIn; /**< to hold complex fft values for input */
158 fftw_complex *complexOut; /**< to hold complex fft values for output */ 159 fftw_complex *complexOut; /**< to hold complex fft values for output */
159 160
160 int initialised; /**< flag indicating whether buffers and FFT plans are initialised */ 161 bool initialised; /**< flag indicating whether buffers and FFT plans are initialised */
161 162
162 double *frame; /**< audio frame */ 163 std::vector<double> frame; /**< audio frame */
163 double *window; /**< window */ 164 std::vector<double> window; /**< window */
164 165
165 double prevEnergySum; /**< to hold the previous energy sum value */ 166 double prevEnergySum; /**< to hold the previous energy sum value */
166 167
167 double *magSpec; /**< magnitude spectrum */ 168 std::vector<double> magSpec; /**< magnitude spectrum */
168 double *prevMagSpec; /**< previous magnitude spectrum */ 169 std::vector<double> prevMagSpec; /**< previous magnitude spectrum */
169 170
170 double *phase; /**< FFT phase values */ 171 std::vector<double> phase; /**< FFT phase values */
171 double *prevPhase; /**< previous phase values */ 172 std::vector<double> prevPhase; /**< previous phase values */
172 double *prevPhase2; /**< second order previous phase values */ 173 std::vector<double> prevPhase2; /**< second order previous phase values */
173 174
174 }; 175 };
175 176
176 177
177 #endif 178 #endif