Sha256: a869ad202ad788418196152e28d96a3a58338848962bb4f1809f99d7721eea0b

Contents?: true

Size: 613 Bytes

Versions: 6

Compression:

Stored size: 613 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
org = data.clone

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

data.real_transform!(rtable, rwork)

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

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

#data.halfcomplex_inverse!(hctable, rwork)
#data.halfcomplex_inverse!()
#data.ifft!
#data.halfcomplex_inverse!(hctable, rwork)
data.ifft!(hctable, rwork)

GSL::graph(nil, org, data, "-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-halfcomplex2.rb
gsl-2.1.0.2 examples/fft/real-halfcomplex2.rb
gsl-2.1.0.1 examples/fft/real-halfcomplex2.rb
gsl-2.1.0 examples/fft/real-halfcomplex2.rb
gsl-1.16.0.6 examples/fft/real-halfcomplex2.rb
rb-gsl-1.16.0.5 examples/fft/real-halfcomplex2.rb