LoginSignup
1
0

More than 5 years have passed since last update.

DCT (Discrete Cosine Transform)をPure Rubyで実装したgemを作りました

Last updated at Posted at 2018-08-10

概要

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)
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0