Sha256: 7d06d5a22467dd1cf424560457d74a6a043cb685f0ff4aca98747a8ae16503a7

Contents?: true

Size: 755 Bytes

Versions: 16

Compression:

Stored size: 755 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

16 entries across 16 versions & 4 rubygems

Version Path
rb-gsl-1.16.0.4 examples/fft/real-halfcomplex.rb
rb-gsl-1.16.0.3 examples/fft/real-halfcomplex.rb
rb-gsl-1.16.0.3.rc1 examples/fft/real-halfcomplex.rb
gsl-nmatrix-1.15.3.2 examples/fft/real-halfcomplex.rb
gsl-nmatrix-1.15.3.1 examples/fft/real-halfcomplex.rb
rb-gsl-1.16.0.2 examples/fft/real-halfcomplex.rb
rb-gsl-1.16.0.1 examples/fft/real-halfcomplex.rb
rb-gsl-1.16.0 examples/fft/real-halfcomplex.rb
rb-gsl-1.15.3.2 examples/fft/real-halfcomplex.rb
rb-gsl-1.15.3.1 examples/fft/real-halfcomplex.rb
blackwinter-gsl-1.15.3.2 examples/fft/real-halfcomplex.rb
gsl-nmatrix-1.15.3.0 examples/fft/real-halfcomplex.rb
gsl-1.15.3 examples/fft/real-halfcomplex.rb
gsl-1.14.7 examples/fft/real-halfcomplex.rb
gsl-1.14.6 examples/fft/real-halfcomplex.rb
gsl-1.14.5 examples/fft/real-halfcomplex.rb