/******************************************************************************** * Class FFTCalculator * * * * This class acts as a wrapper for the non-managed library FFTw, so it can be * * used in visual studio .net projects * * The FFTw library is an open-source library (www.FFTw.org). It does FFT * * calculations in different ways. For this project we use the most simple one * * to obtain the FFT of a one dimmensional vector. * * * * How to use the FFTCalculator class: * * 1 - When you create an FFTCalculator object, you must pass to the * * constructor the number of samples to analyze and pointers to the * * two buffers for the input signal and output FFT. The input signal * * must be a 16 bit signed integer array. The FFT is retourned as an * * array of floating-point doubles. * * 2 - To calculate the FFT, simply call the Calculate function. * * * * EQUITEL - C.V. February 2007 ALMDI * ********************************************************************************/ #include "Libreria FFtw\fftw3.h" #pragma once using namespace System; namespace FFTw_wrapper { public ref class FFTCalculator { public: //Constructor FFTCalculator(int NumeroDeMuestras, array^ BufferEntrada, array^ BufferSalida); //destructor ~FFTCalculator(); void Calculate(); private: int mNumSamples; array^ mBufin; array^ mBufout; fftw_complex *in; //Internal buffers fftw_complex *out; fftw_plan p; }; }