public unsafe SFFT(int bins) { _input = NativeFFTW.fftw_malloc(sizeof(FFTWComplex) * bins); _output = NativeFFTW.fftw_malloc(sizeof(FFTWComplex) * bins); _plan = NativeFFTW.fftw_plan_dft_1d(bins, _input, _output, FFTW.FFTW_FORWARD, FFTW.FFTW_ESTIMATE); _bins = bins; }
private unsafe void realloc(int bins) { destroy(); _input = NativeFFTW.fftw_malloc(sizeof(FFTWComplex) * bins); _output = NativeFFTW.fftw_malloc(sizeof(FFTWComplex) * bins); _plan = NativeFFTW.fftw_plan_dft_1d(bins, _input, _output, FFTW.FFTW_FORWARD, FFTW.FFTW_ESTIMATE); _bins = bins; }
public void execute() { NativeFFTW.fftw_execute(_plan); }
private void destroy() { NativeFFTW.fftw_destroy_plan(_plan); NativeFFTW.fftw_free(_input); NativeFFTW.fftw_free(_output); }