/usr/share/doc/ruby-gsl/examples/fft/radix2.rb is in ruby-gsl 2.1.0.3+dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/usr/bin/env ruby
require("gsl")
n = 128
data = GSL::Vector::Complex.alloc(n)
data[0] = 1.0
c = GSL::Complex[1, 0]
for i in 1..10 do
data[i] = c
data[n-i] = c
end
ffted = data.radix2_forward
ffted /= Math::sqrt(n)
GSL::graph(nil, data.re, ffted.re, "-T X -C -g 3 -L 'Radix-2' -x 0 #{data.size/2}")
|