Skip to content

Function module similar to `filter` in MatLab or Octave.

License

Notifications You must be signed in to change notification settings

Himeyama/mfilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mfilter

Gem Version

MatLab (Octave) ライクの filter 関数の Ruby 実装。

インストール方法

インストールが必要なパッケージ

sudo apt update
sudo apt install liboctave-dev -y

# or

brew install octave

Gemfile

gem "mfilter"

Gem のインストールを実行:

$ bundle install

Gem のインストール

$ gem install mfilter

使用例

#!/usr/bin/env ruby

require "mfilter"

t = Array.new(100){|i| -Math::PI + i * 2 * Math::PI / (100 - 1)}
x = t.map{|e| Math::sin(e) + 0.25 * rand}
b = [0.2] * 5
a = [1]

y = MFilter::filter(b, a, x)

open("test/data.dat", "w") do |f|
    f.puts [t, x, y].transpose.map{|e| e.join(" ")}
end

example

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/himeyama/mfilter.

About

Function module similar to `filter` in MatLab or Octave.

Resources

License

Stars

Watchers

Forks

Packages

No packages published