Skip to content

Instantly share code, notes, and snippets.

@ozansener
Last active June 22, 2016 23:31
Show Gist options
  • Save ozansener/cecb8a967a875d99d52d0b0a95598055 to your computer and use it in GitHub Desktop.
Save ozansener/cecb8a967a875d99d52d0b0a95598055 to your computer and use it in GitHub Desktop.
import numpy
def get_turn_off(alpha):
cycle_cnt = (numpy.log(0.4) / numpy.log(1 - alpha) )
return (cycle_cnt * 50)/ (1000 * 60)
def get_alpha_from_cut_off(cut_off):
alpha = 1 - numpy.exp(numpy.log(0.1) / ((float(cut_off) * 60 * 1000) / float(50)))
return alpha
cut_off = 10
alpha = get_alpha_from_cut_off(cut_off)
print get_turn_off(alpha)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment