Skip to content

Instantly share code, notes, and snippets.

@edy555
edy555 / rtlfmsdr.py
Last active January 14, 2023 01:20
Python based FM Receiver -- Experiment of Realtime Signal Processing in Python
#!/usr/bin/env python
#
# RTL FM Receiver - Python based realtime RF signal processing experiment
# @edy555 2016
# requirement: numpy, scipy, pyaudio, pyrtlsdr
import numpy as np
import scipy.signal
import array
import rtlsdr
@edy555
edy555 / adf4351usb.py
Created October 2, 2013 17:46
Control script to configure Analog Devices ADF4351 via USB HID
#!/usr/bin/env python
import hid
import math
verbose = False
class ADF4351:
DIV1 = 0
DIV2 = 1
DIV4 = 2
@edy555
edy555 / plotdata.py
Created September 3, 2016 03:18
NanoVNAのテスト用コード。シリアル経由でデータを取ってきて、波形とスペクトラムをプロット。
#!/usr/bin/env python
import serial
import numpy as np
import pylab as pl
dev = '/dev/cu.usbmodem401'
ser = serial.Serial(dev)
def fetch_data():
ser.write("data 0\r")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edy555
edy555 / mikuplot.py
Created May 3, 2013 03:31
plotting hatsune-miku with matplotlib original source of formula from http://www.wolframalpha.com/input/?i=graph+Hatsune+miku+curve
#!/usr/bin/env python
from pylab import *
# source: http://www.wolframalpha.com/input/?i=graph+Hatsune+miku+curve
# ignore "RuntimeWarning: invalid value encountered in sqrt"
seterr(all='ignore')
# heaviside function
def theta(x):
@edy555
edy555 / miku-scope.py
Last active January 8, 2019 12:48
This script draws hatsune miku in your oscilloscope via audio output. requirement: python, numpy, pyaudio YouTube: http://youtu.be/3iCEyhPH608
#!/usr/bin/env python
from numpy import sin,sign,pi,sqrt
import numpy as np
import pyaudio
import array
# generation function derived from WolframAlpha
# http://www.wolframalpha.com/input/?i=graph+Hatsune+miku+curve
# ignore "RuntimeWarning: invalid value encountered in sqrt"
@edy555
edy555 / cmuhardcopy.py
Last active June 2, 2018 17:09
Script to transfer file of hardcopy from R&S CMU200 and format conversion. Requires python-ivi package and wmf2png optionally.
#!/usr/bin/env python
import ivi
import sys
import os
import os.path
from optparse import OptionParser
p = OptionParser()
p.add_option('-v', '--verbose', dest="verbose", action='store_true',
help="print verbose.")
p.add_option('-d', '--device', dest="device", metavar="DEV",
@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 / blink.py
Created November 12, 2012 16:33
blink led using FT232RL bitbang mode with pylibftdi and python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.