From e028f0d8204722f01495ec28edadbb4bdf1b6f1b Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 6 Jun 2014 09:55:01 +0100 Subject: Add new helper function xtract_smoothed(), e.g. can be used to extract smoothed spectrum --- xtract/xtract_helper.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xtract/xtract_helper.h') diff --git a/xtract/xtract_helper.h b/xtract/xtract_helper.h index 9dabfbc..7296f0e 100644 --- a/xtract/xtract_helper.h +++ b/xtract/xtract_helper.h @@ -83,6 +83,20 @@ int xtract_is_denormal(double const d); /** \brief Test whether a number is a power of two */ bool xtract_is_poweroftwo(unsigned int x); + +/** \brief Smooth a vector + * + * \param *data a pointer to an array of doubles + * \param N the number of elements in the array pointed to by *data to be smoothed + * \param *argv a pointer to a double giving the smoothing gain + * \param *result a pointer to the first element an array containing the smoothed data + * + * \note if passing in a spectrum e.g. *result from xtract_spectrum(), then N for xtract_smoothed() should be N / 2 with respect to the N for xtract_spectrum() so only amplitude components are smoothed, not frequencies! + * + */ + int xtract_smoothed(const double *data, const int N, const void *argv, double *result); + + /** @} */ #ifdef __cplusplus -- cgit v1.2.3