Mercurial > hg > qm-dsp
annotate dsp/transforms/FFT.h @ 255:9edaa3ce62e8
* Make MFCC able to accept already-FFT'd input, and simplify API a bit
* Add log power value to MFCC, restore windowing, and avoid some heap allocs
* In HMM, bail out of iteration if loglik hits NaN
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 18 Jan 2008 13:24:12 +0000 |
parents | 49844bc8a895 |
children | 6cb2b3cd5356 |
rev | line source |
---|---|
c@225 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
c@225 | 2 |
c@225 | 3 /* |
c@225 | 4 QM DSP Library |
c@225 | 5 |
c@225 | 6 Centre for Digital Music, Queen Mary, University of London. |
c@225 | 7 This file is based on Don Cross's public domain FFT implementation. |
c@225 | 8 */ |
c@225 | 9 |
c@225 | 10 #ifndef FFT_H |
c@225 | 11 #define FFT_H |
c@225 | 12 |
c@225 | 13 class FFT |
c@225 | 14 { |
c@225 | 15 public: |
c@255 | 16 static void process(unsigned int nSamples, bool bInverseTransform, |
c@255 | 17 const double *lpRealIn, const double *lpImagIn, |
c@255 | 18 double *lpRealOut, double *lpImagOut); |
c@225 | 19 FFT(); |
c@225 | 20 virtual ~FFT(); |
c@225 | 21 |
c@225 | 22 protected: |
c@255 | 23 static unsigned int reverseBits(unsigned int nIndex, unsigned int nBits); |
c@255 | 24 static unsigned int numberOfBitsNeeded( unsigned int nSamples ); |
c@255 | 25 static bool isPowerOfTwo( unsigned int nX ); |
c@225 | 26 }; |
c@225 | 27 |
c@225 | 28 #endif |