Package ca.nengo.math.impl

Source Code of ca.nengo.math.impl.ConvolutionTest

/*
* Created on 25-Jul-2006
*/
package ca.nengo.math.impl;

import junit.framework.TestCase;
import ca.nengo.math.Function;
import ca.nengo.plot.Plotter;

public class ConvolutionTest extends TestCase {

    protected void setUp() throws Exception {
        super.setUp();
    }

    public void testNothing() {
    }

    //functional test ...
    public static void main(String[] args) {
        Function one = new PiecewiseConstantFunction(new float[]{0.1f}, new float[]{0, 1});
        Function two = new AbstractFunction(1) {
            private static final long serialVersionUID = 1L;
            public float map(float[] from) {
                float t = from[0];
                float tau = .05f;
                return (1 - t/tau) * (float) Math.exp(-t/tau);
            }
        };

        Function conv = new Convolution(one, two, .0001f, .5f);

        Plotter.plot(conv, 0, .001f, 1f, "convolution of step and differentiator impulse response");
    }
}
TOP

Related Classes of ca.nengo.math.impl.ConvolutionTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.