Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
muma
TM
Commits
2c57c0bb
Commit
2c57c0bb
authored
8 years ago
by
Marcus Herrmann
Browse files
Options
Downloads
Patches
Plain Diff
Improving pseudo-highpass filtering
(only used in post-precessing for determining max. amplitudes)
parent
e0e3d616
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
TM/waveformops.py
+19
-8
19 additions, 8 deletions
TM/waveformops.py
with
19 additions
and
8 deletions
TM/waveformops.py
+
19
−
8
View file @
2c57c0bb
...
...
@@ -532,22 +532,33 @@ def _waveform_processing_trace(trace, resampling, procType='bandpass', freqMax=N
# We filter first, and then re/downsample;
# This costs more performance (more to filter), but the data will be represented "better"
trace
.
filter
(
"
bandpass
"
,
freqmin
=
config
.
filtConf
[
0
],
freqmax
=
config
.
filtConf
[
1
],
corners
=
config
.
filtConf
[
2
])
if
procType
==
'
bandpass
'
and
config
.
FFT_filt
is
False
:
corners
=
config
.
filtConf
[
2
]
zerophase
=
False
if
zerophase
:
corners
=
corners
//
2
trace
.
filter
(
"
bandpass
"
,
freqmin
=
config
.
filtConf
[
0
],
freqmax
=
config
.
filtConf
[
1
],
corners
=
corners
,
zerophase
=
zerophase
)
elif
procType
==
'
highpass
'
:
trace
.
filter
(
"
highpass
"
,
freq
=
1.0
)
# If maximum freq specified, apply also a low-pass filter
# (to remove too-high frequencies that disturb the amplitude comparison)
if
freqMax
:
if
not
freqMax
:
trace
.
filter
(
"
highpass
"
,
freq
=
1.0
)
# 4th order
else
:
# If maximum freq specified, apply a bandpass filter
# (to remove too-high frequencies that disturb the amplitude comparison)
# Determine lowest senseful frequency
# (at max, only up to Nyquist of original signal, or
# if signal will be resampled below/equal Nyquist freq, take the new sampling rate)
freqmax
=
min
(
resampling
if
resampling
else
float
(
'
Inf
'
),
# New sampling freq
trace
.
stats
.
sampling_rate
//
2
,
# Nyguist freq
trace
.
stats
.
sampling_rate
//
2
,
# Nyguist freq
freqMax
)
# Specified max. freq
trace
.
filter
(
"
low
pass
"
,
freq
=
freqmax
)
trace
.
filter
(
"
band
pass
"
,
freq
min
=
1.0
,
freqmax
=
freqmax
)
# 4th order
# Apply 50Hz bandSTOP filter if configured
if
config
.
stop50Hz
and
config
.
FFT_filt
is
False
:
...
...
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