Module: NoyesC

Defined in:
lib/cext/live_cmn.c,
lib/cext/segmenter.c,
lib/cext/mfcc_16x8.c,
lib/cext/mel_filter.c,
lib/cext/array_list.c,
lib/cext/preemphasis.c,
lib/cext/speech_trimmer.c,
lib/cext/log_compressor.c,
lib/cext/hamming_window.c,
lib/cext/power_spectrum.c,
lib/cext/bent_cent_marker.c,
lib/cext/discrete_cosine_transform.c

Defined Under Namespace

Classes: ArrayList, BentCentMarker, DCT, HammingWindow, LiveCMN, LogCompressor, MelFilter, Mfcc16x8, PowerSpectrumFilter, Preemphasizer, Segmenter, SpeechTrimmer

Class Method Summary collapse

Class Method Details

.dftObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/cext/discrete_cosine_transform.c', line 51

static VALUE t_dft(VALUE classmod, VALUE data, VALUE size) {
  Carr *M = r2carr(data);
  Cmat *R = dft(M->data, M->rows, FIX2INT(size));
  VALUE result = rb_ary_new2(R->cols);
  int i;
  for (i=0;i<R->cols;++i) {
    VALUE real = rb_float_new(R->data[0][i]);
    VALUE imag = rb_float_new(R->data[1][i]);
    rb_ary_store(result, i, rb_complex_new(real, imag));
  }
  carr_free(M);
  cmat_free(R);
  return result;
}