changeset 230:b786a835df59

updated docs and removed commented out code
author Sean Enderby <sean.enderby@gmail.com>
date Tue, 25 Feb 2014 14:27:25 +0000
parents a2f66a305e53
children 611e521cb701
files src/scalar.c xtract/xtract_scalar.h
diffstat 2 files changed, 2 insertions(+), 105 deletions(-) [+]
line wrap: on
line diff
--- a/src/scalar.c	Tue Feb 25 14:12:29 2014 +0000
+++ b/src/scalar.c	Tue Feb 25 14:27:25 2014 +0000
@@ -298,109 +298,6 @@
     return XTRACT_SUCCESS;
 }
 
-/*
- *int xtract_tristimulus_1(const double *data, const int N, const void *argv, double *result)
- *{
- *
- *    int n = N;
- *
- *    double den, p1, temp;
- *
- *    den = p1 = temp = 0.0;
- *
- *    for(n = 0; n < N; n++)
- *    {
- *        if((temp = data[n]))
- *        {
- *            den += temp;
- *            if(!p1)
- *                p1 = temp;
- *        }
- *    }
- *
- *    if(den == 0.0 || p1 == 0.0)
- *    {
- *        *result = 0.0;
- *        return XTRACT_NO_RESULT;
- *    }
- *    else
- *    {
- *        *result = p1 / den;
- *        return XTRACT_SUCCESS;
- *    }
- *}
- *
- *int xtract_tristimulus_2(const double *data, const int N, const void *argv, double *result)
- *{
- *
- *    int n = N;
- *
- *    double den, p2, p3, p4, ps, temp;
- *
- *    den = p2 = p3 = p4 = ps = temp = 0.0;
- *
- *    for(n = 0; n < N; n++)
- *    {
- *        if((temp = data[n]))
- *        {
- *            den += temp;
- *            if(!p2)
- *                p2 = temp;
- *            else if(!p3)
- *                p3 = temp;
- *            else if(!p4)
- *                p4 = temp;
- *        }
- *    }
- *
- *    ps = p2 + p3 + p4;
- *
- *    if(den == 0.0 || ps == 0.0)
- *    {
- *        *result = 0.0;
- *        return XTRACT_NO_RESULT;
- *    }
- *    else
- *    {
- *        *result = ps / den;
- *        return XTRACT_SUCCESS;
- *    }
- *
- *}
- *
- *int xtract_tristimulus_3(const double *data, const int N, const void *argv, double *result)
- *{
- *
- *    int n = N, count = 0;
- *
- *    double den, num, temp;
- *
- *    den = num = temp = 0.0;
- *
- *    for(n = 0; n < N; n++)
- *    {
- *        if((temp = data[n]))
- *        {
- *            den += temp;
- *            if(count >= 5)
- *                num += temp;
- *            count++;
- *        }
- *    }
- *
- *    if(den == 0.0 || num == 0.0)
- *    {
- *        *result = 0.0;
- *        return XTRACT_NO_RESULT;
- *    }
- *    else
- *    {
- *        *result = num / den;
- *        return XTRACT_SUCCESS;
- *    }
- *}
- */
-
 int xtract_tristimulus_1(const double *data, const int N, const void *argv, double *result)
 {
     int n = N >> 1, h = 0, i;
--- a/xtract/xtract_scalar.h	Tue Feb 25 14:12:29 2014 +0000
+++ b/xtract/xtract_scalar.h	Tue Feb 25 14:27:25 2014 +0000
@@ -182,9 +182,9 @@
 
 /** \brief Calculate the Tristimulus of an input vector using a method described by Pollard and Jansson (1982)
  * 
- * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients of the harmonic spectrum of an audio vector e.g. a pointer to the first half of the array pointed to by *result from xtract_harmonics(). The amplitudes of the peak spectrum (e.g. *result from xtract_peak_spectrum()) can be used if one wishes to consider all partials not just harmonics.
+ * \param *data: a pointer to the first element in an array of doubles representing a harmonic spectrum of size N/2, and a frequency spectrum of size N/2 (This is the output format of xtract_harmonic_spectrum())
  * \param N: the number of elements to be considered
- * \param *argv: a pointer to NULL
+ * \param *argv: a pointer to a double representing the fundamental frequency of the input vector.
  * \param *result: the tristimulus of N values from the array pointed to by *data
  *
  * These three functions provide the first, second and third order tristimulus formulae