X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Ffilter.cpp;h=26c1c0eda20c5ddd42a29d450817732c2f5d80d1;hb=64c9743370f5c2f03bfc8866c54dd84ed306a614;hp=ef479387aa99b1b55964ada39e1d1bd5e38a6ce9;hpb=2fc7d45c0575dcbfe7bf5cf660034d99db1b983a;p=ctsim.git diff --git a/libctsim/filter.cpp b/libctsim/filter.cpp index ef47938..26c1c0e 100644 --- a/libctsim/filter.cpp +++ b/libctsim/filter.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: filter.cpp,v 1.31 2000/11/28 14:54:29 kevin Exp $ +** $Id: filter.cpp,v 1.34 2001/01/12 03:49:07 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -364,12 +364,13 @@ SignalFilter::spatialResponseCalc (int filterID, double bw, double x, double par double zinc = (zmax - zmin) / (n - 1); double z = zmin; - double q [n]; + double* q = new double [n]; for (int i = 0; i < n; i++, z += zinc) q[i] = frequencyResponse (filterID, bw, z, param) * cos (TWOPI * z * x); double y = 2 * integrateSimpson (zmin, zmax, q, n); - + delete q; + return (y); } @@ -558,30 +559,21 @@ SignalFilter::spatialResponseAnalytic (int filterID, double bw, double x, double } -/* NAME - * sinc Return sin(x)/x function - * - * SYNOPSIS - * v = sinc (x, mult) - * double v sinc value - * double x, mult - * - * DESCRIPTION - * v = sin(x * mult) / x; - */ +// Functions that are inline in filter.h + + +// sinc Return sin(x)/x function +// v = sinc (x, mult) +// Calculates sin(x * mult) / x; + +// integral_abscos Returns integral of u*cos(u) +// +// q = integral_abscos (u, w) +// double q Integral value +// double u Integration variable +// double w Upper integration boundary +// Returns the value of integral of u*cos(u)*dV for V = 0 to w -/* NAME - * integral_abscos Returns integral of u*cos(u) - * - * SYNOPSIS - * q = integral_abscos (u, w) - * double q Integral value - * double u Integration variable - * double w Upper integration boundary - * - * DESCRIPTION - * Returns the value of integral of u*cos(u)*dV for V = 0 to w - */