OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
savgol.h
Go to the documentation of this file.
1 /* savgol.h
2  Savitzky-Golay Smoothing Filters
3 
4  Project: Beam Envelope Tracker (BET)
5 
6  Revision history
7  Date Description Programmer
8  ------------ -------------------------------------------- --------------
9  09-03-06 Created Rene Bakker
10 
11  Last Revision:
12  $Id: savgol.h 29 2007-04-14 17:03:18Z l_bakker $
13 */
14 
15 
16 #ifndef _SAVGOL_DEF
17 #define _SAVGOL_DEF
18 
19 
20 
21 /* savgol()
22  Returns in c[1..np]
23  consistent with the argument respns in
24  routine convlv, a set of Savitzky-Golay filter coefficients.
25  nl is the number of leftward (past) data points used, while
26  nr is the number of rightward (future) data points, making
27  the total number of data points used nl+nr+1.
28  ld is the order of the derivative desired
29  (e.g., ld = 0 for smoothed function).
30  m is the order of the smoothing polynomial,
31  also equal to the highest conserved moment;
32  usual values are m = 2 or m = 4.
33 */
34 void savgol(
35  double *, // c (data array)
36  int, // number of points [0..np-1]
37  int, int, // nl, nr,
38  int, int); // ld, m
39 
40 
41 /* convlv()
42  Convolves or deconvolves a real data set data[1..n] (including any
43  user-supplied zero padding) with a response function respns[1..n].
44  The response function must be stored in wrap-around order in the
45  first m elements of respns, where m is an odd integer <=n. Wrap-
46  around order means that the first half of the array respns contains
47  the impulse response function at positive times, while the second
48  half of the array contains the impulse response function at negative
49  times, counting down from the highest element respns[m]. On input
50  isign is +1 for convolution, -1 for deconvolution. The answer is
51  returned in the first n components of ans. However, ans must be
52  supplied in the calling program with dimensions [1..2*n], for
53  consistency with twofft. n MUST be an integer power of two.
54 */
55 void convlv(
56  double *, //data[],
57  int, // n,
58  double *, //respns[]
59  int, // m,
60  int, // isign,
61  double *); // ans[]
62 
63 
64 /* sgSmooth()
65  Smoothes c[0..n-1] using a Savitzky-Golay filter.
66  nl is the number of leftward (past) data points used, while
67  nr is the number of rightward (future) data points, making
68  the total number of data points used nl+nr+1.
69  ld is the order of the derivative desired
70  (e.g., ld = 0 for smoothed function).
71  m is the order of the smoothing polynomial,
72  also equal to the highest conserved moment;
73  usual values are m = 2 or m = 4.
74 */
75 void sgSmooth(
76  double *, // c (data array)
77  int, // number of points [0..n-1]
78  int, int, // nl, nr,
79  int, int); // ld, m
80 
81 #endif
void sgSmooth(double *c, int n, int nl, int nr, int ld, int m)
Definition: savgol.cpp:457
void savgol(double c[], int np, int nl, int nr, int ld, int m)
Definition: savgol.cpp:206
void convlv(double data[], int n, double respns[], int m, int isign, double ans[])
Definition: savgol.cpp:406