Skip to content

Instantly share code, notes, and snippets.

@edy555
edy555 / sna-test.py
Created November 25, 2013 15:58
trial to build sna with rtl2832u dongle and pll synthesizer
#!/usr/bin/env python
from adf4351usb import ADF4351
import numpy as np
import rtlsdr
import time
import matplotlib.pyplot as plt
import scipy.fftpack as sf
#start = 390e6
@edy555
edy555 / hdr.py
Created February 13, 2014 14:53
append header onto binary file for writing dfu-util
#!/usr/bin/env python
import struct
import sys
fin = open(sys.argv[1], 'rb')
fout = open(sys.argv[2], 'wb')
bin = fin.read()
fin.close()
@edy555
edy555 / cictest-mod.py
Last active October 12, 2017 17:13
simulating CIC filter and modified one in python
#!/usr/bin/env python
import numpy as np
from pylab import *
x = np.random.randn(65536)
m=16
d0 = [0] * m
d1 = [0] * m
d2 = [0] * m
@edy555
edy555 / gen-rainbow.py
Created September 16, 2014 15:35
Generate rainbow shape as voxel in json for VoxelEditor https://github.com/perfume-dev/VoxelEditor
#!/usr/bin/env python
import json
import colorsys
import math
def hsv(h, s, v):
r, g, b = colorsys.hsv_to_rgb(h, s, v)
return (int(r*255)*256 + int(g*255))*256 + int(b*255)
arr = []
@edy555
edy555 / spectrum.py
Last active August 29, 2015 14:09
Sound Spectrum Display using Laser Projector and OpenLASE
#!/usr/bin/env python
import pyaudio
import pylase as ol
import numpy as np
import sys
import threading
chunk = 1024
#chunk = 2048
CHANNELS = 2
@edy555
edy555 / pickit3-osx10.9.txt
Created November 27, 2014 23:57
PICkit3 system_profiler SPUSBDataType on Marvericks
PICkit 3:
Product ID: 0x900a
Vendor ID: 0x04d8 (Microchip Technology Inc.)
Version: 0.02
Serial Number: DEFAULT_PK3
Speed: Up to 12 Mb/sec
Manufacturer: Microchip Technology Inc.
Location ID: 0xfd120000 / 4
Current Available (mA): 500
@edy555
edy555 / blink.html
Created December 2, 2014 06:00
FlashAirでLチカ4種類。html+javascript, python, ruby, shell script http://youtu.be/GXY_FRvI-vY
@edy555
edy555 / fmpi.c
Created March 31, 2015 22:45
old source code of fmpi.co for raspi fm tx hack
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <math.h>
#include <fcntl.h>
#include <assert.h>
#include <malloc.h>
#include <sys/mman.h>
#include <sys/types.h>
@edy555
edy555 / RiemannZeta.ipynb
Created June 2, 2015 21:51
ゼータ関数を描いてみたipython notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edy555
edy555 / gpsdo-dac-control-snippet.c
Last active October 12, 2015 06:14
GPSのPPS信号でOCXOの周波数調整をDACで制御するための適応フィードバックの実装抜粋。see http://ttrftech.tumblr.com/post/131004700971/
short phase_err;
short phase_err_int;
short duration_count;
short duration_exp;
#define REFERENCE 10000000L
static void
dac_control_init()
{