aboutsummaryrefslogtreecommitdiff
path: root/src/init.c
diff options
context:
space:
mode:
authorDan Stowell <danstowell@gmail.com>2007-10-03 10:01:15 +0000
committerDan Stowell <danstowell@gmail.com>2007-10-03 10:01:15 +0000
commitdb5598d74855ceddcbff2be23e531302a7bbfe08 (patch)
treebc717395da10453a962ced2ef4fd697ec5e55747 /src/init.c
parentac13b3230b9b85cb092742a192a9c2bae6c5e779 (diff)
downloadLibXtract-db5598d74855ceddcbff2be23e531302a7bbfe08.tar.gz
LibXtract-db5598d74855ceddcbff2be23e531302a7bbfe08.tar.bz2
LibXtract-db5598d74855ceddcbff2be23e531302a7bbfe08.zip
Minor modifications to MFCC init, mainly just code formatting
Diffstat (limited to 'src/init.c')
-rw-r--r--src/init.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/init.c b/src/init.c
index 09e2d77..35802d0 100644
--- a/src/init.c
+++ b/src/init.c
@@ -51,7 +51,7 @@ int xtract_init_mfcc(int N, float nyquist, int style, float freq_min, float freq
M = N >> 1;
mel_peak[0] = mel_freq_min;
- lin_peak[0] = 700 * (exp(mel_peak[0] / 1127) - 1);
+ lin_peak[0] = freq_min; // === 700 * (exp(mel_peak[0] / 1127) - 1);
fft_peak[0] = lin_peak[0] / nyquist * M;
@@ -79,38 +79,38 @@ int xtract_init_mfcc(int N, float nyquist, int style, float freq_min, float freq
for(n = 0; n < freq_bands; n++){
- /*calculate the rise increment*/
- if(n > 0)
- inc = height_norm[n] / (fft_peak[n] - fft_peak[n - 1]);
- else
+ // calculate the rise increment
+ if(n==0)
inc = height_norm[n] / fft_peak[n];
+ else
+ inc = height_norm[n] / (fft_peak[n] - fft_peak[n - 1]);
val = 0;
- /*zero the start of the array*/
- for(k = 0; k < i; k++)
- fft_tables[n][k] = 0.f;
+ // zero the start of the array
+ for(k = 0; k < i; k++)
+ fft_tables[n][k] = 0.f;
- /*fill in the rise */
+ // fill in the rise
for(; i <= fft_peak[n]; i++){
fft_tables[n][i] = val;
val += inc;
}
- /*calculate the fall increment */
+ // calculate the fall increment
inc = height_norm[n] / (fft_peak[n + 1] - fft_peak[n]);
val = 0;
- next_peak = fft_peak[n + 1];
+ next_peak = fft_peak[n + 1];
- /*reverse fill the 'fall' */
+ // reverse fill the 'fall'
for(i = next_peak; i > fft_peak[n]; i--){
fft_tables[n][i] = val;
val += inc;
}
- /*zero the rest of the array*/
- for(k = next_peak + 1; k < N; k++)
- fft_tables[n][k] = 0.f;
+ // zero the rest of the array
+ for(k = next_peak + 1; k < N; k++)
+ fft_tables[n][k] = 0.f;
}
free(mel_peak);