annotate src/descriptors.c @ 52:45c585bb7996

Rationalised spectral data format. Added spectral_mean et al
author Jamie Bullock <jamie@postlude.co.uk>
date Wed, 10 Jan 2007 13:16:55 +0000
parents 5306739416cf
children 9762d7e3d129
rev   line source
jamie@50 1 /* libxtract feature extraction library
jamie@50 2 *
jamie@50 3 * Copyright (C) 2006 Jamie Bullock
jamie@50 4 *
jamie@50 5 * This program is free software; you can redistribute it and/or modify
jamie@50 6 * it under the terms of the GNU General Public License as published by
jamie@50 7 * the Free Software Foundation; either version 2 of the License, or
jamie@50 8 * (at your option) any later version.
jamie@50 9 *
jamie@50 10 * This program is distributed in the hope that it will be useful,
jamie@50 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jamie@50 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
jamie@50 13 * GNU General Public License for more details.
jamie@50 14 *
jamie@50 15 * You should have received a copy of the GNU General Public License
jamie@50 16 * along with this program; if not, write to the Free Software
jamie@50 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
jamie@50 18 * USA.
jamie@50 19 */
jamie@50 20
jamie@50 21 #include "xtract/libxtract.h"
jamie@50 22 #include <stdlib.h>
jamie@50 23 #include <string.h>
jamie@50 24 #define XTRACT
jamie@50 25
jamie@50 26 void *xtract_make_descriptors(){
jamie@52 27
jamie@50 28 t_function_descriptor *fd, *d;
jamie@51 29 t_type *type;
jamie@50 30 int f , F;
jamie@51 31 char *name, *p_name, *desc, *p_desc, *author;
jamie@51 32 int *argc, *year;
jamie@52 33
jamie@50 34 f = F = XTRACT_FEATURES;
jamie@50 35
jamie@50 36 fd = malloc(XTRACT_FEATURES * sizeof(t_function_descriptor));
jamie@50 37
jamie@51 38
jamie@50 39 while(f--){
jamie@51 40
jamie@50 41 d = &fd[f];
jamie@51 42 argc = &d->argc;
jamie@51 43 type = &d->argv.type;
jamie@51 44
jamie@50 45 switch(f){
jamie@52 46
jamie@50 47 case MEAN:
jamie@50 48 case VARIANCE:
jamie@50 49 case STANDARD_DEVIATION:
jamie@50 50 case AVERAGE_DEVIATION:
jamie@52 51 case SPECTRAL_MEAN:
jamie@52 52 case SPECTRAL_VARIANCE:
jamie@52 53 case SPECTRAL_STANDARD_DEVIATION:
jamie@52 54 case SPECTRAL_AVERAGE_DEVIATION:
jamie@50 55 case ROLLOFF:
jamie@52 56 case SPECTRAL_INHARMONICITY:
jamie@50 57 case MAGNITUDE_SPECTRUM:
jamie@50 58 case ODD_EVEN_RATIO:
jamie@50 59 case LOWEST_VALUE:
jamie@50 60 case F0:
jamie@50 61 case FAILSAFE_F0:
jamie@50 62 case TONALITY:
jamie@51 63 *argc = 1;
jamie@52 64 *type = FLOAT;
jamie@50 65 break;
jamie@50 66 case SKEWNESS:
jamie@50 67 case KURTOSIS:
jamie@52 68 case SPECTRAL_SKEWNESS:
jamie@52 69 case SPECTRAL_KURTOSIS:
jamie@52 70 case PEAK_SPECTRUM:
jamie@52 71 case HARMONIC_SPECTRUM:
jamie@50 72 case NOISINESS:
jamie@50 73 case CREST:
jamie@51 74 *argc = 2;
jamie@52 75 *type = FLOAT;
jamie@50 76 break;
jamie@50 77 case MFCC:
jamie@51 78 *argc = 1;
jamie@52 79 *type = MEL_FILTER;
jamie@50 80 break;
jamie@50 81 case BARK_COEFFICIENTS:
jamie@51 82 *argc = BARK_BANDS;
jamie@52 83 *type = INT;
jamie@50 84 break;
jamie@52 85 case SPECTRAL_CENTROID:
jamie@50 86 case IRREGULARITY_K:
jamie@50 87 case IRREGULARITY_J:
jamie@50 88 case TRISTIMULUS_1:
jamie@50 89 case TRISTIMULUS_2:
jamie@50 90 case TRISTIMULUS_3:
jamie@50 91 case SMOOTHNESS:
jamie@50 92 case FLATNESS:
jamie@50 93 case SPREAD:
jamie@50 94 case ZCR:
jamie@50 95 case LOUDNESS:
jamie@50 96 case HIGHEST_VALUE:
jamie@50 97 case SUM:
jamie@50 98 case RMS_AMPLITUDE:
jamie@50 99 case POWER:
jamie@50 100 case SHARPNESS:
jamie@52 101 case SPECTRAL_SLOPE:
jamie@50 102 case HPS:
jamie@50 103 case FLUX:
jamie@50 104 case ATTACK_TIME:
jamie@50 105 case DECAY_TIME:
jamie@50 106 case DELTA_FEATURE:
jamie@50 107 case AUTOCORRELATION_FFT:
jamie@50 108 case DCT:
jamie@50 109 case AUTOCORRELATION:
jamie@50 110 case AMDF:
jamie@50 111 case ASDF:
jamie@51 112 *argc = 0;
jamie@50 113 break;
jamie@50 114 default:
jamie@51 115 *argc = 0;
jamie@50 116 break;
jamie@50 117 }
jamie@51 118
jamie@50 119 name = d->algo.name;
jamie@51 120 p_name = d->algo.p_name;
jamie@51 121 desc = d->algo.desc;
jamie@51 122 p_desc = d->algo.p_desc;
jamie@51 123 author = d->algo.author;
jamie@51 124 year = &d->algo.year;
jamie@51 125
jamie@51 126 *year = 0;
jamie@51 127
jamie@50 128 switch(f){
jamie@50 129 case MEAN:
jamie@50 130 strcpy(name, "mean");
jamie@52 131 strcpy(p_name, "Mean");
jamie@51 132 strcpy(desc, "Extract the mean of an input vector");
jamie@52 133 strcpy(p_desc, "Extract the mean of a range of values");
jamie@51 134 strcpy(author, "");
jamie@50 135 break;
jamie@50 136 case VARIANCE:
jamie@50 137 strcpy(name, "variance");
jamie@51 138 strcpy(p_name, "Variance");
jamie@51 139 strcpy(desc, "Extract the variance of an input vector");
jamie@52 140 strcpy(p_desc, "Extract the variance of a range of values");
jamie@51 141 strcpy(author, "");
jamie@50 142 break;
jamie@50 143 case STANDARD_DEVIATION:
jamie@50 144 strcpy(name, "standard_deviation");
jamie@51 145 strcpy(p_name, "Standard Deviation");
jamie@52 146 strcpy(desc,
jamie@52 147 "Extract the standard deviation of an input vector");
jamie@52 148 strcpy(p_desc,
jamie@52 149 "Extract the standard deviation of a range of values");
jamie@51 150 strcpy(author, "");
jamie@50 151 break;
jamie@50 152 case AVERAGE_DEVIATION:
jamie@50 153 strcpy(name, "average_deviation");
jamie@51 154 strcpy(p_name, "Average Deviation");
jamie@52 155 strcpy(desc,
jamie@52 156 "Extract the average deviation of an input vector");
jamie@52 157 strcpy(p_desc,
jamie@52 158 "Extract the average deviation of a range of values");
jamie@52 159 strcpy(author, "");
jamie@52 160 break;
jamie@52 161 case SPECTRAL_MEAN:
jamie@52 162 strcpy(name, "spectral_mean");
jamie@52 163 strcpy(p_name, "Spectral Mean");
jamie@52 164 strcpy(desc, "Extract the mean of an input spectrum");
jamie@52 165 strcpy(p_desc, "Extract the mean of an audio spectrum");
jamie@52 166 strcpy(author, "");
jamie@52 167 break;
jamie@52 168 case SPECTRAL_VARIANCE:
jamie@52 169 strcpy(name, "spectral_variance");
jamie@52 170 strcpy(p_name, "Spectral Variance");
jamie@52 171 strcpy(desc, "Extract the variance of an input spectrum");
jamie@52 172 strcpy(p_desc, "Extract the variance of an audio spectrum");
jamie@52 173 strcpy(author, "");
jamie@52 174 break;
jamie@52 175 case SPECTRAL_STANDARD_DEVIATION:
jamie@52 176 strcpy(name, "spectral_standard_deviation");
jamie@52 177 strcpy(p_name, "Spectral Standard Deviation");
jamie@52 178 strcpy(desc,
jamie@52 179 "Extract the standard deviation of an input spectrum");
jamie@52 180 strcpy(p_desc,
jamie@52 181 "Extract the standard deviation of an audio spectrum");
jamie@52 182 strcpy(author, "");
jamie@52 183 break;
jamie@52 184 case SPECTRAL_AVERAGE_DEVIATION:
jamie@52 185 strcpy(name, "spectral_average_deviation");
jamie@52 186 strcpy(p_name, "Spectral Average Deviation");
jamie@52 187 strcpy(desc,
jamie@52 188 "Extract the average deviation of an input spectrum");
jamie@52 189 strcpy(p_desc,
jamie@52 190 "Extract the average deviation of an audio spectrum");
jamie@51 191 strcpy(author, "");
jamie@50 192 break;
jamie@50 193 case ROLLOFF:
jamie@52 194 strcpy(name, "spectral_rolloff");
jamie@51 195 strcpy(p_name, "Spectral Rolloff");
jamie@52 196 strcpy(desc,
jamie@52 197 "Extract the rolloff point of a spectrum");
jamie@52 198 strcpy(p_desc,
jamie@52 199 "Extract the rolloff point of an audio spectrum");
jamie@52 200 strcpy(author, "Bee Suan Ong");
jamie@52 201 *year = 2005;
jamie@50 202 break;
jamie@52 203 case SPECTRAL_INHARMONICITY:
jamie@52 204 strcpy(name, "spectral_inharmonicity");
jamie@51 205 strcpy(p_name, "Inharmonicity");
jamie@51 206 strcpy(desc, "Extract the inharmonicity of a spectrum");
jamie@52 207 strcpy(p_desc,
jamie@52 208 "Extract the inharmonicity of an audio spectrum");
jamie@50 209 break;
jamie@50 210 case MAGNITUDE_SPECTRUM:
jamie@50 211 strcpy(name, "magnitude_spectrum");
jamie@51 212 strcpy(p_name, "Magnitude Spectrum");
jamie@52 213 strcpy(desc,
jamie@52 214 "Extract the magnitude spectrum of an input vector");
jamie@52 215 strcpy(p_desc,
jamie@52 216 "Extract the magnitude spectrum of an audio signal");
jamie@51 217 strcpy(author, "");
jamie@50 218 break;
jamie@50 219 case ODD_EVEN_RATIO:
jamie@50 220 strcpy(name, "odd_even_ratio");
jamie@51 221 strcpy(p_name, "Odd/Even Harmonic Ratio");
jamie@52 222 strcpy(desc,
jamie@52 223 "Extract the odd-to-even harmonic ratio of a spectrum");
jamie@52 224 strcpy(p_desc,
jamie@52 225 "Extract the odd-to-even harmonic ratio of an audio spectrum");
jamie@51 226 strcpy(author, "");
jamie@50 227 break;
jamie@50 228 case LOWEST_VALUE:
jamie@50 229 strcpy(name, "lowest_value");
jamie@51 230 strcpy(p_name, "Lowest Value");
jamie@51 231 strcpy(desc, "Extract the lowest value from an input vector");
jamie@51 232 strcpy(p_desc, "Extract the lowest value from a given range");
jamie@51 233 strcpy(author, "");
jamie@50 234 break;
jamie@50 235 case F0:
jamie@50 236 strcpy(name, "f0");
jamie@51 237 strcpy(p_name, "Fundamental Frequency");
jamie@51 238 strcpy(desc, "Extract the fundamental frequency of a signal");
jamie@52 239 strcpy(p_desc,
jamie@52 240 "Extract the fundamental frequency of an audio signal");
jamie@51 241 strcpy(author, "");
jamie@50 242 break;
jamie@50 243 case FAILSAFE_F0:
jamie@50 244 strcpy(name, "failsafe_f0");
jamie@51 245 strcpy(p_name, "Fundamental Frequency (failsafe)");
jamie@51 246 strcpy(desc, "Extract the fundamental frequency of a signal");
jamie@52 247 strcpy(p_desc,
jamie@52 248 "Extract the fundamental frequency of an audio signal");
jamie@51 249 strcpy(author, "");
jamie@50 250 break;
jamie@50 251 case TONALITY:
jamie@50 252 strcpy(name, "tonality");
jamie@51 253 strcpy(p_name, "Tonality");
jamie@51 254 strcpy(desc, "Extract the tonality of a spectrum");
jamie@51 255 strcpy(p_desc, "Extract the tonality an audio spectrum");
jamie@52 256 strcpy(author, "Tristan Jehan");
jamie@52 257 *year = 2005;
jamie@50 258 break;
jamie@52 259 case SPECTRAL_SKEWNESS:
jamie@52 260 strcpy(name, "spectral_skewness");
jamie@51 261 strcpy(p_name, "Spectral Skewness");
jamie@52 262 strcpy(desc, "Extract the skewness of an input spectrum");
jamie@51 263 strcpy(p_desc, "Extract the skewness of an audio spectrum");
jamie@51 264 strcpy(author, "");
jamie@50 265 break;
jamie@52 266 case SPECTRAL_KURTOSIS:
jamie@52 267 strcpy(name, "spectral_kurtosis");
jamie@51 268 strcpy(p_name, "Spectral Kurtosis");
jamie@52 269 strcpy(desc, "Extract the kurtosis of an input spectrum");
jamie@51 270 strcpy(p_desc, "Extract the kurtosis of an audio spectrum");
jamie@51 271 strcpy(author, "");
jamie@50 272 break;
jamie@52 273 case PEAK_SPECTRUM:
jamie@52 274 strcpy(name, "peak_spectrum");
jamie@52 275 strcpy(p_name, "Peak Spectrum");
jamie@51 276 strcpy(desc, "Extract the spectral peaks from of a spectrum");
jamie@52 277 strcpy(p_desc,
jamie@52 278 "Extract the spectral peaks from an audio spectrum");
jamie@51 279 strcpy(author, "");
jamie@50 280 break;
jamie@52 281 case HARMONIC_SPECTRUM:
jamie@52 282 strcpy(p_name, "harmonic_spectrum");
jamie@52 283 strcpy(p_name, "Harmonic Spectrum");
jamie@51 284 strcpy(desc, "Extract the harmonics from a spectrum");
jamie@51 285 strcpy(p_desc, "Extract the harmonics from an audio spectrum");
jamie@51 286 strcpy(author, "");
jamie@50 287 break;
jamie@50 288 case NOISINESS:
jamie@50 289 strcpy(name, "noisiness");
jamie@51 290 strcpy(p_name, "Noisiness");
jamie@51 291 strcpy(desc, "Extract the noisiness of a spectrum");
jamie@51 292 strcpy(p_desc, "Extract the noisiness of an audio spectrum");
jamie@52 293 strcpy(author, "Tae Hong Park");
jamie@52 294 *year = 2000;
jamie@50 295 break;
jamie@50 296 case CREST:
jamie@50 297 strcpy(name, "crest");
jamie@51 298 strcpy(p_name, "Spectral Crest Measure");
jamie@52 299 strcpy(desc,
jamie@52 300 "Extract the spectral crest measure of a spectrum");
jamie@52 301 strcpy(p_desc,
jamie@52 302 "Extract the spectral crest measure of a audio spectrum");
jamie@52 303 strcpy(author, "Peeters");
jamie@52 304 *year = 2003;
jamie@50 305 break;
jamie@50 306 case MFCC:
jamie@50 307 strcpy(name, "mfcc");
jamie@52 308 strcpy(p_name, "Mel-Frequency Cepstral Coefficients");
jamie@51 309 strcpy(desc, "Extract MFCC from a spectrum");
jamie@51 310 strcpy(p_desc, "Extract MFCC from an audio spectrum");
jamie@52 311 strcpy(author, "Rabiner");
jamie@50 312 break;
jamie@50 313 case BARK_COEFFICIENTS:
jamie@50 314 strcpy(name, "bark_coefficients");
jamie@51 315 strcpy(p_name, "Bark Coefficients");
jamie@51 316 strcpy(desc, "Extract bark coefficients from a spectrum");
jamie@52 317 strcpy(p_desc,
jamie@52 318 "Extract bark coefficients from an audio spectrum");
jamie@51 319 strcpy(author, "");
jamie@50 320 break;
jamie@52 321 case SPECTRAL_CENTROID:
jamie@52 322 strcpy(name, "spectral_centroid");
jamie@51 323 strcpy(p_name, "Spectral Centroid");
jamie@51 324 strcpy(desc, "Extract the spectral centroid of a spectrum");
jamie@52 325 strcpy(p_desc,
jamie@52 326 "Extract the spectral centroid of an audio spectrum");
jamie@51 327 strcpy(author, "");
jamie@50 328 break;
jamie@50 329 case IRREGULARITY_K:
jamie@50 330 strcpy(name, "irregularity_k");
jamie@51 331 strcpy(p_name, "Irregularity I");
jamie@51 332 strcpy(desc, "Extract the irregularity of a spectrum");
jamie@52 333 strcpy(p_desc,
jamie@52 334 "Extract the irregularity of an audio spectrum");
jamie@52 335 strcpy(author, "Krimphoff");
jamie@52 336 *year = 1994;
jamie@50 337 break;
jamie@50 338 case IRREGULARITY_J:
jamie@50 339 strcpy(name, "irregularity_j");
jamie@51 340 strcpy(p_name, "Irregularity II");
jamie@51 341 strcpy(desc, "Extract the irregularity of a spectrum");
jamie@52 342 strcpy(p_desc,
jamie@52 343 "Extract the irregularity of an audio spectrum");
jamie@52 344 strcpy(author, "Jensen");
jamie@52 345 *year = 1999;
jamie@50 346 break;
jamie@50 347 case TRISTIMULUS_1:
jamie@50 348 strcpy(name, "tristimulus_1");
jamie@51 349 strcpy(p_name, "Tristimulus I");
jamie@51 350 strcpy(desc, "Extract the tristimulus (type I) of a spectrum");
jamie@52 351 strcpy(p_desc,
jamie@52 352 "Extract the tristimulus (type I) of an audio spectrum");
jamie@52 353 strcpy(author, "Pollard and Jansson");
jamie@52 354 *year = 1982;
jamie@50 355 break;
jamie@50 356 case TRISTIMULUS_2:
jamie@50 357 strcpy(name, "tristimulus_2");
jamie@51 358 strcpy(p_name, "Tristimulus II");
jamie@51 359 strcpy(desc, "Extract the tristimulus (type II) of a spectrum");
jamie@52 360 strcpy(p_desc,
jamie@52 361 "Extract the tristimulus (type II) of an audio spectrum");
jamie@52 362 strcpy(author, "Pollard and Jansson");
jamie@52 363 *year = 1982;
jamie@50 364 break;
jamie@50 365 case TRISTIMULUS_3:
jamie@50 366 strcpy(name, "tristimulus_3");
jamie@51 367 strcpy(p_name, "Tristimulus III");
jamie@52 368 strcpy(desc,
jamie@52 369 "Extract the tristimulus (type III) of a spectrum");
jamie@52 370 strcpy(p_desc,
jamie@52 371 "Extract the tristimulus (type III) of an audio spectrum");
jamie@52 372 strcpy(author, "Pollard and Jansson");
jamie@52 373 *year = 1982;
jamie@50 374 break;
jamie@50 375 case SMOOTHNESS:
jamie@50 376 strcpy(name, "smoothness");
jamie@51 377 strcpy(p_name, "Spectral Smoothness");
jamie@51 378 strcpy(desc, "Extract the spectral smoothness of a spectrum");
jamie@52 379 strcpy(p_desc,
jamie@52 380 "Extract the spectral smoothness of an audio spectrum");
jamie@52 381 strcpy(author, "McAdams");
jamie@52 382 *year = 1999;
jamie@50 383 break;
jamie@50 384 case FLATNESS:
jamie@50 385 strcpy(name, "flatness");
jamie@51 386 strcpy(p_name, "Spectral Flatness");
jamie@51 387 strcpy(desc, "Extract the spectral flatness of a spectrum");
jamie@52 388 strcpy(p_desc,
jamie@52 389 "Extract the spectral flatness of an audio spectrum");
jamie@52 390 strcpy(author, "Tristan Jehan");
jamie@52 391 *year = 2005;
jamie@50 392 break;
jamie@50 393 case SPREAD:
jamie@50 394 strcpy(name, "spread");
jamie@51 395 strcpy(p_name, "Spectral Spread");
jamie@51 396 strcpy(desc, "Extract the spectral spread of a spectrum");
jamie@52 397 strcpy(p_desc,
jamie@52 398 "Extract the spectral spread of an audio spectrum");
jamie@52 399 strcpy(author, "Norman Casagrande");
jamie@52 400 *year = 2005;
jamie@50 401 break;
jamie@50 402 case ZCR:
jamie@50 403 strcpy(name, "zcr");
jamie@51 404 strcpy(p_name, "Zero Crossing Rate");
jamie@51 405 strcpy(desc, "Extract the zero crossing rate of a vector");
jamie@52 406 strcpy(p_desc,
jamie@52 407 "Extract the zero crossing rate of an audio signal");
jamie@51 408 strcpy(author, "");
jamie@50 409 break;
jamie@50 410 case LOUDNESS:
jamie@50 411 strcpy(name, "loudness");
jamie@51 412 strcpy(p_name, "Loudness");
jamie@52 413 strcpy(desc,
jamie@52 414 "Extract the loudness of a signal from its spectrum");
jamie@52 415 strcpy(p_desc,
jamie@52 416 "Extract the loudness of an audio signal from its spectrum");
jamie@52 417 strcpy(author, "Moore, Glasberg et al");
jamie@52 418 *year = 2005;
jamie@50 419 break;
jamie@50 420 case HIGHEST_VALUE:
jamie@50 421 strcpy(name, "highest_value");
jamie@51 422 strcpy(p_name, "Highest Value");
jamie@51 423 strcpy(desc, "Extract the highest value from an input vector");
jamie@51 424 strcpy(p_desc, "Extract the highest value from a given range");
jamie@51 425 strcpy(author, "");
jamie@50 426 break;
jamie@50 427 case SUM:
jamie@50 428 strcpy(name, "sum");
jamie@51 429 strcpy(p_name, "Sum of Values");
jamie@52 430 strcpy(desc,
jamie@52 431 "Extract the sum of the values in an input vector");
jamie@52 432 strcpy(p_desc,
jamie@52 433 "Extract the sum of the values in a given range");
jamie@51 434 strcpy(author, "");
jamie@50 435 break;
jamie@50 436 case RMS_AMPLITUDE:
jamie@50 437 strcpy(name, "rms_amplitude");
jamie@51 438 strcpy(p_name, "RMS Amplitude");
jamie@51 439 strcpy(desc, "Extract the RMS amplitude of a signal");
jamie@51 440 strcpy(p_desc, "Extract the RMS amplitude of an audio signal");
jamie@51 441 strcpy(author, "");
jamie@50 442 break;
jamie@50 443 case POWER:
jamie@50 444 strcpy(name, "power");
jamie@51 445 strcpy(p_name, "Spectral Power");
jamie@51 446 strcpy(desc, "Extract the spectral power of a spectrum");
jamie@52 447 strcpy(p_desc,
jamie@52 448 "Extract the spectral power of an audio spectrum");
jamie@52 449 strcpy(author, "Bee Suan Ong");
jamie@52 450 *year = 2005;
jamie@50 451 break;
jamie@50 452 case SHARPNESS:
jamie@50 453 strcpy(name, "sharpness");
jamie@51 454 strcpy(p_name, "Spectral Sharpness");
jamie@51 455 strcpy(desc, "Extract the spectral sharpness of a spectrum");
jamie@52 456 strcpy(p_desc,
jamie@52 457 "Extract the spectral sharpness of an audio spectrum");
jamie@51 458 strcpy(author, "");
jamie@50 459 break;
jamie@52 460 case SPECTRAL_SLOPE:
jamie@52 461 strcpy(name, "spectral_slope");
jamie@51 462 strcpy(p_name, "Spectral Slope");
jamie@51 463 strcpy(desc, "Extract the spectral slope of a spectrum");
jamie@52 464 strcpy(p_desc,
jamie@52 465 "Extract the spectral slope of an audio spectrum");
jamie@51 466 strcpy(author, "");
jamie@50 467 break;
jamie@50 468 case HPS:
jamie@50 469 strcpy(name, "hps");
jamie@51 470 strcpy(p_name, "Harmonic Product Spectrum");
jamie@52 471 strcpy(desc,
jamie@52 472 "Extract the harmonic product spectrum of a spectrum");
jamie@52 473 strcpy(p_desc,
jamie@52 474 "Extract the harmonic product spectrum of an audio spectrum");
jamie@51 475 strcpy(author, "");
jamie@50 476 break;
jamie@50 477 case FLUX:
jamie@50 478 strcpy(name, "flux");
jamie@51 479 strcpy(p_name, "Spectral Flux");
jamie@51 480 strcpy(desc, "Extract the spectral flux of a spectrum");
jamie@52 481 strcpy(p_desc,
jamie@52 482 "Extract the spectral flux of an audio spectrum");
jamie@51 483 strcpy(author, "");
jamie@50 484 break;
jamie@50 485 case ATTACK_TIME:
jamie@50 486 strcpy(name, "attack_time");
jamie@51 487 strcpy(p_name, "Attack Time");
jamie@51 488 strcpy(desc, "Extract the attack time of a signal");
jamie@51 489 strcpy(p_desc, "Extract the attack time of an audio signal");
jamie@51 490 strcpy(author, "");
jamie@50 491 break;
jamie@50 492 case DECAY_TIME:
jamie@50 493 strcpy(name, "decay_time");
jamie@51 494 strcpy(p_name, "Decay Time");
jamie@51 495 strcpy(desc, "Extract the decay time of a signal");
jamie@51 496 strcpy(p_desc, "Extract the decay time of an audio signal");
jamie@51 497 strcpy(author, "");
jamie@50 498 break;
jamie@50 499 case DELTA_FEATURE:
jamie@50 500 strcpy(name, "delta_feature");
jamie@51 501 strcpy(p_name, "Delta Feature");
jamie@51 502 strcpy(desc, "Extract the time derivative of a feature");
jamie@51 503 strcpy(p_desc, "Extract the time derivative of a feature");
jamie@51 504 strcpy(author, "");
jamie@50 505 break;
jamie@50 506 case AUTOCORRELATION_FFT:
jamie@50 507 strcpy(name, "autocorrelation_fft");
jamie@51 508 strcpy(p_name, "Autocorrelation (FFT method)");
jamie@51 509 strcpy(desc, "Extract the autocorrelation of a signal");
jamie@51 510 strcpy(p_desc, "Extract the autocorrelation of an audio signal");
jamie@51 511 strcpy(author, "");
jamie@50 512 break;
jamie@50 513 case DCT:
jamie@50 514 strcpy(name, "dct");
jamie@51 515 strcpy(p_name, "Discrete Cosine Transform");
jamie@51 516 strcpy(desc, "Extract the DCT of a signal");
jamie@51 517 strcpy(p_desc, "Extract the DCT of an audio signal");
jamie@51 518 strcpy(author, "");
jamie@50 519 break;
jamie@50 520 case AUTOCORRELATION:
jamie@50 521 strcpy(name, "autocorrelation");
jamie@51 522 strcpy(p_name, "Autocorrelation");
jamie@51 523 strcpy(desc, "Extract the autocorrelation of a signal");
jamie@52 524 strcpy(p_desc,
jamie@52 525 "Extract the autocorrelation of an audio signal");
jamie@51 526 strcpy(author, "");
jamie@50 527 break;
jamie@50 528 case AMDF:
jamie@50 529 strcpy(name, "amdf");
jamie@51 530 strcpy(p_name, "Average Magnitude Difference Function");
jamie@51 531 strcpy(desc, "Extract the AMDF of a signal");
jamie@51 532 strcpy(p_desc, "Extract the AMDF of an audio signal");
jamie@51 533 strcpy(author, "");
jamie@50 534 break;
jamie@50 535 case ASDF:
jamie@50 536 strcpy(name, "asdf");
jamie@51 537 strcpy(p_name, "Average Squared Difference Function");
jamie@51 538 strcpy(desc, "Extract the ASDF of a signal");
jamie@51 539 strcpy(p_desc, "Extract the ASDF of an audio signal");
jamie@51 540 strcpy(author, "");
jamie@50 541 break;
jamie@50 542 default:
jamie@51 543 strcpy(name, "");
jamie@52 544 strcpy(p_name, "");
jamie@51 545 strcpy(desc, "");
jamie@51 546 strcpy(p_desc, "");
jamie@51 547 strcpy(author, "");
jamie@50 548 break;
jamie@50 549 }
jamie@50 550 }
jamie@50 551
jamie@50 552 return fd;
jamie@50 553 }
jamie@50 554
jamie@50 555 int xtract_free_descriptors(void *fd){
jamie@50 556
jamie@50 557 if (fd != NULL) {
jamie@50 558 free(fd);
jamie@50 559 }
jamie@50 560
jamie@50 561 return SUCCESS;
jamie@50 562 }
jamie@50 563
jamie@50 564
jamie@50 565
jamie@50 566
jamie@50 567