Sha256: 2d5b0b7da3230260380b41f3de6b59bee93c922569021c30226ef10bfe082b60

Contents?: true

Size: 749 Bytes

Versions: 6

Compression:

Stored size: 749 Bytes

Contents

#!/usr/bin/env ruby
require("gsl")

n = 100
data = GSL::Vector.alloc(n)
#data = NArray.float(n)

for i in (n/3)...(2*n/3) do
  data[i] = 1.0
end

rtable = GSL::FFT::RealWavetable.alloc(n)
rwork = GSL::FFT::RealWorkspace.alloc(n)

#ffted = data.real_transform(rtable, rwork)
#ffted = data.real_transform(rtable)
#ffted = data.real_transform(rwork)
#ffted = data.real_transform()
#ffted = data.fft
ffted = data.real_transform()

for i in 11...n do
  ffted[i] = 0.0
end

hctable = GSL::FFT::HalfComplexWavetable.alloc(n)

#data2 = ffted.halfcomplex_inverse(hctable, rwork)
#data2 = ffted.halfcomplex_inverse()
#data2 = ffted.ifft
data2 = ffted.halfcomplex_inverse()

GSL::graph(nil, data, data2, "-T X -C -g 3 -L 'Real-halfcomplex' -x 0 #{data.size}")

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gsl-2.1.0.3 examples/fft/real-halfcomplex.rb
gsl-2.1.0.2 examples/fft/real-halfcomplex.rb
gsl-2.1.0.1 examples/fft/real-halfcomplex.rb
gsl-2.1.0 examples/fft/real-halfcomplex.rb
gsl-1.16.0.6 examples/fft/real-halfcomplex.rb
rb-gsl-1.16.0.5 examples/fft/real-halfcomplex.rb