aboutsummaryrefslogtreecommitdiffstats
path: root/include/libgha.h
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2018-11-03 21:17:03 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2018-11-03 21:17:03 +0300
commitd8502a297b556cb06bf59bd00b2524931a8f034a (patch)
treed2633c73f96b0e05f0dcc246d4465cee35aa4a43 /include/libgha.h
parentf054da2e4b4138c987c0b4f760b16c092664cb98 (diff)
downloadlibgha-d8502a297b556cb06bf59bd00b2524931a8f034a.tar.gz
A bit more clean api
Diffstat (limited to 'include/libgha.h')
-rw-r--r--include/libgha.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/include/libgha.h b/include/libgha.h
index 6ebb33a..31639ac 100644
--- a/include/libgha.h
+++ b/include/libgha.h
@@ -5,23 +5,36 @@
#include <stddef.h>
-typedef struct gha_ctx gha_ctx;
+typedef struct gha_ctx *gha_ctx_t;
struct gha_info {
- FLOAT freq;
+ FLOAT frequency;
FLOAT phase;
FLOAT magnitude;
};
-// size must be even
-gha_ctx* gha_create_ctx(size_t size);
-void gha_free_ctx(gha_ctx* ctx);
-
-// This function performs one GHA step for given PCM signal,
-// the result will be writen in to given gha_ingo structure
-void gha_analyze_one(const FLOAT* pcm, struct gha_info* info, gha_ctx* ctx);
-
-// Performs one GHA step and extract analysed harmonic from given PCM signal
-void gha_extract_one(FLOAT* pcm, struct gha_info* info, gha_ctx* ctx);
+/*
+ * Create context to perform GHA, size is number of samples provided to analyze.
+ * Size must be even
+ *
+ * Returns null in case of fail.
+ */
+gha_ctx_t gha_create_ctx(size_t size);
+
+/*
+ * Free GHA context
+ */
+void gha_free_ctx(gha_ctx_t ctx);
+
+/*
+ * Performs one GHA step for given PCM signal,
+ * the result will be writen in to given gha_ingo structure
+ */
+void gha_analyze_one(const FLOAT* pcm, struct gha_info* info, gha_ctx_t ctx);
+
+/*
+ * Performs one GHA step and extract analysed harmonic from given PCM signal
+ */
+void gha_extract_one(FLOAT* pcm, struct gha_info* info, gha_ctx_t ctx);
#endif