/*
 * Decompiled with CFR 0_132.
 */
package DFT;

import DFT.Complex;
import DFT.Dft;
import DFT.Point;
import java.util.Vector;

class DftGen {
    DftGen() {
    }

    public static float[] from(float[] signal) {
        float[] res = new float[signal.length];
        Vector<Point> data = new Vector<Point>();
        int i = 0;
        while (i < signal.length) {
            Point p = new Point(i, signal[i]);
            data.addElement(p);
            ++i;
        }
        Dft DFT = new Dft(data);
        Vector<Complex> transData = new Vector<Complex>();
        int N = data.size();
        int i2 = 0;
        while (i2 < N) {
            Complex cx = DFT.dftPoint(i2);
            transData.addElement(cx);
            ++i2;
        }
        i2 = 0;
        while (i2 < N) {
            res[i2] = ((Complex)transData.get(i2)).mag();
            ++i2;
        }
        return res;
    }
}

