8000 SNR Taper Adjustment by joelridden · Pull Request #182 · ucgmsim/IM_calculation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

SNR Taper Adjustment #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

SNR Taper Adjustment #182

wants to merge 2 commits into from

Conversation

joelridden
Copy link
Contributor

Simpler approach to solving an issue with double tapers on SNR and the impacts of tapering at tp.
Now we adjust the signal window to include some of the noise, but only parts that actually will be dampened out by the taper of 5%.
Was going to add tests to ensure that we don't taper the value at tp, but would require returning the snr_signal values which is too much extra work, so instead added an assert which will do the same.

@@ -80,27 +77,32 @@ def calculate_snr(
ValueError
If the noise duration is less than 1s and so SNR can't be computed.
"""
# This extra time is to ensure that when a taper is applied, the signal part of the waveform
# is not affected by the tapering. The tapering is applied to the signal and noise separately.
tp_extra = 20 * waveform[:, tp:].shape[1] / 19 - waveform[:, tp:].shape[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit clearer IMO if you factor and then convert to decmals

tp_extra = 20 * nt / 19 - nt
              = (20 / 19 - 1) * nt
              = nt / 19
              or
              ~ 0.0526 * nt

Did you maybe mean 0.05 * nt?

Suggested change
tp_extra = 20 * waveform[:, tp:].shape[1] / 19 - waveform[:, tp:].shape[1]
tp_extra = waveform[:, tp:].shape[1] / 19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0