Mercurial > hg > libxtract
comparison xtract/xtract_helper.h @ 244:8c768f32a6a8
Add new helper function xtract_smoothed(), e.g. can be used to extract smoothed spectrum
author | Jamie Bullock <jamie@jamiebullock.com> |
---|---|
date | Fri, 06 Jun 2014 09:55:01 +0100 |
parents | ef80f7c52c6d |
children |
comparison
equal
deleted
inserted
replaced
243:d13189c1005c | 244:8c768f32a6a8 |
---|---|
81 int xtract_is_denormal(double const d); | 81 int xtract_is_denormal(double const d); |
82 | 82 |
83 /** \brief Test whether a number is a power of two */ | 83 /** \brief Test whether a number is a power of two */ |
84 bool xtract_is_poweroftwo(unsigned int x); | 84 bool xtract_is_poweroftwo(unsigned int x); |
85 | 85 |
86 | |
87 /** \brief Smooth a vector | |
88 * | |
89 * \param *data a pointer to an array of doubles | |
90 * \param N the number of elements in the array pointed to by *data to be smoothed | |
91 * \param *argv a pointer to a double giving the smoothing gain | |
92 * \param *result a pointer to the first element an array containing the smoothed data | |
93 * | |
94 * \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! | |
95 * | |
96 */ | |
97 int xtract_smoothed(const double *data, const int N, const void *argv, double *result); | |
98 | |
99 | |
86 /** @} */ | 100 /** @} */ |
87 | 101 |
88 #ifdef __cplusplus | 102 #ifdef __cplusplus |
89 } | 103 } |
90 #endif | 104 #endif |