Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Duncan Macleod
gstlal
Commits
c3dcbb1c
Commit
c3dcbb1c
authored
7 years ago
by
Aaron Viets
Browse files
Options
Downloads
Patches
Plain Diff
calibration_parts.py: New function compute_rms to compute root mean square amplitude of a signal.
parent
ca2ff0fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-calibration/python/calibration_parts.py
+26
-2
26 additions, 2 deletions
gstlal-calibration/python/calibration_parts.py
with
26 additions
and
2 deletions
gstlal-calibration/python/calibration_parts.py
+
26
−
2
View file @
c3dcbb1c
...
...
@@ -222,10 +222,10 @@ def remove_lines_with_witness(pipeline, signal, witness, freq, caps, filter_leng
# Find transfer function between witness channel and signal at this frequency
tf_at_f
=
complex_division
(
pipeline
,
line_in_signal
,
line_in_witness
)
# Remove worthless data from computation of transfer function if we can
if
obsready
:
if
obsready
is
not
None
:
tf_at_f
=
mkgate
(
pipeline
,
tf_at_f
,
obsready
,
1
,
attack_length
=
-
integration_samples
)
# Take a running median and average of transfer function
tf_at_f
=
pipeparts
.
mkgeneric
(
pipeline
,
tf_at_f
,
"
lal_smoothkappas
"
,
default_kappa_re
=
0
,
array_size
=
N_median
,
avg_array_size
=
N_avg
)
tf_at_f
=
pipeparts
.
mkgeneric
(
pipeline
,
tf_at_f
,
"
lal_smoothkappas
"
,
default_kappa_re
=
0
,
array_size
=
N_median
,
avg_array_size
=
N_avg
,
default_to_median
=
True
)
# Use gated, averaged transfer function to reconstruct the sinusoid as it appears in the signal from the witness channel
reconstructed_line_at_signal
=
mkmultiplier
(
pipeline
,
list_srcs
(
tf_at_f
,
line_in_witness
))
...
...
@@ -331,6 +331,30 @@ def bandstop(pipeline, head, rate, length = 1.0, f_low = 100, f_high = 400):
# Now apply the filter
return
pipeparts
.
mkfirbank
(
pipeline
,
head
,
latency
=
int
(
length
-
1
),
fir_matrix
=
[
bandstop
],
time_domain
=
True
)
def
compute_rms
(
pipeline
,
head
,
rate
,
average_time
,
f_min
=
None
,
f_max
=
None
,
zero_latency
=
True
,
rate_out
=
16
):
# Find the root mean square amplitude of a signal between two frequencies
# Downsample to save computational cost
head
=
mkresample
(
pipeline
,
head
,
5
,
zero_latency
,
"
audio/x-raw,rate=%d
"
%
rate
)
# Remove any frequency content we don't care about
if
(
f_min
is
not
None
)
and
(
f_max
is
not
None
):
head
=
bandpass
(
pipeline
,
head
,
rate
,
f_low
=
f_min
,
f_high
=
f_max
)
elif
f_min
is
not
None
:
head
=
highpass
(
pipeline
,
head
,
fcut
=
f_min
)
elif
f_max
is
not
None
:
head
=
lowpass
(
pipeline
,
head
,
fcut
=
f_max
)
# Square it
head
=
pipeparts
.
mkpow
(
pipeline
,
head
,
exponent
=
2.0
)
# Downsample again to save computational cost
head
=
mkresample
(
pipeline
,
head
,
3
,
zero_latency
,
"
audio/x-raw,rate=%d
"
%
rate_out
)
# Compute running average
head
=
pipeparts
.
mkgeneric
(
pipeline
,
head
,
"
lal_smoothkappas
"
,
default_kappa_re
=
0.0
,
array_size
=
1
,
avg_array_size
=
average_time
*
rate_out
)
return
head
#
# Calibration factor related functions
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment