/*    */ package DFT;
/*    */ 
/*    */ import java.util.Vector;
/*    */ 
/*    */ class DftGen
/*    */ {
/*    */   public static float[] from(float[] signal)
/*    */   {
/*  9 */     float[] res = new float[signal.length];
/*    */     
/* 11 */     Vector<Point> data = new Vector();
/*    */     
/*    */ 
/* 14 */     for (int i = 0; i < signal.length; i++) {
/* 15 */       Point p = new Point(i, signal[i]);
/* 16 */       data.addElement(p);
/*    */     }
/*    */     
/* 19 */     Dft DFT = new Dft(data);
/*    */     
/* 21 */     Vector<Complex> transData = new Vector();
/* 22 */     int N = data.size();
/*    */     
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/* 29 */     for (int i = 0; i < N; i++) {
/* 30 */       Complex cx = DFT.dftPoint(i);
/* 31 */       transData.addElement(cx);
/*    */     }
/* 33 */     for (int i = 0; i < N; i++) { res[i] = ((Complex)transData.get(i)).mag();
/*    */     }
/* 35 */     return res;
/*    */   }
/*    */ }


/* Location:              F:\JAVA\WORKSPACE\chronoEditor_v2.3.jar!\DFT\DftGen.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */