Mercurial > hg > svgui
changeset 202:cec1f78fbfca
* Add non-fftw3 fft alternative
author | Chris Cannam |
---|---|
date | Fri, 09 Feb 2007 11:32:34 +0000 |
parents | 1ab31723825d |
children | 258af0c4dc28 |
files | layer/layer.pro widgets/WindowShapePreview.cpp widgets/widgets.pro |
diffstat | 3 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/layer.pro Fri Feb 09 09:32:04 2007 +0000 +++ b/layer/layer.pro Fri Feb 09 11:32:34 2007 +0000 @@ -1,6 +1,6 @@ TEMPLATE = lib -SV_UNIT_PACKAGES = +SV_UNIT_PACKAGES = fftw3f load(../sv.prf) CONFIG += sv staticlib qt thread warn_on stl rtti exceptions
--- a/widgets/WindowShapePreview.cpp Fri Feb 09 09:32:04 2007 +0000 +++ b/widgets/WindowShapePreview.cpp Fri Feb 09 11:32:34 2007 +0000 @@ -22,7 +22,7 @@ #include <QFont> #include <QString> -#include <fftw3.h> +#include "data/fft/FFTapi.h" #include <iostream> @@ -121,18 +121,18 @@ int fftsize = 512; - float *input = (float *)fftwf_malloc(fftsize * sizeof(float)); - fftwf_complex *output = - (fftwf_complex *)fftwf_malloc(fftsize * sizeof(fftwf_complex)); - fftwf_plan plan = fftwf_plan_dft_r2c_1d(fftsize, input, output, + float *input = (float *)fftf_malloc(fftsize * sizeof(float)); + fftf_complex *output = + (fftf_complex *)fftf_malloc(fftsize * sizeof(fftf_complex)); + fftf_plan plan = fftf_plan_dft_r2c_1d(fftsize, input, output, FFTW_ESTIMATE); for (int i = 0; i < fftsize; ++i) input[i] = 0.f; for (int i = 0; i < step * 2; ++i) { input[fftsize/2 - step + i] = windower.getValue(i); } - fftwf_execute(plan); - fftwf_destroy_plan(plan); + fftf_execute(plan); + fftf_destroy_plan(plan); float maxdb = 0.f; float mindb = 0.f; @@ -186,8 +186,8 @@ path.addRect(0, 0, fw, h + 1); freqPainter.drawPath(path); - fftwf_free(input); - fftwf_free(output); + fftf_free(input); + fftf_free(output); freqPainter.setFont(font); label = tr("dB / freq");