package shtick.math; ////////////////////////////////////////////////////// //**************************************************// //* FourierSeries Class *// //* *// //* Version 1.2.1 *// //* Author: Sean M. Cox *// //* Organization: The Shtick *// //* http://www.smcox.com/ *// //* *// //* Base class for a Fourier Series. Translates a *// //* string of data into its component harmonics *// //* Using a basis created by the FourierBasis *// //* class passed in the constructor. *// //* *// //**************************************************// ////////////////////////////////////////////////////// public class FourierSeries { double[] toTranslate; double[] sineSeries= new double[10]; double[] cosineSeries= new double[10]; double[][] sineBasis; double[][] cosineBasis; boolean translated= false; public FourierSeries(double[] data){ toTranslate=data; } public FourierSeries(double[] data, FourierBasis fb){ toTranslate=data; sineBasis=fb.getSineBasis(); cosineBasis=fb.getCosineBasis(); sineSeries=new double[sineBasis.length]; cosineSeries=new double[cosineBasis.length]; } public boolean translate(){ if (toTranslate.length > 0){ double tally=0; for (int i=0;i