diff options
| author | Daniil Cherednik <[email protected]> | 2018-11-24 22:01:41 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2018-11-29 00:23:01 +0300 |
| commit | 4275785ac40b12584277e2fb7b31ef6ec1fceed8 (patch) | |
| tree | fe339da88ac04d28c377af4ccdb6d91e4e45dfb2 /include | |
| parent | 5b176978c464b4d60ccd8b4d576eb31e3039f9a8 (diff) | |
Initiall implementation of multi dimentional Newton optimization
Diffstat (limited to 'include')
| -rw-r--r-- | include/libgha.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/libgha.h b/include/libgha.h index 10c5625..c6834db 100644 --- a/include/libgha.h +++ b/include/libgha.h @@ -18,6 +18,7 @@ struct gha_info { * Size must be even * * Returns null in case of fail. + * */ gha_ctx_t gha_create_ctx(size_t size); @@ -32,6 +33,7 @@ void gha_free_ctx(gha_ctx_t ctx); * * Complexity: O(n * log(n)), * where n is number of samples to anayze + * */ void gha_analyze_one(const FLOAT* pcm, struct gha_info* info, gha_ctx_t ctx); @@ -41,6 +43,7 @@ void gha_analyze_one(const FLOAT* pcm, struct gha_info* info, gha_ctx_t ctx); * * Complexity: O(n * log(n)), * where n is number of samples to anayze + * */ void gha_extract_one(FLOAT* pcm, struct gha_info* info, gha_ctx_t ctx); @@ -52,10 +55,30 @@ void gha_extract_one(FLOAT* pcm, struct gha_info* info, gha_ctx_t ctx); * * Effectively this function is equivalent of calling gha_extract_one k times * - * Complexity: O(n * log(n) * K), + * Complexity: O(n * log(n) * k), * where n is number of samples to anayze, k is number of harmonics to extract * */ void gha_extract_many_simple(FLOAT* pcm, struct gha_info* info, size_t k, gha_ctx_t ctx); +/* + * Performs multidimensional optimization of extracted harmonics. + * + * Given gha_info will be adjusted to minimize resuidal level. + * Newton multidimensional optimization method is used. + * + * Complexity: O(k^2 * n + k^3) + * where n is number of samples to anayze, k is number of harmonics to extract + * + */ +int gha_adjust_info(const FLOAT* pcm, struct gha_info* info, size_t k, gha_ctx_t ctx); + +/* + * Set callback to perform action on resuidal pcm signal. + * + * user_ctx is used to pass user context in to callback + * + */ +void gha_set_user_resuidal_cb(void (*cb)(FLOAT* resuidal, size_t size, void* user_ctx), void* user_ctx, gha_ctx_t ctx); + #endif |
