Skip to content

Commit

Permalink
can get significant range for fourier anplitude
Browse files Browse the repository at this point in the history
  • Loading branch information
millen1m committed Apr 5, 2018
1 parent 30a26bf commit 246dbf1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eqsig/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.13"
__version__ = "0.5.14"
2 changes: 1 addition & 1 deletion eqsig/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from eqsig.single import Signal, AccSignal
from eqsig.single import Signal, AccSignal, significant_range
from eqsig import design_spectra
18 changes: 17 additions & 1 deletion eqsig/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,4 +604,20 @@ def time_indices(npts, dt, start, end, index):
e_index = end
if e_index > npts:
raise exceptions.SignalProcessingWarning("Cut point is greater than time series length")
return s_index, e_index
return s_index, e_index


def significant_range(fas1_smooth, ratio=15): # TODO: move to signalpy
max_fas1 = max(fas1_smooth)
lim_fas = max_fas1 / ratio
min_freq_i = 10000
max_freq_i = 10000
for i in range(len(fas1_smooth)):
if fas1_smooth[i] > lim_fas:
min_freq_i = i
break
for i in range(len(fas1_smooth)):
if fas1_smooth[-1 - i] > lim_fas:
max_freq_i = len(fas1_smooth) - i
break
return min_freq_i, max_freq_i
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
install_requires=[
"numpy",
"scipy",
"matplotlib",
"matplotlib", # to be removed
"bwplot",
"engformat"
],
Expand Down

0 comments on commit 246dbf1

Please sign in to comment.