package com.imsl.test.example.math; import com.imsl.math.*; /** *
* Computes the Fourier coefficients of a periodic sequence.
* * The Fourier coefficients of a periodic sequence are computed. The * coefficients are then used to reproduce the periodic sequence. * * @see Code * @see Output * */ public class FFTEx1 { public static void main(String args[]) { double x[] = {1, 2, 3, 4, 5, 6, 7, 8}; FFT fft = new FFT(x.length); double y[] = fft.forward(x); double z[] = fft.backward(y); for (int i = 0; i < x.length; i++) { z[i] = z[i] / x.length; } new PrintMatrix("x").print(x); new PrintMatrix("y").print(y); new PrintMatrix("z").print(z); } }