예제 #1
0
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 public void execute()
 {
     NativeFFTW.fftw_execute(_plan);
 }
예제 #4
0
 private void destroy()
 {
     NativeFFTW.fftw_destroy_plan(_plan);
     NativeFFTW.fftw_free(_input);
     NativeFFTW.fftw_free(_output);
 }