From 6e38dfa629db5d34071c7d891633fe5dae52a2f1 Mon Sep 17 00:00:00 2001 From: pp Date: Sun, 23 Mar 2008 17:38:12 +0000 Subject: - YIN estimator improvements: - minimum detection now operates on interpolated values - period calculation now interpolates raw difference function, as interpolation of the normalized function is said to be slightly biased - added high threshold parameter, above which the result is ignored (no note detected) git-svn-id: https://lampka.siedziba.pl:790/svn/repos/lingot-win32@314 455248ca-bdda-0310-9134-f4ebb693071a --- src/lingot-config.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/lingot-config.c') diff --git a/src/lingot-config.c b/src/lingot-config.c index e228540..898c56f 100644 --- a/src/lingot-config.c +++ b/src/lingot-config.c @@ -35,12 +35,12 @@ char* token[] = { "AUDIO_DEV", "SAMPLE_RATE", "OVERSAMPLING", "ROOT_FREQUENCY_ERROR", "MIN_FREQUENCY", "FFT_SIZE", "TEMPORAL_WINDOW", "NOISE_THRESHOLD", "CALCULATION_RATE", "VISUALIZATION_RATE", "PEAK_NUMBER", "PEAK_ORDER", - "PEAK_REJECTION_RELATION", "DFT_NUMBER", "DFT_SIZE", "YIN_THRESHOLD", - "ESTIMATOR", NULL // NULL terminated array + "PEAK_REJECTION_RELATION", "DFT_NUMBER", "DFT_SIZE", "YIN_THRESHOLD_LOW", + "YIN_THRESHOLD_HIGH", "ESTIMATOR", NULL // NULL terminated array }; // print/scan param formats. -const char* format = "sddffdffffddfddfd"; +const char* format = "sddffdffffddfddffd"; //---------------------------------------------------------------------------- @@ -59,10 +59,10 @@ LingotConfig* lingot_config_new() &config->noise_threshold_db, &config->calculation_rate, &config->visualization_rate, &config->peak_number, &config->peak_order, &config->peak_rejection_relation_db, - &config->dft_number, &config->dft_size, &config->yin_threshold, - &config->estimator }; + &config->dft_number, &config->dft_size, &config->yin_threshold_low, + &config->yin_threshold_high, &config->estimator }; - memcpy(config->param, c_param, 17*sizeof(void*)); + memcpy(config->param, c_param, 18*sizeof(void*)); return config; } @@ -100,7 +100,8 @@ void lingot_config_reset(LingotConfig* config) config->vr = -0.45; // near to minimum - config->yin_threshold = 0.1; + config->yin_threshold_low = 0.1; + config->yin_threshold_high = 0.2; config->estimator = 0; lingot_config_update_internal_params(config); -- cgit v1.2.3