fouriertest.frink

View or download fouriertest.frink in plain text format

//
// Test of the functions defined in Fourier.frink
//

use Fourier.frink

// Testing.  Create a regular sinewave
f = new array
for i=0 to 127
  f@i = cos[4 i/(2 pi)]

// Test and time DFT case.
start = now[]
b = DFT[f]
println[b]
end = now[]

println["Time in DFT is " + (end-start -> "ms")]

//scr = padAndScramble[f]
//println["Scrambled: $scr"]

//println[f]
start = now[]
bb = FFT[f]
end = now[]

println["Time in FFT is " + (end-start -> "ms")]

println[bb]

for [e] bb
   println[abs[e]]

for n = 0 to 127
   println[bb@n/b@n]

inverse = InverseFFT[bb]

println[inverse]


View or download fouriertest.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17645 days, 8 hours, 40 minutes ago.