com.softsynth.jmsl.util
Class FFT

java.lang.Object
  extended bycom.softsynth.jmsl.util.FFT

public class FFT
extends java.lang.Object

FFT algorithm from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)
Copyright (C) 1988-1992 by Cambridge University Press.
To order Numerical Recipes books,diskettes, or CDROMs
visit website http://www.nr.com or call 1-800-872-7423 (North America only)


Adapted from C source by Nick Didkovsky

Replaces data[1..2*nn] by its discrete Fourier transform, if isign is input as 1; or replaces data[1..2*nn] by nn times its inverse discrete Fourier transform, if isign is input as -1 data is a complex array of length nn or, equivalently, a real array of length 2*nn. nn MUST be an integer power of 2 (this is not checked for!).


Constructor Summary
FFT()
           
 
Method Summary
static void copyToShape(MusicShape s, double[] data, int dim, boolean timeDomain)
          Copy doubles in data to a dimension of a MusicShape.
static void fft(double[] data, int nn, int isign)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FFT

public FFT()
Method Detail

fft

public static void fft(double[] data,
                       int nn,
                       int isign)

copyToShape

public static void copyToShape(MusicShape s,
                               double[] data,
                               int dim,
                               boolean timeDomain)
Copy doubles in data to a dimension of a MusicShape. If data[] contains time domain samples, copy even numbered array indexes to shape. If data[] contains harmonic spectrum info, copy magnitude of real and imaginary adjacent array pairs to shape
MusicShape must be initialized and have (data.length / 2) dummy elements with at least dim dimensions added to it already.