

import java.util.ArrayList;

import net.beadsproject.beads.analysis.FeatureExtractor;
import net.beadsproject.beads.core.TimeStamp;


public class SlowFFTWrapper extends FeatureExtractor<float[], float[]>{
	
	public SlowFFTWrapper() {
		super();	
	}
	
	Complex complexfeatures[];
	
	public void process(TimeStamp start, TimeStamp end, float[] data) {		
		Complex dat[] = new Complex[data.length];
		for(int i=0;i<data.length;i++)
		{
			dat[i] = new Complex(data[i],0);
		}
				
		complexfeatures = SlowFFT.fft(dat);
		
		features = new float[2*complexfeatures.length];
		for(int i=0;i<complexfeatures.length;i++)
		{
			features[2*i] = (float)complexfeatures[i].re();
			features[2*i+1] = (float)complexfeatures[i].im();			
		}
		forward(start, end);
	}
	
}
