概要
DCT (Discrete Cosine Transform, 離散コサイン変換)をPure Rubyで実装し、gem化しました。
ソースコード: https://github.com/contribu/dct
お願い
現状、O(N)の遅い実装なので、
O(log N)の高速な実装にしていただける方いませんか?
使い方
インストール
以下をGemfileに追加
gem 'dct'
bundle install
bundle install
DCTII
# prepare input
input = (1..3).map { |i| i}
# transform
output = Dct.dct_type2(input)
DCTIII
# prepare input
input = (1..3).map { |i| i}
# transform
output = Dct.dct_type3(input)