Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edy555
edy555 / README.md
Last active December 30, 2016 04:03
OSX patch for RISC-V emulator riscvemu-2016-12-20.1

Build riscvemu on OSX

$ curl -O http://bellard.org/riscvemu/riscvemu-2016-12-20.1.tar.gz
$ tar xfz riscvemu-2016-12-20.1.tar.gz
$ cd riscvemu-2016-12-20.1
$ patch -p0 < ../riscvemu-2016-12-20.1-osx.patch
$ make

Test

@edy555
edy555 / rtlsdr-wbfm-stereo.lua
Created December 3, 2016 01:01
from luaradio.io
local radio = require('radio')
radio.CompositeBlock():connect(
radio.RtlSdrSource(88.5e6 - 250e3, 1102500), -- RTL-SDR source, offset-tuned to 88.5 MHz - 250 kHz
radio.TunerBlock(-250e3, 200e3, 5), -- Translate -250 kHz, filter 200 kHz, decimate 5
radio.FrequencyDiscriminatorBlock(1.25), -- Frequency demodulate with 1.25 modulation index
radio.LowpassFilterBlock(128, 15e3), -- Low-pass filter 15 kHz for L+R audio
radio.FMDeemphasisFilterBlock(75e-6), -- FM de-emphasis filter with 75 uS time constant
radio.DownsamplerBlock(5), -- Downsample by 5
radio.PulseAudioSink(1) -- Play to system audio with PulseAudio
@edy555
edy555 / rtlsdr-wbfm-stereo.lua
Created December 3, 2016 01:01
from luaradio.io
local radio = require('radio')
radio.CompositeBlock():connect(
radio.RtlSdrSource(88.5e6 - 250e3, 1102500), -- RTL-SDR source, offset-tuned to 88.5 MHz - 250 kHz
radio.TunerBlock(-250e3, 200e3, 5), -- Translate -250 kHz, filter 200 kHz, decimate 5
radio.FrequencyDiscriminatorBlock(1.25), -- Frequency demodulate with 1.25 modulation index
radio.LowpassFilterBlock(128, 15e3), -- Low-pass filter 15 kHz for L+R audio
radio.FMDeemphasisFilterBlock(75e-6), -- FM de-emphasis filter with 75 uS time constant
radio.DownsamplerBlock(5), -- Downsample by 5
radio.PulseAudioSink(1) -- Play to system audio with PulseAudio
@edy555
edy555 / si5351.h
Last active September 11, 2016 03:59
Si5351Aで任意の周波数を設定するためのコード。I2C部分は環境に合わせて適当に置き換える必要がある。
#define SI5351_PLL_A 0
#define SI5351_PLL_B 1
#define SI5351_MULTISYNTH_DIV_4 4
#define SI5351_MULTISYNTH_DIV_6 6
#define SI5351_MULTISYNTH_DIV_8 8
#define SI5351_R_DIV_1 (0<<4)
#define SI5351_R_DIV_2 (1<<4)
#define SI5351_R_DIV_4 (2<<4)
#define SI5351_R_DIV_8 (3<<4)
@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")
@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 / RiehmanZetaRecursion.ipynb
Last active May 5, 2024 09:26
今度はリーマンゼータ関数の漸化式での計算をPythonで試してみた。前回のはこちら。http://nbviewer.jupyter.org/gist/edy555/9988efd898d11fba2540
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edy555
edy555 / sketchuplogo.stl
Last active March 12, 2016 12:23
sketchupの練習
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.