annotate src/vamp-sdk/FFT.cpp @ 337:d5c5a52e6c9f

Make the simple base-fft implementation accessible for use by plugins as well. Bump version to 2.4
author Chris Cannam
date Thu, 12 Jul 2012 11:37:31 +0100
parents
children ab8e761f3ee9
rev   line source
Chris@337 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@337 2
Chris@337 3 /*
Chris@337 4 Vamp
Chris@337 5
Chris@337 6 An API for audio analysis and feature extraction plugins.
Chris@337 7
Chris@337 8 Centre for Digital Music, Queen Mary, University of London.
Chris@337 9 Copyright 2006-2012 Chris Cannam and QMUL.
Chris@337 10
Chris@337 11 Permission is hereby granted, free of charge, to any person
Chris@337 12 obtaining a copy of this software and associated documentation
Chris@337 13 files (the "Software"), to deal in the Software without
Chris@337 14 restriction, including without limitation the rights to use, copy,
Chris@337 15 modify, merge, publish, distribute, sublicense, and/or sell copies
Chris@337 16 of the Software, and to permit persons to whom the Software is
Chris@337 17 furnished to do so, subject to the following conditions:
Chris@337 18
Chris@337 19 The above copyright notice and this permission notice shall be
Chris@337 20 included in all copies or substantial portions of the Software.
Chris@337 21
Chris@337 22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Chris@337 23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Chris@337 24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Chris@337 25 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
Chris@337 26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Chris@337 27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
Chris@337 28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Chris@337 29
Chris@337 30 Except as contained in this notice, the names of the Centre for
Chris@337 31 Digital Music; Queen Mary, University of London; and Chris Cannam
Chris@337 32 shall not be used in advertising or otherwise to promote the sale,
Chris@337 33 use or other dealings in this Software without prior written
Chris@337 34 authorization.
Chris@337 35 */
Chris@337 36
Chris@337 37 #include <vamp-sdk/FFT.h>
Chris@337 38
Chris@337 39 #include <cmath>
Chris@337 40
Chris@337 41 #if ( VAMP_SDK_MAJOR_VERSION != 2 || VAMP_SDK_MINOR_VERSION != 4 )
Chris@337 42 #error Unexpected version of Vamp SDK header included
Chris@337 43 #endif
Chris@337 44
Chris@337 45 _VAMP_SDK_PLUGSPACE_BEGIN(FFT.cpp)
Chris@337 46
Chris@337 47 namespace Vamp {
Chris@337 48
Chris@337 49 #include "FFTimpl.cpp"
Chris@337 50
Chris@337 51 void
Chris@337 52 FFT::forward(unsigned int n,
Chris@337 53 const double *ri, const double *ii,
Chris@337 54 double *ro, double *io)
Chris@337 55 {
Chris@337 56 fft(n, false, ri, ii, ro, io);
Chris@337 57 }
Chris@337 58
Chris@337 59 void
Chris@337 60 FFT::inverse(unsigned int n,
Chris@337 61 const double *ri, const double *ii,
Chris@337 62 double *ro, double *io)
Chris@337 63 {
Chris@337 64 fft(n, true, ri, ii, ro, io);
Chris@337 65 }
Chris@337 66
Chris@337 67 }
Chris@337 68
Chris@337 69 _VAMP_SDK_PLUGSPACE_END(FFT.cpp)
Chris@337 70