diff options
author | Jamie Bullock <jamie@postlude.co.uk> | 2007-12-27 17:51:07 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@postlude.co.uk> | 2007-12-27 17:51:07 +0000 |
commit | 24f2b43e28e755423cc0c319aafcf74e7db5b61b (patch) | |
tree | 7bb9ae8a66c9961fded7572bf2aeb650c55a370d /xtract/xtract_vector.h | |
parent | 6abcb447777c3ab48bdbe720fc3d84d3e8841317 (diff) | |
download | LibXtract-24f2b43e28e755423cc0c319aafcf74e7db5b61b.tar.gz LibXtract-24f2b43e28e755423cc0c319aafcf74e7db5b61b.tar.bz2 LibXtract-24f2b43e28e755423cc0c319aafcf74e7db5b61b.zip |
- 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
Diffstat (limited to 'xtract/xtract_vector.h')
-rw-r--r-- | xtract/xtract_vector.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xtract/xtract_vector.h b/xtract/xtract_vector.h index 7effac0..e758f10 100644 --- a/xtract/xtract_vector.h +++ b/xtract/xtract_vector.h @@ -34,12 +34,15 @@ extern "C" { * @{ */ -/** \brief Extract normalized (0-1) frequency domain spectrum from time domain signal +/** \brief Extract frequency domain spectrum from time domain signal * * \param *data: a pointer to the first element in an array of floats representing an audio vector * \param N: the number of array elements to be considered - * \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. - * \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. + * \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. + * \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. + * + * The magnitude/power coefficients are scaled to the range 0-1 so that for a given coefficient x, 0 <= x <= 1 + * */ int xtract_spectrum(const float *data, const int N, const void *argv, float *result); |