diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2018-11-03 21:17:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2018-11-03 21:17:03 +0300 |
commit | d8502a297b556cb06bf59bd00b2524931a8f034a (patch) | |
tree | d2633c73f96b0e05f0dcc246d4465cee35aa4a43 /include | |
parent | f054da2e4b4138c987c0b4f760b16c092664cb98 (diff) | |
download | libgha-d8502a297b556cb06bf59bd00b2524931a8f034a.tar.gz |
A bit more clean api
Diffstat (limited to 'include')
-rw-r--r-- | include/libgha.h | 37 |
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 |