comparison xtract/xtract_vector.h @ 105:f2af1c75e3ed

- Added extra argument to xtract_spectrum to give the option of normalising the magnitude/power coeffificients - Removed duplicate code block (argc assignment) from descriptors.c - Added some extra documentation to libxtract.h
author Jamie Bullock <jamie@postlude.co.uk>
date Thu, 27 Dec 2007 17:51:07 +0000
parents a32738e9d955
children 72a9a393d5bd
comparison
equal deleted inserted replaced
104:a32738e9d955 105:f2af1c75e3ed
32 * 32 *
33 * Defines vector extraction functions, and their parameters. 33 * Defines vector extraction functions, and their parameters.
34 * @{ 34 * @{
35 */ 35 */
36 36
37 /** \brief Extract normalized (0-1) frequency domain spectrum from time domain signal 37 /** \brief Extract frequency domain spectrum from time domain signal
38 * 38 *
39 * \param *data: a pointer to the first element in an array of floats representing an audio vector 39 * \param *data: a pointer to the first element in an array of floats representing an audio vector
40 * \param N: the number of array elements to be considered 40 * \param N: the number of array elements to be considered
41 * \param *argv: a pointer to an array of floats, the first representing (samplerate / N), the second will be cast to an integer and determines the spectrum type (e.g. XTRACT_MAGNITUDE_SPECTRUM, XTRACT_LOG_POWER_SPECTRUM). The third argument determines whether or not the DC component is included in the output. If argv[2] == 1, then the DC component is included in which case the size of the array pointed to by *result must be N+2. For any further use of the array pointed to by *result, the value of N must reflect the (larger) array size. 41 * \param *argv: a pointer to an array of floats, the first representing (samplerate / N), the second will be cast to an integer and determines the spectrum type (e.g. XTRACT_MAGNITUDE_SPECTRUM, XTRACT_LOG_POWER_SPECTRUM). The third argument determines whether or not the DC component is included in the output. If argv[2] == 1, then the DC component is included in which case the size of the array pointed to by *result must be N+2. For any further use of the array pointed to by *result, the value of N must reflect the (larger) array size. The fourth argument determines whether the magnitude/power coefficients are to be normalised. If argv[3] == 1, then the coefficients are normalised.
42 * \param *result: a pointer to an array of size N containing N/2 magnitude/power/log magnitude/log power coefficients and N/2 bin frequencies. 42 * \param *result: a pointer to an array of size N containing N/2 magnitude/power/log magnitude/log power coefficients and N/2 bin frequencies.
43 *
44 * The magnitude/power coefficients are scaled to the range 0-1 so that for a given coefficient x, 0 <= x <= 1
45 *
43 */ 46 */
44 int xtract_spectrum(const float *data, const int N, const void *argv, float *result); 47 int xtract_spectrum(const float *data, const int N, const void *argv, float *result);
45 48
46 /** \brief Extract autocorrelation from time domain signal using FFT based method 49 /** \brief Extract autocorrelation from time domain signal using FFT based method
47 * 50 *