diff --git a/docs/rapidmix.doxyfile b/docs/rapidmix.doxyfile index 536883129adf4828d5257cd50460d363a92b99af..9e073fc5706b08a60523a4b00ca39658b7384cfe 100644 --- a/docs/rapidmix.doxyfile +++ b/docs/rapidmix.doxyfile @@ -866,7 +866,7 @@ FILE_PATTERNS = *.c \ # be searched for input files as well. # The default value is: NO. -RECURSIVE = NO +RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a diff --git a/src/signalProcessing/rapidStream.h b/src/signalProcessing/rapidStream.h deleted file mode 100644 index 1ac99a67145d1b25f9450bb60b7dc4375d9c9afa..0000000000000000000000000000000000000000 --- a/src/signalProcessing/rapidStream.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef rapidStream_h -#define rapidStream_h - -#include <stdint.h> - -//Buffer of past values - - -//Standard Deviation over Window - -//Min accel over window -//Max accel over window - -//Buffer of past satisfying condition -//expression - -class rapidStream { -public: - rapidStream(); - rapidStream(int windowSize); - ~rapidStream(); - - void clear(); - void pushToWindow(double input); - - double velocity(); - double acceleration(); - - double minimum(); - double maximum(); - - double sum(); - double mean(); - double standardDeviation(); - - double minVelocity(); - double maxVelocity(); - - double minAcceleration(); - double maxAcceleration(); - -private: - uint32_t windowSize; - uint32_t windowIndex; - double *circularWindow; - - double calcCurrentVel(int i); -}; - - -#endif \ No newline at end of file diff --git a/src/signalProcessing/rapidStream.cpp b/src/signalProcessing/rapidStream/rapidStream.cpp similarity index 96% rename from src/signalProcessing/rapidStream.cpp rename to src/signalProcessing/rapidStream/rapidStream.cpp index 1d39aea08592e3bfa353ed0166b18ca2965f0f26..42c13151ed3c796258612d1dfd3f176a9505cfd1 100644 --- a/src/signalProcessing/rapidStream.cpp +++ b/src/signalProcessing/rapidStream/rapidStream.cpp @@ -1,3 +1,9 @@ +/* + * rapidStream.cpp + * Created by Michael Zbyszynski on 6 Feb 2017 + * Copyright © 2017 Goldsmiths. All rights reserved. + */ + #include "rapidStream.h" #include <iostream> #include <cmath> diff --git a/src/signalProcessing/rapidStream/rapidStream.h b/src/signalProcessing/rapidStream/rapidStream.h new file mode 100644 index 0000000000000000000000000000000000000000..30731ea6b40752b44d03f2e4358fdb67cb7c6a3e --- /dev/null +++ b/src/signalProcessing/rapidStream/rapidStream.h @@ -0,0 +1,100 @@ +/* + * rapidStream.h + * Created by Michael Zbyszynski on 6 Feb 2017 + * Copyright © 2017 Goldsmiths. All rights reserved. + */ + +#ifndef rapidStream_h +#define rapidStream_h + +#include <stdint.h> +class rapidStream { +public: + + /** + * Create a circular buffer with 3 elements. + */ + rapidStream(); + /** + * Create a circular buffer with an arbitrary number of elements. + * @param int: number of elements to hold in the buffer + */ + rapidStream(int windowSize); + + ~rapidStream(); + + /** + * Resets all the values in the buffer to zero. + */ + void clear(); + + /** Add a value to a circular buffer whose size is defined at creation. + * @param double: value to be pushed into circular buffer. + */ + void pushToWindow(double input); + + /** Calculate the first-order difference (aka velocity) between the last two inputs. + * @return double: difference between last two inputs. + */ + double velocity(); + + /** Calculate the second-order difference (aka acceleration) over the last three inputs. + * @return double: acceleration over the last three inputs. + */ + double acceleration(); + + /** Find the minimum value in the buffer. + * @return double: minimum. + */ + double minimum(); + + /** Find the maximum value in the buffer. + * @return double: maximum. + */ + double maximum(); + + /** Calculate the sum of all values in the buffer. + * @return double: sum. + */ + double sum(); + + /** Calculate the mean of all values in the buffer. + * @return double: mean. + */ + double mean(); + + /** Calculate the standard deviation of all values in the buffer. + * @return double: standard deviation. + */ + double standardDeviation(); + + /** Calculate the minimum first-order difference over consecutive inputs in the buffer. + * @return double: minimum velocity. + */ + double minVelocity(); + + /** Calculate the maximum first-order difference over consecutive inputs in the buffer. + * @return double: maximum velocity. + */ + double maxVelocity(); + + /** Calculate the minimum second-order difference over consecutive inputs in the buffer. + * @return double: minimum acceleration. + */ + double minAcceleration(); + + /** Calculate the maximum second-order difference over consecutive inputs in the buffer. + * @return double: maximum acceleration. + */ + double maxAcceleration(); + +private: + uint32_t windowSize; + uint32_t windowIndex; + double *circularWindow; + + double calcCurrentVel(int i); +}; + + +#endif \ No newline at end of file diff --git a/src/signalProcessing/signalProcessing.h b/src/signalProcessing/signalProcessing.h new file mode 100644 index 0000000000000000000000000000000000000000..087b6381ac7692ded5c83732b916dc86000c821f --- /dev/null +++ b/src/signalProcessing/signalProcessing.h @@ -0,0 +1,25 @@ +/* + * signalProcessing.h + * Created by Michael Zbyszynski on 6 Feb 2017 + * Copyright © 2017 Goldsmiths. All rights reserved. + */ + +#ifndef signalProcessing_h +#define signalProcessing_h + +#include "rapidMix.h" +#include "maximilian.h" +#include "maxim.h" +#include "rapidStream.h" +#include "rapidPiPoTools.h" + +RAPIDMIX_BEGIN_NAMESPACE + +typedef maxiFFT FFT; +typedef maxiMFCC MFCC; +typedef rapidStream rapidStream; //MZ: Best... typedef... EVER! + + +RAPIDMIX_END_NAMESPACE + +#endif