diff src/OnsetDetectionFunction.h @ 15:2b94d3d2fb9d develop

Reformatted comments, removed the OnsetDetectionFunction constructor with no arguments, removed a number of unused variables and made changes to the python module to fix some casting problems and removed some unused variables there also. Still getting the same results, so no overall changes to the algorithm.
author Adam <adamstark.uk@gmail.com>
date Wed, 22 Jan 2014 01:13:45 +0000
parents bd2c405d4a06
children 73c64ca0ed23
line wrap: on
line diff
--- a/src/OnsetDetectionFunction.h	Tue Jan 21 10:24:33 2014 +0000
+++ b/src/OnsetDetectionFunction.h	Wed Jan 22 01:13:45 2014 +0000
@@ -27,64 +27,100 @@
 class OnsetDetectionFunction
 {
 public:
-	OnsetDetectionFunction();																// Constructor
-	OnsetDetectionFunction(int arg_hsize,int arg_fsize,int arg_df_type,int arg_win_type);	// Constructor (with arguments)
-	~OnsetDetectionFunction();																// Destructor
-	void initialise(int arg_hsize,int arg_fsize,int arg_df_type,int arg_win_type);			// Initialisation Function
+    
+    /** Constructor */
+	OnsetDetectionFunction(int arg_hsize,int arg_fsize,int arg_df_type,int arg_win_type);
+    
+    /** Destructor */
+	~OnsetDetectionFunction();
+    
+    /** Initialisation Function */
+	void initialise(int arg_hsize,int arg_fsize,int arg_df_type,int arg_win_type);
 	
-	double getDFsample(double inputbuffer[]);												// process input buffer and calculate detection function sample
-	void set_df_type(int arg_df_type);														// set the detection function type
+    /** process input buffer and calculate detection function sample */
+	double getDFsample(double inputbuffer[]);
+    
+    /** set the detection function type */
+	void set_df_type(int arg_df_type);
 	
 private:
 	
-	void perform_FFT();																		// perform the FFT on the data in 'frame'
+    /** perform the FFT on the data in 'frame' */
+	void perform_FFT();
 
-	double energy_envelope();																// calculate energy envelope detection function sample
-	double energy_difference();																// calculate energy difference detection function sample
-	double spectral_difference();															// calculate spectral difference detection function sample
-	double spectral_difference_hwr();														// calculate spectral difference (half wave rectified) detection function sample
-	double phase_deviation();																// calculate phase deviation detection function sample
-	double complex_spectral_difference();													// calculate complex spectral difference detection function sample
-	double complex_spectral_difference_hwr();												// calculate complex spectral difference detection function sample (half-wave rectified)
-	double high_frequency_content();														// calculate high frequency content detection function sample
-	double high_frequency_spectral_difference();											// calculate high frequency spectral difference detection function sample
-	double high_frequency_spectral_difference_hwr();										// calculate high frequency spectral difference detection function sample (half-wave rectified)
+    /** calculate energy envelope detection function sample */
+	double energy_envelope();
+    
+    /** calculate energy difference detection function sample */
+	double energy_difference();
+    
+    /** calculate spectral difference detection function sample */
+	double spectral_difference();
+    
+    /** calculate spectral difference (half wave rectified) detection function sample */
+	double spectral_difference_hwr();
+    
+    /** calculate phase deviation detection function sample */
+	double phase_deviation();
+    
+    /** calculate complex spectral difference detection function sample */
+	double complex_spectral_difference();
+    
+    /** calculate complex spectral difference detection function sample (half-wave rectified) */
+	double complex_spectral_difference_hwr();
+    
+    /** calculate high frequency content detection function sample */
+	double high_frequency_content();
+    
+    /** calculate high frequency spectral difference detection function sample */
+	double high_frequency_spectral_difference();
+    
+    /** calculate high frequency spectral difference detection function sample (half-wave rectified) */
+	double high_frequency_spectral_difference_hwr();
 
-	void set_win_rectangular();																// calculate a Rectangular window	
-	void set_win_hanning();																	// calculate a Hanning window
-	void set_win_hamming();																	// calculate a Hamming window
-	void set_win_blackman();																// calculate a Blackman window
-	void set_win_tukey();																	// calculate a Tukey window
+    /** calculate a Rectangular window */
+	void set_win_rectangular();
+    
+    /** calculate a Hanning window */
+	void set_win_hanning();
+    
+    /** calculate a Hamming window */
+	void set_win_hamming();
+    
+    /** calculate a Blackman window */
+	void set_win_blackman();
+    
+    /** calculate a Tukey window */
+	void set_win_tukey();
 
+	/** set phase values between [-pi, pi] */
+	double princarg(double phaseval);
 	
-	double princarg(double phaseval);														// set phase values between [-pi, pi]
 	
+	double pi;							/**< pi, the constant */
 	
-	double pi;																				// pi, the constant
+	int framesize;						/**< audio framesize */
+	int hopsize;						/**< audio hopsize */
+	int df_type;						/**< type of detection function */
 	
-	int framesize;																			// audio framesize
-	int hopsize;																			// audio hopsize	
-	int df_type;																			// type of detection function
+	fftw_plan p;						/**< create fft plan */
+	fftw_complex *in;					/**< to hold complex fft values for input */
+	fftw_complex *out;					/**< to hold complex fft values for output */
 	
-	fftw_plan p;																			// create fft plan
-	fftw_complex *in;																		// to hold complex fft values for input
-	fftw_complex *out;																		// to hold complex fft values for output
+	int initialised;					/**< flag indicating whether buffers and FFT plans are initialised */
+
+	double *frame;						/**< audio frame */
+	double *window;						/**< window */
+	double *wframe;						/**< windowed frame */
 	
-	int initialised;																		// flag indicating whether buffers and FFT plans have been initialised
+	double energy_sum_old;				/**< to hold the previous energy sum value */
 	
-
-	double *frame;																			// audio frame
-	double *window;																			// window
-	double *wframe;																			// windowed frame
+	double *mag;						/**< magnitude spectrum */
+	double *mag_old;					/**< previous magnitude spectrum */
 	
-	double energy_sum_old;																	// to hold the previous energy sum value
-	
-	double *mag;																			// magnitude spectrum
-	double *mag_old;																		// previous magnitude spectrum
-	
-	double *phase;																			// FFT phase values
-	double *phase_old;																		// previous phase values
-	double *phase_old_2;																	// second order previous phase values
+	double *phase;						/**< FFT phase values */
+	double *phase_old;					/**< previous phase values */
+	double *phase_old_2;				/**< second order previous phase values */
 
 };