diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2014-06-13 17:29:26 +0100 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2014-06-13 17:29:26 +0100 |
commit | 93395479f6f697193aa93c1369a465a8237b9340 (patch) | |
tree | 5dd86fbe151c1ad09399ce6c92530805176660c1 | |
parent | e028f0d8204722f01495ec28edadbb4bdf1b6f1b (diff) | |
parent | db4716c2ece48ab9cbe38b2432969f9a03b1c173 (diff) | |
download | LibXtract-93395479f6f697193aa93c1369a465a8237b9340.tar.gz LibXtract-93395479f6f697193aa93c1369a465a8237b9340.tar.bz2 LibXtract-93395479f6f697193aa93c1369a465a8237b9340.zip |
Merge pull request #61 from seanlikeskites/master
MSVC fixes
-rw-r--r-- | src/scalar.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/scalar.c b/src/scalar.c index 7b0db80..1182618 100644 --- a/src/scalar.c +++ b/src/scalar.c @@ -313,7 +313,7 @@ int xtract_tristimulus_1(const double *data, const int N, const void *argv, doub if((temp = data[i])) { den += temp; - h = round(freqs[i] / fund); + h = floor(freqs[i] / fund + 0.5); if(h == 1) p1 += temp; } @@ -347,7 +347,7 @@ int xtract_tristimulus_2(const double *data, const int N, const void *argv, doub if((temp = data[i])) { den += temp; - h = round(freqs[i] / fund); + h = floor(freqs[i] / fund + 0.5); switch (h) { case 2: @@ -396,7 +396,7 @@ int xtract_tristimulus_3(const double *data, const int N, const void *argv, doub if((temp = data[i])) { den += temp; - h = round(freqs[i] / fund); + h = floor(freqs[i] / fund + 0.5); if(h >= 5) num += temp; } @@ -649,7 +649,7 @@ int xtract_spectral_inharmonicity(const double *data, const int N, const void *a { if(amps[n]) { - h = round(freqs[n] / fund); + h = floor(freqs[n] / fund + 0.5); num += fabs(freqs[n] - h * fund) * XTRACT_SQ(amps[n]); den += XTRACT_SQ(amps[n]); } @@ -681,7 +681,7 @@ int xtract_odd_even_ratio(const double *data, const int N, const void *argv, dou { if((temp = data[n])) { - h = round(freqs[n] / fund); + h = floor(freqs[n] / fund + 0.5); if(XTRACT_IS_ODD(h)) { odd += temp; @@ -842,6 +842,8 @@ int xtract_hps(const double *data, const int N, const void *argv, double *result return XTRACT_NO_RESULT; } + peak_index = 0; + tempProduct = peak = 0; for (i = 0; i < M; ++i) { |