Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Leo Pound Singer
lalsuite
Commits
898b2668
Commit
898b2668
authored
Aug 11, 2020
by
Leo Pound Singer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor out window size
parent
e4c06433
Pipeline
#146924
failed with stages
in 124 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
lal/lib/tools/TriggerInterpolate.c
lal/lib/tools/TriggerInterpolate.c
+19
-6
No files found.
lal/lib/tools/TriggerInterpolate.c
View file @
898b2668
...
...
@@ -32,6 +32,8 @@
#include <lal/TriggerInterpolate.h>
#define STRINGIZE(s) #s
/*
* General functions
...
...
@@ -237,14 +239,19 @@ static int poly_fit(double *a, size_t na, const double *x, const double *y, size
*/
#define CUBIC_SPLINE_WINDOW_SIZE 2
int
XLALTriggerInterpolateCubicSpline
(
double
*
t
,
double
complex
*
y
,
const
double
complex
*
data
,
unsigned
int
window
)
{
if
(
window
<
2
)
GSL_ERROR
(
"Window size must be >= 2"
,
GSL_EINVAL
);
if
(
window
<
CUBIC_SPLINE_WINDOW_SIZE
)
GSL_ERROR
(
"Window size must be >= "
STRINGIZE
(
CUBIC_SPLINE_WINDOW_SIZE
),
GSL_EINVAL
);
int
result
;
...
...
@@ -323,12 +330,18 @@ int XLALTriggerInterpolateCubicSplineAmpPhase(
const
double
complex
*
data
,
unsigned
int
window
)
{
if
(
window
<
2
)
GSL_ERROR
(
"Window size must be >= 2"
,
GSL_EINVAL
);
if
(
window
<
CUBIC_SPLINE_WINDOW_SIZE
)
GSL_ERROR
(
"Window size must be >= "
STRINGIZE
(
CUBIC_SPLINE_WINDOW_SIZE
),
GSL_EINVAL
);
double
amps
[
5
],
args
[
5
];
double
amps
[
2
*
CUBIC_SPLINE_WINDOW_SIZE
+
1
];
double
args
[
2
*
CUBIC_SPLINE_WINDOW_SIZE
+
1
];
double
t_max
,
amp_max
,
arg_max
;
cabs_carg_unwrapped
(
amps
,
args
,
data
-
2
,
5
);
cabs_carg_unwrapped
(
amps
,
args
,
data
-
CUBIC_SPLINE_WINDOW_SIZE
,
2
*
CUBIC_SPLINE_WINDOW_SIZE
+
1
);
/* Find which among samples -1, 0, +1 has the maximum amplitude. */
t_max
=
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment