Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattjmorrison/863217 to your computer and use it in GitHub Desktop.
Save mattjmorrison/863217 to your computer and use it in GitHub Desktop.
def haar(x, y):
average = (x + y) / 2
width = (x - y) / 2
return average, width
def wavelet(signal):
a, b, c, d = signal
a, b, c, d = haar(a, b) + haar(c, d)
a, c = haar(a, c)
return a, b, c, d
signal = (20, 24, 22, 26)
print(wavelet(signal))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment