/** * Benchmark kernels for digital signal processing. The four kernels are * sinc interpolation, recursive filtering, convolution, and fast Fourier * transform. *

* This program is self-contained. It depends on only standard Java class * libraries. * @author Dave Hale, Colorado School of Mines * @version 2005.10.06 */ public class DspBenchDouble { public static void main(String[] args) { for (int i=0; i<3; ++i) { benchConvolution(); benchRecursiveFilter(); benchFft(); benchSincInterpolation(); } } private static final double MAXTIME = 2.0; private static void benchSincInterpolation() { int nxin = 10000; double dxin = 1.0+1.0/(double)nxin; double fxin = -0.5/(double)nxin; double[] yin = ramp(nxin); int nxout = 10000; double[] xout = ramp(nxout); double[] yout = ramp(nxout); Stopwatch sw = new Stopwatch(); int nloop = 0; int nflop = 2*LSINC*nxout; for (sw.start(); sw.time()