annotate osx/include/vamp-sdk/FFT.h @ 112:1e14aae10620

Add Vamp SDK for OS/X
author Chris Cannam <cannam@all-day-breakfast.com>
date Thu, 09 Jan 2014 09:17:21 +0000
parents
children
rev   line source
cannam@112 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@112 2
cannam@112 3 /*
cannam@112 4 Vamp
cannam@112 5
cannam@112 6 An API for audio analysis and feature extraction plugins.
cannam@112 7
cannam@112 8 Centre for Digital Music, Queen Mary, University of London.
cannam@112 9 Copyright 2006-2012 Chris Cannam and QMUL.
cannam@112 10
cannam@112 11 Permission is hereby granted, free of charge, to any person
cannam@112 12 obtaining a copy of this software and associated documentation
cannam@112 13 files (the "Software"), to deal in the Software without
cannam@112 14 restriction, including without limitation the rights to use, copy,
cannam@112 15 modify, merge, publish, distribute, sublicense, and/or sell copies
cannam@112 16 of the Software, and to permit persons to whom the Software is
cannam@112 17 furnished to do so, subject to the following conditions:
cannam@112 18
cannam@112 19 The above copyright notice and this permission notice shall be
cannam@112 20 included in all copies or substantial portions of the Software.
cannam@112 21
cannam@112 22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
cannam@112 23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
cannam@112 24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
cannam@112 25 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
cannam@112 26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
cannam@112 27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
cannam@112 28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
cannam@112 29
cannam@112 30 Except as contained in this notice, the names of the Centre for
cannam@112 31 Digital Music; Queen Mary, University of London; and Chris Cannam
cannam@112 32 shall not be used in advertising or otherwise to promote the sale,
cannam@112 33 use or other dealings in this Software without prior written
cannam@112 34 authorization.
cannam@112 35 */
cannam@112 36
cannam@112 37 #ifndef _VAMP_FFT_H_
cannam@112 38 #define _VAMP_FFT_H_
cannam@112 39
cannam@112 40 #include "plugguard.h"
cannam@112 41 _VAMP_SDK_PLUGSPACE_BEGIN(FFT.h)
cannam@112 42
cannam@112 43 namespace Vamp {
cannam@112 44
cannam@112 45 /**
cannam@112 46 * A simple FFT implementation provided for convenience of plugin
cannam@112 47 * authors.
cannam@112 48 *
cannam@112 49 * This class provides double-precision FFTs in power-of-two sizes
cannam@112 50 * only. It is slower than more sophisticated library
cannam@112 51 * implementations. If these requirements aren't suitable, make other
cannam@112 52 * arrangements.
cannam@112 53 *
cannam@112 54 * The inverse transform is scaled by 1/n.
cannam@112 55 *
cannam@112 56 * The implementation is from Don Cross's public domain FFT code.
cannam@112 57 */
cannam@112 58 class FFT
cannam@112 59 {
cannam@112 60 public:
cannam@112 61 /**
cannam@112 62 * Calculate a forward transform of size n.
cannam@112 63 *
cannam@112 64 * ri and ii must point to the real and imaginary component arrays
cannam@112 65 * of the input. For real input, ii may be NULL.
cannam@112 66 *
cannam@112 67 * ro and io must point to enough space to receive the real and
cannam@112 68 * imaginary component arrays of the output.
cannam@112 69 *
cannam@112 70 * All input and output arrays are of size n.
cannam@112 71 */
cannam@112 72 static void forward(unsigned int n,
cannam@112 73 const double *ri, const double *ii,
cannam@112 74 double *ro, double *io);
cannam@112 75
cannam@112 76 /**
cannam@112 77 * Calculate an inverse transform of size n.
cannam@112 78 *
cannam@112 79 * ri and ii must point to the real and imaginary component arrays
cannam@112 80 * of the input. For real input, ii may be NULL.
cannam@112 81 *
cannam@112 82 * ro and io must point to enough space to receive the real and
cannam@112 83 * imaginary component arrays of the output. The output is scaled
cannam@112 84 * by 1/n. The output pointers may not be NULL, even if the output
cannam@112 85 * is expected to be real.
cannam@112 86 *
cannam@112 87 * All input and output arrays are of size n.
cannam@112 88 */
cannam@112 89 static void inverse(unsigned int n,
cannam@112 90 const double *ri, const double *ii,
cannam@112 91 double *ro, double *io);
cannam@112 92 };
cannam@112 93
cannam@112 94 }
cannam@112 95
cannam@112 96 _VAMP_SDK_PLUGSPACE_END(FFT.h)
cannam@112 97
cannam@112 98 #endif