Mercurial > hg > qm-dsp
diff dsp/tempotracking/DownBeat.cpp @ 289:befe5aa6b450
* 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 | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 13 May 2009 09:19:12 +0000 |
parents | 5e125f030287 |
children | c3cdb404f807 |
line wrap: on
line diff
--- a/dsp/tempotracking/DownBeat.cpp Tue May 12 21:04:25 2009 +0000 +++ b/dsp/tempotracking/DownBeat.cpp Wed May 13 09:19:12 2009 +0000 @@ -43,6 +43,7 @@ m_beatframe = new double[m_beatframesize]; m_fftRealOut = new double[m_beatframesize]; m_fftImagOut = new double[m_beatframesize]; + m_fft = new FFTReal(m_beatframesize); } DownBeat::~DownBeat() @@ -54,6 +55,7 @@ delete[] m_beatframe; delete[] m_fftRealOut; delete[] m_fftImagOut; + delete m_fft; } void @@ -186,8 +188,7 @@ // Now FFT beat frame - FFT::process(m_beatframesize, false, - m_beatframe, 0, m_fftRealOut, m_fftImagOut); + m_fft->process(false, m_beatframe, m_fftRealOut, m_fftImagOut); // Calculate magnitudes