Sha256: 41bf55925c1767d5fa344b639076fd2bade668a198e92a84a2cd83b18b47a1c3
Contents?: true
Size: 595 Bytes
Versions: 22
Compression:
Stored size: 595 Bytes
Contents
#!/usr/bin/env ruby require("gsl") n = 630 data = GSL::Vector::Complex.alloc(n) table = GSL::FFT::ComplexWavetable.alloc(n) space = GSL::FFT::ComplexWorkspace.alloc(n) data[0] = 1.0 for i in 1..10 do data[i] = GSL::Complex[1.0, 0.0] data[n-i] = GSL::Complex[1.0, 0.0] end org = data.clone # Select whichever you like #data.forward!(table, space) #data.forward!(table) #data.forward!(space) #data.forward!() #data.transform!(table, space, GSL::FFT::Forward) #data.transform!(GSL::FFT::Forward) data.forward!(table, space) data /= Math::sqrt(n) GSL::graph(nil, org.re, data.re, "-C -g 3")
Version data entries
22 entries across 22 versions & 4 rubygems