Skip to content

Instantly share code, notes, and snippets.

View hadmack's full-sized avatar

Mike Hadmack hadmack

  • Oceanit
  • Honolulu, HI
View GitHub Profile
@hadmack
hadmack / gist:1e794472fc7b09aa3f1d2f38030c6025
Created September 14, 2017 20:20
Implicit copy of a global array in a function
# Interesting note on modifying globals in a function
a = np.zeros(5)
a[0] = 5
print(a)
def f():
b = a
b = b[::-1]
#a = a[::-1] # this will fail with local undefined error
return b
@hadmack
hadmack / plot_spectrogram.py
Created June 23, 2017 20:56
Python Spectral Analysis
'''
Plot the spectrogram (amplitude vs freq vs time plot) of a time series
'''
from matplotlib import pyplot as plt
import numpy as np
from scipy import signal
# Load or generate some data
y = np.random.normal(size=23000)
fs = 44000 # sample rate
@hadmack
hadmack / README.md
Created July 21, 2016 01:52
ASCII spinner sequences
@hadmack
hadmack / README.md
Last active July 19, 2016 21:38
ASCII Escaped Progress Indicators