Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib as mpl
- from scipy.signal import lfilter
- r = list(map(float, input().split(" ") ))
- n = 0
- z = 0
- x = []
- n = 10 # the larger n is, the smoother curve will be
- b = [1.0 / n] * n
- a = 1
- yy = lfilter(b,a,r)
- yy=list(map(float, yy))
- for i in range(len(yy)):
- if (z > 0):
- z = z - 1
- elif ((yy[i] > 0.3) and (yy[i + 1] < 0.3) or (yy[i] == 0.3) and (yy[i + 1] < 0.3) ):
- n = n + 1
- z = 210
- print(abs(10-n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement