Paste: unworking fft for 4 elements

Author: m
Mode: java
Date: Wed, 29 Sep 2010 19:08:44
Plain Text |
            double[] x0 = rhs.get(0);
            double[] x1 = rhs.get(1);
            double[] x2 = rhs.get(2);
            double[] x3 = rhs.get(3);

            // zero step
            double coef = -(2 * Math.PI) / (size / 2);
            double[] exp = exp(coef * 0, null);

            ComplexSample X0 = new ComplexSample(size/2);
            ComplexSample X1 = new ComplexSample(size/2);

            X0.set(0, add(x0, mult(exp, x1, null), null));
            X0.set(1, sub(x0, mult(exp, x1, null), null));
            X1.set(0, add(x2, mult(exp, x3, null), null));
            X1.set(1, sub(x2, mult(exp, x3, null), null));
            
            coef = -(2 * Math.PI) / size;
            double[] exp0 = exp(coef * 0, null);
            double[] exp1 = exp(coef * 1, null);

            lhs.set(0, add(X0.get(0), mult(exp0, X1.get(0), null), null));
            lhs.set(1, add(X0.get(1), mult(exp1, X1.get(1), null), null));
            lhs.set(2, sub(X0.get(0), mult(exp0, X1.get(0), null), null));            
            lhs.set(3, sub(X0.get(1), mult(exp1, X1.get(1), null), null));

New Annotation

Summary:
Author:
Mode:
Body: