jpvantassel / hvsrpy

A Python package for Horizontal-to-Vertical (H/V, HVSR) Spectral Ratio Processing.
https://pypi.org/project/hvsrpy/
Other
71 stars 29 forks source link

Clarity criteria don't respect the frequency filter range #21

Closed alangi closed 1 year ago

alangi commented 1 year ago

Hi,

It seems that the clarity criteria are not drawing their statistics from between f_range_low and f_range_high.

For example: Criteria iii): Pass A0[f0mc]=3.017 is > 2.0

I got this result when using 3 Hz to 5 Hz. You can see in the image below that this amplitude is almost certainly coming from the large peak that I'm trying to avoid.

image

I haven't check the other criteria so it may be that only the amplitude is an issue.

jpvantassel commented 1 year ago

Hi @alangi,

Can you send the snippet you used to run the SESAME check? The default is:

clarity = utils.sesame_clarity(hv.frq, hv.mean_curve(), hv.std_curve(), hv.std_f0_frq(distribution="normal"), search_limits=(peak_f_lower, peak_f_upper), verbose=1)

which includes peak_f_lower and peak_f_upper as inputs. I am not able to replicate the issue.

Thanks, Joe

alangi commented 1 year ago

Hi @jpvantassel,

Looks like I'm missing part of the code. I've been using and adapting a note book for a long time, so it is probably from before you implimented the peak_f_lower and peak_f_upper code.

Here's what I've been using: clarity = utls.sesame_clarity(hv.frq, hv.mean_curve(), hv.std_curve(), ln_f0_std, verbose=2)

I've made some alterations to use f_low and f_high and it seems to be working okay now.

Thanks