Skip to content

Instantly share code, notes, and snippets.

View VeggieVampire's full-sized avatar

Nick Farrow VeggieVampire

  • n-i-c-k.com
  • The edge of space
View GitHub Profile
import rtlsdr
import numpy as np
from scipy import signal
# Connect to the SDR and configure it
sdr = rtlsdr.RtlSdr()
sdr.sample_rate = 2.4e6 # 2.4 MHz sample rate
sdr.gain = 'auto'
# Define the frequency ranges to scan
import subprocess
import os
import time
import sys
os.system("pkill rtl_fm")
FM_frequency = "103.3e6" #desired FM station
#FM_frequency = sys.argv[1] + "e6"
modulation_mode = "wbfm" #wideband FM
sample_rate = "200000" #lowpass/resample
import pygame
import json
import subprocess
import os
def run_script(button):
os.system("pkill rtl_fm")
command = "rtl_fm -A lut -E deemp -f {} -M {} -s {} -r {} - | ffmpeg -nostats -loglevel quiet -r 200k -f s16le -ar {} -ac 1 -i - -f wav - | aplay -q -t wav > /dev/null 2>&1".format(
button["frequency"], button["modulation_mode"], button["sample_rate"], button["output_rate"], button["output_rate"])
subprocess.Popen(command, shell=True,