diff dsp/chromagram/Chromagram.cpp @ 64:6cb2b3cd5356

* Refactor FFT a little bit so as to separate construction and processing rather than have a single static method -- will make it easier to use a different implementation * pull in KissFFT implementation (not hooked up yet)
author cannam
date Wed, 13 May 2009 09:19:12 +0000
parents 114e833c07ac
children dcb555b90924
line wrap: on
line diff
--- a/dsp/chromagram/Chromagram.cpp	Tue May 12 21:04:25 2009 +0000
+++ b/dsp/chromagram/Chromagram.cpp	Wed May 13 09:19:12 2009 +0000
@@ -34,9 +34,6 @@
     // Create array for chroma result
     m_chromadata = new double[ m_BPO ];
 
-    // Initialise FFT object	
-    m_FFT = new FFT;
-
     // Create Config Structure for ConstantQ operator
     CQConfig ConstantQConfig;
 
@@ -55,6 +52,9 @@
     m_frameSize = m_ConstantQ->getfftlength();
     m_hopSize = m_ConstantQ->gethop();
 
+    // Initialise FFT object	
+    m_FFT = new FFTReal(m_frameSize);
+
     m_FFTRe = new double[ m_frameSize ];
     m_FFTIm = new double[ m_frameSize ];
     m_CQRe  = new double[ m_uK ];
@@ -135,7 +135,7 @@
     m_window->cut(m_windowbuf);
 
     // FFT of current frame
-    m_FFT->process(m_frameSize, 0, m_windowbuf, NULL, m_FFTRe, m_FFTIm);
+    m_FFT->process(0, m_windowbuf, m_FFTRe, m_FFTIm);
 
     return process(m_FFTRe, m_FFTIm);
 }