Class: NoyesC::Mfcc16x8

Inherits:
Object
  • Object
show all
Defined in:
lib/cext/mfcc_16x8.c

Instance Method Summary collapse

Constructor Details

#initializeObject


11
12
13
14
15
16
17
# File 'lib/cext/mfcc_16x8.c', line 11

static VALUE t_init(VALUE self, VALUE args) {
  Mfcc16x8 *s = mfcc_16x8_new();
  VALUE mfcc_16x8 = Data_Wrap_Struct(cMfcc16x8, 0, _mfcc_16x8_free, s);
  rb_iv_set(self, "@mfcc_16x8", mfcc_16x8);

  return self;
}

Instance Method Details

#<<Object


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cext/mfcc_16x8.c', line 19

static VALUE t_left_shift(VALUE self, VALUE obj) {
  Carr *M = r2carr(obj);
  VALUE mfcc_16x8 = rb_iv_get(self, "@mfcc_16x8");
  Mfcc16x8 *s;
  Data_Get_Struct(mfcc_16x8, Mfcc16x8, s);
  Cmat *N = mfcc_16x8_apply(s, M);
  VALUE result = cmat2r(N);
  cmat_free(N);
  carr_free(M);
  return result;
}