comparison xtract/xtract_scalar.h @ 215:44401945d850

Add xtract_peak() determines whether the 'current' value is a peak
author Jamie Bullock <jamie@jamiebullock.com>
date Tue, 03 Jun 2014 21:17:51 +0100
parents f6fcf3bec020
children 611e521cb701
comparison
equal deleted inserted replaced
214:f28f66faa016 215:44401945d850
455 * \param *result: the number of non-zero elements in the array pointed to by *data 455 * \param *result: the number of non-zero elements in the array pointed to by *data
456 * 456 *
457 */ 457 */
458 int xtract_nonzero_count(const double *data, const int N, const void *argv, double *result); 458 int xtract_nonzero_count(const double *data, const int N, const void *argv, double *result);
459 459
460 /**
461 * \brief Return XTRACT_SUCCESS if the 'current' value is considered a peak
462 *
463 * @param data a pointer to an array containing time series as provided by *result from xtract_last_n() where the Nth value is considered the 'current' value
464 * @param N an integer representing the number of elements in the time series
465 * @param argv a pointer to a double representing the threshold, whereby the current value will be considered a peak if it is above the average of the last N values (*data) by the threshold
466 * @param result a pointer to a copy of the current value if the current value is considered a peak
467 *
468 *
469 * @return XTRACT_SUCCESS if a peak was found or XTRACT_NO_RESULT if not
470 */
471 int xtract_peak(const double *data, const int N, const void *argv, double *result);
472
473
460 /** @} */ 474 /** @} */
461 475
462 #ifdef __cplusplus 476 #ifdef __cplusplus
463 } 477 }
464 #endif 478 #endif