diff options
author | Tom Rondeau | 2012-04-13 18:36:53 -0400 |
---|---|---|
committer | Tom Rondeau | 2012-04-13 18:36:53 -0400 |
commit | f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 (patch) | |
tree | 7e846386b9eb1676f9a93fc4a1e55916b9accc97 /gnuradio-core/src/gen_interpolator_taps | |
parent | 6a1e9783fec6ed827f49db27c171591d30f32933 (diff) | |
download | gnuradio-f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2.tar.gz gnuradio-f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2.tar.bz2 gnuradio-f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2.zip |
Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future.
The sed script was provided by Moritz Fischer.
Diffstat (limited to 'gnuradio-core/src/gen_interpolator_taps')
6 files changed, 44 insertions, 44 deletions
diff --git a/gnuradio-core/src/gen_interpolator_taps/Makefile.am.obsolete b/gnuradio-core/src/gen_interpolator_taps/Makefile.am.obsolete index 1b54af5e7..cd0edaf5c 100644 --- a/gnuradio-core/src/gen_interpolator_taps/Makefile.am.obsolete +++ b/gnuradio-core/src/gen_interpolator_taps/Makefile.am.obsolete @@ -1,23 +1,23 @@ # # Copyright 2002 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# include $(top_srcdir)/Makefile.common @@ -32,7 +32,7 @@ EXTRA_DIST += \ # if ENABLE_FORTRAN # noinst_PROGRAMS = gen_interpolator_taps # noinst_HEADERS = simpson.h -# +# # gen_interpolator_taps_SOURCES = gen_interpolator_taps.c objective_fct.c simpson.c praxis.f # gen_interpolator_taps_LDADD = $(FLIBS) -lm # diff --git a/gnuradio-core/src/gen_interpolator_taps/README b/gnuradio-core/src/gen_interpolator_taps/README index 0bc547d3f..8fe3e2ba3 100644 --- a/gnuradio-core/src/gen_interpolator_taps/README +++ b/gnuradio-core/src/gen_interpolator_taps/README @@ -1,28 +1,28 @@ # # Copyright 2002 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# This file contains the source for gen_interpolator_taps, a program which generates optimal interpolator taps for a fractional -interpolator. +interpolator. The ideal interpolator requires an infinite tap FIR filter to realize. We design a separate 8 tap filter for each value of mu, diff --git a/gnuradio-core/src/gen_interpolator_taps/gen_interpolator_taps.c b/gnuradio-core/src/gen_interpolator_taps/gen_interpolator_taps.c index d588868b2..2f359102c 100644 --- a/gnuradio-core/src/gen_interpolator_taps/gen_interpolator_taps.c +++ b/gnuradio-core/src/gen_interpolator_taps/gen_interpolator_taps.c @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2002 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -38,7 +38,7 @@ extern double global_B; extern double prax2_ (double (fct)(double x[], int *ntaps), double initv[], int *ntaps, double result[]); -static void +static void usage (char *name) { fprintf (stderr, "usage: %s [-v] [-n <nsteps>] [-t <ntaps>] [-B <bw>]\n", name); @@ -49,7 +49,7 @@ static void printline (double x[], int ntaps, int imu, int nsteps) { int i; - + printf (" { "); for (i = 0; i < ntaps; i++){ printf ("%12.5e", x[i]); @@ -60,7 +60,7 @@ printline (double x[], int ntaps, int imu, int nsteps) } } -int +int main (int argc, char **argv) { double xx[MAX_NSTEPS+1][MAX_NTAPS]; @@ -87,11 +87,11 @@ main (int argc, char **argv) case 'B': global_B = strtod (optarg, 0); break; - + case 'v': verbose = 1; break; - + default: usage (argv[0]); break; @@ -107,7 +107,7 @@ main (int argc, char **argv) fprintf (stderr, "%s: nsteps must be < %d\n", argv[0], MAX_NSTEPS); exit (1); } - + if ((ntaps & 1) != 0){ fprintf (stderr, "%s: ntaps must be even\n", argv[0]); exit (1); @@ -122,9 +122,9 @@ main (int argc, char **argv) fprintf (stderr, "%s: bandwidth must be in the range (0, 0.5)\n", argv[0]); exit (1); } - + step_size = 1.0/nsteps; - + // the optimizer chokes on the two easy cases (0/N and N/N). We do them by hand... for (i = 0; i < ntaps; i++) @@ -172,14 +172,14 @@ main (int argc, char **argv) printf ("static const int NTAPS = %4d;\n", ntaps); printf ("static const int NSTEPS = %4d;\n", nsteps); printf ("static const double BANDWIDTH = %g;\n\n", global_B); - + printf ("static const float taps[NSTEPS+1][NTAPS] = {\n"); printf (" // -4 -3 -2 -1 0 1 2 3 mu\n"); for (i = 0; i <= nsteps; i++) printline (xx[i], ntaps, i, nsteps); - + printf ("};\n\n"); return 0; diff --git a/gnuradio-core/src/gen_interpolator_taps/objective_fct.c b/gnuradio-core/src/gen_interpolator_taps/objective_fct.c index cb15be74e..129486d63 100644 --- a/gnuradio-core/src/gen_interpolator_taps/objective_fct.c +++ b/gnuradio-core/src/gen_interpolator_taps/objective_fct.c @@ -1,19 +1,19 @@ /* -*- c -*- */ /* * Copyright 2002 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -48,7 +48,7 @@ double global_B = B; * and Fechtel, Wiley, 1998. */ -static double +static double integrand (double omega) { double real_ideal; @@ -103,7 +103,7 @@ objective (double x[], int *ndim) return c_fcn (x, *ndim); } -static double +static double si (double x) { if (fabs (x) < 1e-9) diff --git a/gnuradio-core/src/gen_interpolator_taps/praxis.txt b/gnuradio-core/src/gen_interpolator_taps/praxis.txt index 5c4b81556..9d0606566 100644 --- a/gnuradio-core/src/gen_interpolator_taps/praxis.txt +++ b/gnuradio-core/src/gen_interpolator_taps/praxis.txt @@ -18,8 +18,8 @@ and FORTRAN by Brent, and have been used fairly widely. Brent also gave a multi-dimensional minimization algorithm, PRAXIS, but only shows an implementation in ALGOL W. This routine has not been widely used, at least in the U.S. -The PRAXIS package has been translated into FORTRAN -by Rosalee Taylor, Sue Pinski, and me, and +The PRAXIS package has been translated into FORTRAN +by Rosalee Taylor, Sue Pinski, and me, and I am making it available via anonymous ftp for use as freeware (please do not remove our names). @@ -30,7 +30,7 @@ freeware (please do not remove our names). get praxis.f quit - + Brent's method and its performance Newton's method for minimization can find the minimum of a @@ -51,7 +51,7 @@ and is available as file va04a.f in the same directory as praxis.f. VA04A is not extremely robust, and can give underflow, overflow, or division by zero. va04a.f has several documented patches in it where I tried to get around various abnormal terminations. -I do not recommend VA04A very strongly. +I do not recommend VA04A very strongly. Brent's PRAXIS added orthogonalization and several other features to Powell's method. Brent also dealt carefully with roundoff. @@ -75,13 +75,13 @@ The methods of Powell, Brent, et al. require that the function for which a local minimum is sought must be smooth; that is, the function and all of its first partial derivatives must be continuous. - + Brent compared his method to the methods of Powell, of Stewart, and of Davies, Swann, and Campey. Indirectly, he compared it also to the Davidon-Fletcher-Powell quasi-Newton method. He found that his method was about as efficient as the best of these in most cases, and that it was more robust than others -in some cases. (Pages 139-155 in Brent's book give fair +in some cases. (Pages 139-155 in Brent's book give fair comparisons to other methods. The results in Table 7.1 on page 138 are correct, but do not include progress all the way to convergence, and are therefore not too useful.) @@ -89,7 +89,7 @@ to convergence, and are therefore not too useful.) On least squares problems, all of these general minimization methods are likely to be inefficient compared to least squares methods such as the Gauss-Newton or Marquardt methods. - + In addition to the scale dependence that Fletcher deplored, PRAXIS also had the disadvantage that it required N, the number of parameters, to be greater than or equal to two. @@ -134,18 +134,18 @@ except possibly Cray computers, in which REAL is reasonably precise. The value of "machine epsilon" is computed in subroutine PRASET using bisection, and is called EPSMCH. Brent computes EPSMCH**4 and 1/EPSMCH**4 in PRAXIS, -and uses these quantities later. +and uses these quantities later. Because EPSMCH in DOUBLE PRECISION is less than 1E-16, these fourth powers of EPSMCH and 1/EPSMCH will underflow and overflow on such machines as VAXs and PCs, which have a range of only about 1E38, grossly insufficient for scientific computation. For such machines, Brent recommends -increasing the value of EPSMCH. +increasing the value of EPSMCH. EPSMCH=1E-9 or possibly even 1E-8 might be necessary. A better solution would be to eliminate the explicit use of these fourth powers, accomplishing the same result implicitly. -A "bug bounty" of $10 U.S. will be paid by me for the first +A "bug bounty" of $10 U.S. will be paid by me for the first notification of any error in PRAXIS. The same bounty also applies to any substantive poor design choice (having no redeeming advantages whatever) in the FORTRAN @@ -154,7 +154,7 @@ suggested improvements in that will be considered carefully.) praxis.f includes test software to run any of the test problems that Brent ran, and is set to run at least one case of each problem. -I have run these on an IBM 3090, essentially the same +I have run these on an IBM 3090, essentially the same architecture that Brent used, and obtained essentially the same results that Brent shows on pages 140-155. The Hilbert problem with N=12, for which Brent shows no termination results and for which diff --git a/gnuradio-core/src/gen_interpolator_taps/simpson.c b/gnuradio-core/src/gen_interpolator_taps/simpson.c index fc6dd6c27..31aaae4ae 100644 --- a/gnuradio-core/src/gen_interpolator_taps/simpson.c +++ b/gnuradio-core/src/gen_interpolator_taps/simpson.c @@ -18,7 +18,7 @@ * NOR THREAD SAFE! */ -double +double trapzd (double (*func)(double), double a, double b, int n) |