Skip to content

Instantly share code, notes, and snippets.

View dos1's full-sized avatar

Sebastian Krzyszkowiak dos1

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dos1 on github.
  • I am dos1 (https://keybase.io/dos1) on keybase.
  • I have a public key whose fingerprint is 22DD 9FAE 006A 1143 5836 617C E8F2 35CF 3BDB C3FF

To claim this, I am signing this object:

@dos1
dos1 / gist:27580fc0ffb94ecad333
Created January 30, 2015 17:39
Gender recognition
#!/usr/bin/env python
import sys, wave, numpy, struct
wav = wave.open(sys.argv[1], "r")
(nchannels, sampwidth, rate, nframes, comptype, compname) = wav.getparams()
frames = wav.readframes(nframes * nchannels)
out = struct.unpack_from("%dh" % nframes * nchannels, frames)
signal = numpy.array(out if nchannels == 1 else list([(out[i]+out[i+1])/2 for i in range(0, len(out), 2)]))[::4]
amplitude = abs(numpy.fft.fft(signal))
freq = numpy.linspace(0, rate / 4, len(amplitude))
zipped = filter(lambda x: 85 <= x[0] <= 250, zip(freq, amplitude))
@dos1
dos1 / robot.js
Created December 4, 2012 21:40
dos
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
robots = {}
angles = {}
wyczajony = {}