annotate src/descriptors.c @ 54:9762d7e3d129

Fleshed out function descriptors.
author Jamie Bullock <jamie@postlude.co.uk>
date Thu, 11 Jan 2007 16:37:50 +0000
parents 45c585bb7996
children 4ea1a8838b14
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@54 33 t_vector *data_format;
jamie@54 34 /* *result_format; */
jamie@52 35
jamie@50 36 f = F = XTRACT_FEATURES;
jamie@50 37
jamie@50 38 fd = malloc(XTRACT_FEATURES * sizeof(t_function_descriptor));
jamie@50 39
jamie@51 40
jamie@50 41 while(f--){
jamie@51 42
jamie@50 43 d = &fd[f];
jamie@51 44 argc = &d->argc;
jamie@51 45 type = &d->argv.type;
jamie@51 46
jamie@50 47 switch(f){
jamie@52 48
jamie@50 49 case MEAN:
jamie@50 50 case VARIANCE:
jamie@50 51 case STANDARD_DEVIATION:
jamie@50 52 case AVERAGE_DEVIATION:
jamie@52 53 case SPECTRAL_MEAN:
jamie@52 54 case SPECTRAL_VARIANCE:
jamie@52 55 case SPECTRAL_STANDARD_DEVIATION:
jamie@52 56 case SPECTRAL_AVERAGE_DEVIATION:
jamie@50 57 case ROLLOFF:
jamie@52 58 case SPECTRAL_INHARMONICITY:
jamie@50 59 case ODD_EVEN_RATIO:
jamie@50 60 case LOWEST_VALUE:
jamie@50 61 case F0:
jamie@50 62 case FAILSAFE_F0:
jamie@50 63 case TONALITY:
jamie@51 64 *argc = 1;
jamie@52 65 *type = FLOAT;
jamie@50 66 break;
jamie@50 67 case SKEWNESS:
jamie@50 68 case KURTOSIS:
jamie@52 69 case SPECTRAL_SKEWNESS:
jamie@52 70 case SPECTRAL_KURTOSIS:
jamie@54 71 case SPECTRUM:
jamie@52 72 case PEAK_SPECTRUM:
jamie@52 73 case HARMONIC_SPECTRUM:
jamie@50 74 case NOISINESS:
jamie@50 75 case CREST:
jamie@51 76 *argc = 2;
jamie@52 77 *type = FLOAT;
jamie@50 78 break;
jamie@50 79 case MFCC:
jamie@51 80 *argc = 1;
jamie@52 81 *type = MEL_FILTER;
jamie@50 82 break;
jamie@50 83 case BARK_COEFFICIENTS:
jamie@51 84 *argc = BARK_BANDS;
jamie@52 85 *type = INT;
jamie@50 86 break;
jamie@52 87 case SPECTRAL_CENTROID:
jamie@50 88 case IRREGULARITY_K:
jamie@50 89 case IRREGULARITY_J:
jamie@50 90 case TRISTIMULUS_1:
jamie@50 91 case TRISTIMULUS_2:
jamie@50 92 case TRISTIMULUS_3:
jamie@50 93 case SMOOTHNESS:
jamie@50 94 case FLATNESS:
jamie@50 95 case SPREAD:
jamie@50 96 case ZCR:
jamie@50 97 case LOUDNESS:
jamie@50 98 case HIGHEST_VALUE:
jamie@50 99 case SUM:
jamie@50 100 case RMS_AMPLITUDE:
jamie@50 101 case POWER:
jamie@50 102 case SHARPNESS:
jamie@52 103 case SPECTRAL_SLOPE:
jamie@50 104 case HPS:
jamie@50 105 case FLUX:
jamie@50 106 case ATTACK_TIME:
jamie@50 107 case DECAY_TIME:
jamie@50 108 case DELTA_FEATURE:
jamie@50 109 case AUTOCORRELATION_FFT:
jamie@50 110 case DCT:
jamie@50 111 case AUTOCORRELATION:
jamie@50 112 case AMDF:
jamie@50 113 case ASDF:
jamie@51 114 *argc = 0;
jamie@50 115 break;
jamie@50 116 default:
jamie@51 117 *argc = 0;
jamie@50 118 break;
jamie@50 119 }
jamie@51 120
jamie@54 121 data_format = &d->data.format;
jamie@54 122
jamie@54 123 switch(f){
jamie@54 124
jamie@54 125 case MEAN:
jamie@54 126 case VARIANCE:
jamie@54 127 case STANDARD_DEVIATION:
jamie@54 128 case AVERAGE_DEVIATION:
jamie@54 129 case SKEWNESS:
jamie@54 130 case KURTOSIS:
jamie@54 131 case LOWEST_VALUE:
jamie@54 132 case HIGHEST_VALUE:
jamie@54 133 case SUM:
jamie@54 134 case ZCR:
jamie@54 135 *data_format = ARBITRARY_SERIES;
jamie@54 136 break;
jamie@54 137 case SPECTRAL_MEAN:
jamie@54 138 case SPECTRAL_VARIANCE:
jamie@54 139 case SPECTRAL_STANDARD_DEVIATION:
jamie@54 140 case SPECTRAL_AVERAGE_DEVIATION:
jamie@54 141 case SPECTRAL_SKEWNESS:
jamie@54 142 case SPECTRAL_KURTOSIS:
jamie@54 143 case SPECTRAL_CENTROID:
jamie@54 144 case SPECTRAL_SLOPE:
jamie@54 145 case PEAK_SPECTRUM:
jamie@54 146 case HARMONIC_SPECTRUM:
jamie@54 147 *data_format = SPECTRAL;
jamie@54 148 break;
jamie@54 149 case ROLLOFF:
jamie@54 150 case NOISINESS:
jamie@54 151 case BARK_COEFFICIENTS:
jamie@54 152 case CREST:
jamie@54 153 case IRREGULARITY_K:
jamie@54 154 case IRREGULARITY_J:
jamie@54 155 case SMOOTHNESS:
jamie@54 156 case FLATNESS:
jamie@54 157 case SPREAD:
jamie@54 158 case RMS_AMPLITUDE:
jamie@54 159 case POWER:
jamie@54 160 case SHARPNESS:
jamie@54 161 case HPS:
jamie@54 162 *data_format = SPECTRAL_MAGNITUDES;
jamie@54 163 break;
jamie@54 164 case SPECTRAL_INHARMONICITY:
jamie@54 165 *data_format = SPECTRAL_PEAKS;
jamie@54 166 break;
jamie@54 167 case ODD_EVEN_RATIO:
jamie@54 168 *data_format = SPECTRAL_HARMONICS_FREQUENCIES;
jamie@54 169 break;
jamie@54 170 case F0:
jamie@54 171 case FAILSAFE_F0:
jamie@54 172 case SPECTRUM:
jamie@54 173 case MFCC:
jamie@54 174 case AUTOCORRELATION:
jamie@54 175 case AUTOCORRELATION_FFT:
jamie@54 176 case DCT:
jamie@54 177 case AMDF:
jamie@54 178 case ASDF:
jamie@54 179 *data_format = AUDIO_SAMPLES;
jamie@54 180 break;
jamie@54 181 case TONALITY:
jamie@54 182 *data_format = NO_DATA;
jamie@54 183 break;
jamie@54 184 case TRISTIMULUS_1:
jamie@54 185 case TRISTIMULUS_2:
jamie@54 186 case TRISTIMULUS_3:
jamie@54 187 *data_format = SPECTRAL_HARMONICS_MAGNITUDES;
jamie@54 188 break;
jamie@54 189 case LOUDNESS:
jamie@54 190 *data_format = BARK_COEFFS;
jamie@54 191 break;
jamie@54 192 case FLUX:
jamie@54 193 case ATTACK_TIME:
jamie@54 194 case DECAY_TIME:
jamie@54 195 case DELTA_FEATURE:
jamie@54 196 default:
jamie@54 197 *data_format = NO_DATA;
jamie@54 198 break;
jamie@54 199 }
jamie@54 200
jamie@50 201 name = d->algo.name;
jamie@51 202 p_name = d->algo.p_name;
jamie@51 203 desc = d->algo.desc;
jamie@51 204 p_desc = d->algo.p_desc;
jamie@51 205 author = d->algo.author;
jamie@51 206 year = &d->algo.year;
jamie@51 207
jamie@51 208 *year = 0;
jamie@51 209
jamie@50 210 switch(f){
jamie@50 211 case MEAN:
jamie@50 212 strcpy(name, "mean");
jamie@52 213 strcpy(p_name, "Mean");
jamie@51 214 strcpy(desc, "Extract the mean of an input vector");
jamie@52 215 strcpy(p_desc, "Extract the mean of a range of values");
jamie@51 216 strcpy(author, "");
jamie@50 217 break;
jamie@50 218 case VARIANCE:
jamie@50 219 strcpy(name, "variance");
jamie@51 220 strcpy(p_name, "Variance");
jamie@51 221 strcpy(desc, "Extract the variance of an input vector");
jamie@52 222 strcpy(p_desc, "Extract the variance of a range of values");
jamie@51 223 strcpy(author, "");
jamie@50 224 break;
jamie@50 225 case STANDARD_DEVIATION:
jamie@50 226 strcpy(name, "standard_deviation");
jamie@51 227 strcpy(p_name, "Standard Deviation");
jamie@52 228 strcpy(desc,
jamie@52 229 "Extract the standard deviation of an input vector");
jamie@52 230 strcpy(p_desc,
jamie@52 231 "Extract the standard deviation of a range of values");
jamie@51 232 strcpy(author, "");
jamie@50 233 break;
jamie@50 234 case AVERAGE_DEVIATION:
jamie@50 235 strcpy(name, "average_deviation");
jamie@51 236 strcpy(p_name, "Average Deviation");
jamie@52 237 strcpy(desc,
jamie@52 238 "Extract the average deviation of an input vector");
jamie@52 239 strcpy(p_desc,
jamie@52 240 "Extract the average deviation of a range of values");
jamie@52 241 strcpy(author, "");
jamie@52 242 break;
jamie@52 243 case SPECTRAL_MEAN:
jamie@52 244 strcpy(name, "spectral_mean");
jamie@52 245 strcpy(p_name, "Spectral Mean");
jamie@52 246 strcpy(desc, "Extract the mean of an input spectrum");
jamie@52 247 strcpy(p_desc, "Extract the mean of an audio spectrum");
jamie@52 248 strcpy(author, "");
jamie@52 249 break;
jamie@52 250 case SPECTRAL_VARIANCE:
jamie@52 251 strcpy(name, "spectral_variance");
jamie@52 252 strcpy(p_name, "Spectral Variance");
jamie@52 253 strcpy(desc, "Extract the variance of an input spectrum");
jamie@52 254 strcpy(p_desc, "Extract the variance of an audio spectrum");
jamie@52 255 strcpy(author, "");
jamie@52 256 break;
jamie@52 257 case SPECTRAL_STANDARD_DEVIATION:
jamie@52 258 strcpy(name, "spectral_standard_deviation");
jamie@52 259 strcpy(p_name, "Spectral Standard Deviation");
jamie@52 260 strcpy(desc,
jamie@52 261 "Extract the standard deviation of an input spectrum");
jamie@52 262 strcpy(p_desc,
jamie@52 263 "Extract the standard deviation of an audio spectrum");
jamie@52 264 strcpy(author, "");
jamie@52 265 break;
jamie@52 266 case SPECTRAL_AVERAGE_DEVIATION:
jamie@52 267 strcpy(name, "spectral_average_deviation");
jamie@52 268 strcpy(p_name, "Spectral Average Deviation");
jamie@52 269 strcpy(desc,
jamie@52 270 "Extract the average deviation of an input spectrum");
jamie@52 271 strcpy(p_desc,
jamie@52 272 "Extract the average deviation of an audio spectrum");
jamie@51 273 strcpy(author, "");
jamie@50 274 break;
jamie@50 275 case ROLLOFF:
jamie@52 276 strcpy(name, "spectral_rolloff");
jamie@51 277 strcpy(p_name, "Spectral Rolloff");
jamie@52 278 strcpy(desc,
jamie@52 279 "Extract the rolloff point of a spectrum");
jamie@52 280 strcpy(p_desc,
jamie@52 281 "Extract the rolloff point of an audio spectrum");
jamie@52 282 strcpy(author, "Bee Suan Ong");
jamie@52 283 *year = 2005;
jamie@50 284 break;
jamie@52 285 case SPECTRAL_INHARMONICITY:
jamie@52 286 strcpy(name, "spectral_inharmonicity");
jamie@51 287 strcpy(p_name, "Inharmonicity");
jamie@51 288 strcpy(desc, "Extract the inharmonicity of a spectrum");
jamie@52 289 strcpy(p_desc,
jamie@52 290 "Extract the inharmonicity of an audio spectrum");
jamie@50 291 break;
jamie@54 292 case SPECTRUM:
jamie@54 293 strcpy(name, "spectrum");
jamie@54 294 strcpy(p_name, "Spectrum");
jamie@52 295 strcpy(desc,
jamie@54 296 "Extract the spectrum of an input vector");
jamie@52 297 strcpy(p_desc,
jamie@54 298 "Extract the spectrum of an audio signal");
jamie@51 299 strcpy(author, "");
jamie@50 300 break;
jamie@50 301 case ODD_EVEN_RATIO:
jamie@50 302 strcpy(name, "odd_even_ratio");
jamie@51 303 strcpy(p_name, "Odd/Even Harmonic Ratio");
jamie@52 304 strcpy(desc,
jamie@52 305 "Extract the odd-to-even harmonic ratio of a spectrum");
jamie@52 306 strcpy(p_desc,
jamie@52 307 "Extract the odd-to-even harmonic ratio of an audio spectrum");
jamie@51 308 strcpy(author, "");
jamie@50 309 break;
jamie@50 310 case LOWEST_VALUE:
jamie@50 311 strcpy(name, "lowest_value");
jamie@51 312 strcpy(p_name, "Lowest Value");
jamie@51 313 strcpy(desc, "Extract the lowest value from an input vector");
jamie@51 314 strcpy(p_desc, "Extract the lowest value from a given range");
jamie@51 315 strcpy(author, "");
jamie@50 316 break;
jamie@50 317 case F0:
jamie@50 318 strcpy(name, "f0");
jamie@51 319 strcpy(p_name, "Fundamental Frequency");
jamie@51 320 strcpy(desc, "Extract the fundamental frequency of a signal");
jamie@52 321 strcpy(p_desc,
jamie@52 322 "Extract the fundamental frequency of an audio signal");
jamie@51 323 strcpy(author, "");
jamie@50 324 break;
jamie@50 325 case FAILSAFE_F0:
jamie@50 326 strcpy(name, "failsafe_f0");
jamie@51 327 strcpy(p_name, "Fundamental Frequency (failsafe)");
jamie@51 328 strcpy(desc, "Extract the fundamental frequency of a signal");
jamie@52 329 strcpy(p_desc,
jamie@52 330 "Extract the fundamental frequency of an audio signal");
jamie@51 331 strcpy(author, "");
jamie@50 332 break;
jamie@50 333 case TONALITY:
jamie@50 334 strcpy(name, "tonality");
jamie@51 335 strcpy(p_name, "Tonality");
jamie@51 336 strcpy(desc, "Extract the tonality of a spectrum");
jamie@51 337 strcpy(p_desc, "Extract the tonality an audio spectrum");
jamie@52 338 strcpy(author, "Tristan Jehan");
jamie@52 339 *year = 2005;
jamie@50 340 break;
jamie@52 341 case SPECTRAL_SKEWNESS:
jamie@52 342 strcpy(name, "spectral_skewness");
jamie@51 343 strcpy(p_name, "Spectral Skewness");
jamie@52 344 strcpy(desc, "Extract the skewness of an input spectrum");
jamie@51 345 strcpy(p_desc, "Extract the skewness of an audio spectrum");
jamie@51 346 strcpy(author, "");
jamie@50 347 break;
jamie@52 348 case SPECTRAL_KURTOSIS:
jamie@52 349 strcpy(name, "spectral_kurtosis");
jamie@51 350 strcpy(p_name, "Spectral Kurtosis");
jamie@52 351 strcpy(desc, "Extract the kurtosis of an input spectrum");
jamie@51 352 strcpy(p_desc, "Extract the kurtosis of an audio spectrum");
jamie@51 353 strcpy(author, "");
jamie@50 354 break;
jamie@52 355 case PEAK_SPECTRUM:
jamie@52 356 strcpy(name, "peak_spectrum");
jamie@52 357 strcpy(p_name, "Peak Spectrum");
jamie@51 358 strcpy(desc, "Extract the spectral peaks from of a spectrum");
jamie@52 359 strcpy(p_desc,
jamie@52 360 "Extract the spectral peaks from an audio spectrum");
jamie@51 361 strcpy(author, "");
jamie@50 362 break;
jamie@52 363 case HARMONIC_SPECTRUM:
jamie@52 364 strcpy(p_name, "harmonic_spectrum");
jamie@52 365 strcpy(p_name, "Harmonic Spectrum");
jamie@51 366 strcpy(desc, "Extract the harmonics from a spectrum");
jamie@51 367 strcpy(p_desc, "Extract the harmonics from an audio spectrum");
jamie@51 368 strcpy(author, "");
jamie@50 369 break;
jamie@50 370 case NOISINESS:
jamie@50 371 strcpy(name, "noisiness");
jamie@51 372 strcpy(p_name, "Noisiness");
jamie@51 373 strcpy(desc, "Extract the noisiness of a spectrum");
jamie@51 374 strcpy(p_desc, "Extract the noisiness of an audio spectrum");
jamie@52 375 strcpy(author, "Tae Hong Park");
jamie@52 376 *year = 2000;
jamie@50 377 break;
jamie@50 378 case CREST:
jamie@50 379 strcpy(name, "crest");
jamie@51 380 strcpy(p_name, "Spectral Crest Measure");
jamie@52 381 strcpy(desc,
jamie@52 382 "Extract the spectral crest measure of a spectrum");
jamie@52 383 strcpy(p_desc,
jamie@52 384 "Extract the spectral crest measure of a audio spectrum");
jamie@52 385 strcpy(author, "Peeters");
jamie@52 386 *year = 2003;
jamie@50 387 break;
jamie@50 388 case MFCC:
jamie@50 389 strcpy(name, "mfcc");
jamie@52 390 strcpy(p_name, "Mel-Frequency Cepstral Coefficients");
jamie@51 391 strcpy(desc, "Extract MFCC from a spectrum");
jamie@51 392 strcpy(p_desc, "Extract MFCC from an audio spectrum");
jamie@52 393 strcpy(author, "Rabiner");
jamie@50 394 break;
jamie@50 395 case BARK_COEFFICIENTS:
jamie@50 396 strcpy(name, "bark_coefficients");
jamie@51 397 strcpy(p_name, "Bark Coefficients");
jamie@51 398 strcpy(desc, "Extract bark coefficients from a spectrum");
jamie@52 399 strcpy(p_desc,
jamie@52 400 "Extract bark coefficients from an audio spectrum");
jamie@51 401 strcpy(author, "");
jamie@50 402 break;
jamie@52 403 case SPECTRAL_CENTROID:
jamie@52 404 strcpy(name, "spectral_centroid");
jamie@51 405 strcpy(p_name, "Spectral Centroid");
jamie@51 406 strcpy(desc, "Extract the spectral centroid of a spectrum");
jamie@52 407 strcpy(p_desc,
jamie@52 408 "Extract the spectral centroid of an audio spectrum");
jamie@51 409 strcpy(author, "");
jamie@50 410 break;
jamie@50 411 case IRREGULARITY_K:
jamie@50 412 strcpy(name, "irregularity_k");
jamie@51 413 strcpy(p_name, "Irregularity I");
jamie@51 414 strcpy(desc, "Extract the irregularity of a spectrum");
jamie@52 415 strcpy(p_desc,
jamie@52 416 "Extract the irregularity of an audio spectrum");
jamie@52 417 strcpy(author, "Krimphoff");
jamie@52 418 *year = 1994;
jamie@50 419 break;
jamie@50 420 case IRREGULARITY_J:
jamie@50 421 strcpy(name, "irregularity_j");
jamie@51 422 strcpy(p_name, "Irregularity II");
jamie@51 423 strcpy(desc, "Extract the irregularity of a spectrum");
jamie@52 424 strcpy(p_desc,
jamie@52 425 "Extract the irregularity of an audio spectrum");
jamie@52 426 strcpy(author, "Jensen");
jamie@52 427 *year = 1999;
jamie@50 428 break;
jamie@50 429 case TRISTIMULUS_1:
jamie@50 430 strcpy(name, "tristimulus_1");
jamie@51 431 strcpy(p_name, "Tristimulus I");
jamie@51 432 strcpy(desc, "Extract the tristimulus (type I) of a spectrum");
jamie@52 433 strcpy(p_desc,
jamie@52 434 "Extract the tristimulus (type I) of an audio spectrum");
jamie@52 435 strcpy(author, "Pollard and Jansson");
jamie@52 436 *year = 1982;
jamie@50 437 break;
jamie@50 438 case TRISTIMULUS_2:
jamie@50 439 strcpy(name, "tristimulus_2");
jamie@51 440 strcpy(p_name, "Tristimulus II");
jamie@51 441 strcpy(desc, "Extract the tristimulus (type II) of a spectrum");
jamie@52 442 strcpy(p_desc,
jamie@52 443 "Extract the tristimulus (type II) of an audio spectrum");
jamie@52 444 strcpy(author, "Pollard and Jansson");
jamie@52 445 *year = 1982;
jamie@50 446 break;
jamie@50 447 case TRISTIMULUS_3:
jamie@50 448 strcpy(name, "tristimulus_3");
jamie@51 449 strcpy(p_name, "Tristimulus III");
jamie@52 450 strcpy(desc,
jamie@52 451 "Extract the tristimulus (type III) of a spectrum");
jamie@52 452 strcpy(p_desc,
jamie@52 453 "Extract the tristimulus (type III) of an audio spectrum");
jamie@52 454 strcpy(author, "Pollard and Jansson");
jamie@52 455 *year = 1982;
jamie@50 456 break;
jamie@50 457 case SMOOTHNESS:
jamie@50 458 strcpy(name, "smoothness");
jamie@51 459 strcpy(p_name, "Spectral Smoothness");
jamie@51 460 strcpy(desc, "Extract the spectral smoothness of a spectrum");
jamie@52 461 strcpy(p_desc,
jamie@52 462 "Extract the spectral smoothness of an audio spectrum");
jamie@52 463 strcpy(author, "McAdams");
jamie@52 464 *year = 1999;
jamie@50 465 break;
jamie@50 466 case FLATNESS:
jamie@50 467 strcpy(name, "flatness");
jamie@51 468 strcpy(p_name, "Spectral Flatness");
jamie@51 469 strcpy(desc, "Extract the spectral flatness of a spectrum");
jamie@52 470 strcpy(p_desc,
jamie@52 471 "Extract the spectral flatness of an audio spectrum");
jamie@52 472 strcpy(author, "Tristan Jehan");
jamie@52 473 *year = 2005;
jamie@50 474 break;
jamie@50 475 case SPREAD:
jamie@50 476 strcpy(name, "spread");
jamie@51 477 strcpy(p_name, "Spectral Spread");
jamie@51 478 strcpy(desc, "Extract the spectral spread of a spectrum");
jamie@52 479 strcpy(p_desc,
jamie@52 480 "Extract the spectral spread of an audio spectrum");
jamie@52 481 strcpy(author, "Norman Casagrande");
jamie@52 482 *year = 2005;
jamie@50 483 break;
jamie@50 484 case ZCR:
jamie@50 485 strcpy(name, "zcr");
jamie@51 486 strcpy(p_name, "Zero Crossing Rate");
jamie@51 487 strcpy(desc, "Extract the zero crossing rate of a vector");
jamie@52 488 strcpy(p_desc,
jamie@52 489 "Extract the zero crossing rate of an audio signal");
jamie@51 490 strcpy(author, "");
jamie@50 491 break;
jamie@50 492 case LOUDNESS:
jamie@50 493 strcpy(name, "loudness");
jamie@51 494 strcpy(p_name, "Loudness");
jamie@52 495 strcpy(desc,
jamie@52 496 "Extract the loudness of a signal from its spectrum");
jamie@52 497 strcpy(p_desc,
jamie@52 498 "Extract the loudness of an audio signal from its spectrum");
jamie@52 499 strcpy(author, "Moore, Glasberg et al");
jamie@52 500 *year = 2005;
jamie@50 501 break;
jamie@50 502 case HIGHEST_VALUE:
jamie@50 503 strcpy(name, "highest_value");
jamie@51 504 strcpy(p_name, "Highest Value");
jamie@51 505 strcpy(desc, "Extract the highest value from an input vector");
jamie@51 506 strcpy(p_desc, "Extract the highest value from a given range");
jamie@51 507 strcpy(author, "");
jamie@50 508 break;
jamie@50 509 case SUM:
jamie@50 510 strcpy(name, "sum");
jamie@51 511 strcpy(p_name, "Sum of Values");
jamie@52 512 strcpy(desc,
jamie@52 513 "Extract the sum of the values in an input vector");
jamie@52 514 strcpy(p_desc,
jamie@52 515 "Extract the sum of the values in a given range");
jamie@51 516 strcpy(author, "");
jamie@50 517 break;
jamie@50 518 case RMS_AMPLITUDE:
jamie@50 519 strcpy(name, "rms_amplitude");
jamie@51 520 strcpy(p_name, "RMS Amplitude");
jamie@51 521 strcpy(desc, "Extract the RMS amplitude of a signal");
jamie@51 522 strcpy(p_desc, "Extract the RMS amplitude of an audio signal");
jamie@51 523 strcpy(author, "");
jamie@50 524 break;
jamie@50 525 case POWER:
jamie@50 526 strcpy(name, "power");
jamie@51 527 strcpy(p_name, "Spectral Power");
jamie@51 528 strcpy(desc, "Extract the spectral power of a spectrum");
jamie@52 529 strcpy(p_desc,
jamie@52 530 "Extract the spectral power of an audio spectrum");
jamie@52 531 strcpy(author, "Bee Suan Ong");
jamie@52 532 *year = 2005;
jamie@50 533 break;
jamie@50 534 case SHARPNESS:
jamie@50 535 strcpy(name, "sharpness");
jamie@51 536 strcpy(p_name, "Spectral Sharpness");
jamie@51 537 strcpy(desc, "Extract the spectral sharpness of a spectrum");
jamie@52 538 strcpy(p_desc,
jamie@52 539 "Extract the spectral sharpness of an audio spectrum");
jamie@51 540 strcpy(author, "");
jamie@50 541 break;
jamie@52 542 case SPECTRAL_SLOPE:
jamie@52 543 strcpy(name, "spectral_slope");
jamie@51 544 strcpy(p_name, "Spectral Slope");
jamie@51 545 strcpy(desc, "Extract the spectral slope of a spectrum");
jamie@52 546 strcpy(p_desc,
jamie@52 547 "Extract the spectral slope of an audio spectrum");
jamie@51 548 strcpy(author, "");
jamie@50 549 break;
jamie@50 550 case HPS:
jamie@50 551 strcpy(name, "hps");
jamie@51 552 strcpy(p_name, "Harmonic Product Spectrum");
jamie@52 553 strcpy(desc,
jamie@52 554 "Extract the harmonic product spectrum of a spectrum");
jamie@52 555 strcpy(p_desc,
jamie@52 556 "Extract the harmonic product spectrum of an audio spectrum");
jamie@51 557 strcpy(author, "");
jamie@50 558 break;
jamie@50 559 case FLUX:
jamie@50 560 strcpy(name, "flux");
jamie@51 561 strcpy(p_name, "Spectral Flux");
jamie@51 562 strcpy(desc, "Extract the spectral flux of a spectrum");
jamie@52 563 strcpy(p_desc,
jamie@52 564 "Extract the spectral flux of an audio spectrum");
jamie@51 565 strcpy(author, "");
jamie@50 566 break;
jamie@50 567 case ATTACK_TIME:
jamie@50 568 strcpy(name, "attack_time");
jamie@51 569 strcpy(p_name, "Attack Time");
jamie@51 570 strcpy(desc, "Extract the attack time of a signal");
jamie@51 571 strcpy(p_desc, "Extract the attack time of an audio signal");
jamie@51 572 strcpy(author, "");
jamie@50 573 break;
jamie@50 574 case DECAY_TIME:
jamie@50 575 strcpy(name, "decay_time");
jamie@51 576 strcpy(p_name, "Decay Time");
jamie@51 577 strcpy(desc, "Extract the decay time of a signal");
jamie@51 578 strcpy(p_desc, "Extract the decay time of an audio signal");
jamie@51 579 strcpy(author, "");
jamie@50 580 break;
jamie@50 581 case DELTA_FEATURE:
jamie@50 582 strcpy(name, "delta_feature");
jamie@51 583 strcpy(p_name, "Delta Feature");
jamie@51 584 strcpy(desc, "Extract the time derivative of a feature");
jamie@51 585 strcpy(p_desc, "Extract the time derivative of a feature");
jamie@51 586 strcpy(author, "");
jamie@50 587 break;
jamie@50 588 case AUTOCORRELATION_FFT:
jamie@50 589 strcpy(name, "autocorrelation_fft");
jamie@51 590 strcpy(p_name, "Autocorrelation (FFT method)");
jamie@51 591 strcpy(desc, "Extract the autocorrelation of a signal");
jamie@51 592 strcpy(p_desc, "Extract the autocorrelation of an audio signal");
jamie@51 593 strcpy(author, "");
jamie@50 594 break;
jamie@50 595 case DCT:
jamie@50 596 strcpy(name, "dct");
jamie@51 597 strcpy(p_name, "Discrete Cosine Transform");
jamie@51 598 strcpy(desc, "Extract the DCT of a signal");
jamie@51 599 strcpy(p_desc, "Extract the DCT of an audio signal");
jamie@51 600 strcpy(author, "");
jamie@50 601 break;
jamie@50 602 case AUTOCORRELATION:
jamie@50 603 strcpy(name, "autocorrelation");
jamie@51 604 strcpy(p_name, "Autocorrelation");
jamie@51 605 strcpy(desc, "Extract the autocorrelation of a signal");
jamie@52 606 strcpy(p_desc,
jamie@52 607 "Extract the autocorrelation of an audio signal");
jamie@51 608 strcpy(author, "");
jamie@50 609 break;
jamie@50 610 case AMDF:
jamie@50 611 strcpy(name, "amdf");
jamie@51 612 strcpy(p_name, "Average Magnitude Difference Function");
jamie@51 613 strcpy(desc, "Extract the AMDF of a signal");
jamie@51 614 strcpy(p_desc, "Extract the AMDF of an audio signal");
jamie@51 615 strcpy(author, "");
jamie@50 616 break;
jamie@50 617 case ASDF:
jamie@50 618 strcpy(name, "asdf");
jamie@51 619 strcpy(p_name, "Average Squared Difference Function");
jamie@51 620 strcpy(desc, "Extract the ASDF of a signal");
jamie@51 621 strcpy(p_desc, "Extract the ASDF of an audio signal");
jamie@51 622 strcpy(author, "");
jamie@50 623 break;
jamie@50 624 default:
jamie@51 625 strcpy(name, "");
jamie@52 626 strcpy(p_name, "");
jamie@51 627 strcpy(desc, "");
jamie@51 628 strcpy(p_desc, "");
jamie@51 629 strcpy(author, "");
jamie@50 630 break;
jamie@50 631 }
jamie@50 632 }
jamie@50 633
jamie@50 634 return fd;
jamie@50 635 }
jamie@50 636
jamie@50 637 int xtract_free_descriptors(void *fd){
jamie@50 638
jamie@50 639 if (fd != NULL) {
jamie@50 640 free(fd);
jamie@50 641 }
jamie@50 642
jamie@50 643 return SUCCESS;
jamie@50 644 }
jamie@50 645
jamie@50 646
jamie@50 647
jamie@50 648
jamie@50 649