Mercurial > hg > btrack
diff src/OnsetDetectionFunction.h @ 66:b387d8327729
Overloaded initialise in OnsetDetectionFunction so the hopSize and frameSize can be set independently of the window type and onset detection function type
author | Adam Stark <adamstark@users.noreply.github.com> |
---|---|
date | Tue, 28 Jan 2014 00:49:53 +0000 |
parents | d3c52c6b3905 |
children | f6708e4c69f1 |
line wrap: on
line diff
--- a/src/OnsetDetectionFunction.h Tue Jan 28 00:31:17 2014 +0000 +++ b/src/OnsetDetectionFunction.h Tue Jan 28 00:49:53 2014 +0000 @@ -58,24 +58,39 @@ { public: + /** Constructor that defaults the onset detection function type to ComplexSpectralDifferenceHWR + * and the window type to HanningWindow + * @param hopSize_ the hop size in audio samples + * @param frameSize_ the frame size in audio samples + */ + OnsetDetectionFunction(int hopSize_,int frameSize_); + + /** Constructor * @param hopSize_ the hop size in audio samples * @param frameSize_ the frame size in audio samples * @param onsetDetectionFunctionType_ the type of onset detection function to use - (see OnsetDetectionFunctionType) * @param windowType the type of window to use (see WindowType) */ - OnsetDetectionFunction(int hopSize_,int frameSize_,int onsetDetectionFunctionType_,int windowType); + OnsetDetectionFunction(int hopSize_,int frameSize_,int onsetDetectionFunctionType_,int windowType_); /** Destructor */ ~OnsetDetectionFunction(); + /** Initialisation function for only updating hop size and frame size (and not window type + * or onset detection function type + * @param hopSize_ the hop size in audio samples + * @param frameSize_ the frame size in audio samples + */ + void initialise(int hopSize_,int frameSize_); + /** Initialisation Function * @param hopSize_ the hop size in audio samples * @param frameSize_ the frame size in audio samples * @param onsetDetectionFunctionType_ the type of onset detection function to use - (see OnsetDetectionFunctionType) * @param windowType the type of window to use (see WindowType) */ - void initialise(int hopSize_,int frameSize_,int onsetDetectionFunctionType_,int windowType); + void initialise(int hopSize_,int frameSize_,int onsetDetectionFunctionType_,int windowType_); /** Process input frame and calculate detection function sample * @param buffer a pointer to an array containing the audio samples to be processed @@ -153,6 +168,7 @@ int frameSize; /**< audio framesize */ int hopSize; /**< audio hopsize */ int onsetDetectionFunctionType; /**< type of detection function */ + int windowType; /**< type of window used in calculations */ fftw_plan p; /**< fftw plan */ fftw_complex *complexIn; /**< to hold complex fft values for input */