** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: filter.cpp,v 1.28 2000/11/10 15:29:37 kevin Exp $
+** $Id: filter.cpp,v 1.33 2001/01/02 16:02:13 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
int filterID = FILTER_INVALID;
for (int i = 0; i < s_iFilterCount; i++)
-cc if (strcasecmp (filterName, s_aszFilterName[i]) == 0) {
+ if (strcasecmp (filterName, s_aszFilterName[i]) == 0) {
filterID = i;
break;
}
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);
}