This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am jfsantos on github. | |
* I am jfsantos (https://keybase.io/jfsantos) on keybase. | |
* I have a public key whose fingerprint is C422 70CC D7E3 C653 09B0 E52E 06AF B67E AD5E 95E5 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using WAV | |
function inline_audioplayer(filepath) | |
markup = """<audio controls="controls" {autoplay}> | |
<source src="$filepath" /> | |
Your browser does not support the audio element. | |
</audio>""" | |
display(MIME("text/html") ,markup) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import wave | |
import numpy as np | |
import scipy as sp | |
WINSIZE=8192 | |
sound='sound.wav' | |
def read_signal(filename, winsize): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "<string>", line 1, in <module> | |
File "/private/var/folders/z3/s0__77pd3n1bpym4f75hrzbc0000gn/T/pip_build_jfsantos/music21/setup.py", line 65, in <module> | |
include_package_data=True, | |
File "/Users/jfsantos/anaconda/envs/py3/lib/python3.3/distutils/core.py", line 148, in setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gammatone.fftweight import fft_gtgram | |
from scipy.io.matlab import loadmat | |
s = loadmat("test.mat")["s"][:,0] | |
fs = 16000 | |
# gt_py has 260 frames | |
gt_py = fft_gtgram(s, fs, 0.010, 0.0025, 23, 125) | |
# gt_mat has 269 frames |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV["MOCHA_USE_CUDA"] = "true" | |
using HDF5, JLD, Mocha | |
X = Array[] | |
push!(X, rand(Float32, 128,11*129,1,1)) | |
y = Array[] | |
push!(y, rand(Float32, 128, 129, 1, 1)) | |
#data_layer = AsyncHDF5DataLayer("train", "train.txt", 128, 1000, [:features, :targets], false, []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.signal as sig | |
from adaptfilt import lms | |
if __name__ == '__main__': | |
import matplotlib.pyplot as plt | |
from scipy.io import wavfile | |
sigma = 0.1 | |
order = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
import h5py, numpy | |
class HDF5Matrix: | |
refs = defaultdict(int) | |
def __init__(self, datapath, dataset, start, end, normalizer=None): | |
if datapath not in self.refs.keys(): | |
f = h5py.File(datapath) | |
self.refs[datapath] = f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
x = np.random.rand(513) | |
# Converting to the frequency domain | |
X = np.fft.rfft(x) | |
# Taking the log of the magnitude and converting back to rectangular | |
def P2R(magnitude, phase): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fAed cBAG|BBBB gBeB|d2 BD E2 cB|[1cBAF G2 Bc:|[2B2 Bd e3G| | |
dcde fab2|afef g2 fg|affe fedB|GEDB E3 :| |