Module: FFTW3

Defined in:
lib/fftw3.rb,
ext/na_fftw3.c

Class Method Summary collapse

Class Method Details

.fft(*args) ⇒ Object



7
8
9
10
# File 'lib/fftw3.rb', line 7

def self.fft(*args)
  args.insert(1, -1)
  fft_raw(*args)
end

.fft_raw(*args) ⇒ Object



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'ext/na_fftw3.c', line 254

static VALUE
na_fftw3(int argc, VALUE *argv, VALUE self)
{
  VALUE val;
  volatile VALUE v1;
  struct NARRAY *a1;

  if (argc<2){
    rb_raise(rb_eArgError, "Usage: fftw(narray, direction [,dim0,dim1,...])");
  }
  val = argv[0];
  v1 = na_to_narray(val);
  GetNArray(v1,a1);
  if(a1->type <= NA_SFLOAT || a1->type == NA_SCOMPLEX ){
      return( na_fftw3_float(argc, argv, self) );
  } else {
      return( na_fftw3_double(argc, argv, self) );
  }

}

.ifft(*args) ⇒ Object



12
13
14
15
# File 'lib/fftw3.rb', line 12

def self.ifft(*args)
  args.insert(1, 1)
  fft_raw(*args)
end