#
# fftl01.rb
#
# $Id: fftl01.rb,v 1.2 2000/11/27 01:53:56 keiko Exp $
#

require "narray"
require "numru/dcl"

include NumRu
include Math


N = 12
NW = N/2
NWS = 3*N+15

rx = [0, 1, 2, 3, 4, 3, 2, 1, 0, -1, -2, -1].collect{|i| i.to_f}
#rx = [0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -2, -1].collect{|i| i.to_f}

wsave = DCL::ezffti(N)
printf " LIST OF RX : %s\n", "%5.1f"*N % rx
a0, ak, bk = DCL::ezfftf(rx, wsave)
printf " LIST OF CX : %8.3f%s\n", a0, "%8.3f"*NW % ak.to_a
printf " LIST OF SX : %s%s\n", " "*8, "%8.3f"*NW % bk.to_a
rx = DCL::ezfftb(a0, ak, bk, wsave)
printf " LIST OF RX : %s\n", "%5.1f"*N % rx.to_a

