Skip to content

Instantly share code, notes, and snippets.

View amicuscertus's full-sized avatar
🌴
On vacation

Amicus Certus amicuscertus

🌴
On vacation
View GitHub Profile
/*
* owondump.c 0.3 A userspace USB driver that interrogates an Owon
* PDS digital oscilloscope and gets it to dump its trace memory for all
* channels, in both vectorgram format, and/or in .BMP bitmap format.
*
* The vectorgram is also parsed into a tabulated
* text format that can be plotted using GNUplot or a similar package.
*
* The code now has an elegant decodeTimebase
* function, courtesy of Michel Poullet!
% R
> data=read.csv("data.csv", header=F, sep="")
> plot(data$V1, data$V2, col='#0000ff80', pch=16, tck=1, xlim=c(-30,20), ylim=c(-30,20), xlab='Station1 SNR [dB]', ylab='Station2 SNR [dB]', main='10MHz non-JA stations')
> hist(data$V1-data$V2, col="#00ff8f80", breaks=seq(-25.5,25,1), main='10MHz non-JA stations', xlab='SNR(1)-SNR(2) [dB]')
> curve(dnorm(x,0,3)*190, add=TRUE, col='blue', lwd=2)
import re
import datetime
fnames = ['station1.adif', 'station2.adif']
def parse_adif(fn):
raw = re.split('<eor>|<eoh>',open(fn).read() )
raw.pop(0)
raw.pop()
logbook =[]
import re
import datetime
fnames = ['station1.adif', 'station2.adif']
def parse_adif(fn):
raw = re.split('<eor>|<eoh>',open(fn).read() )
raw.pop(0)
raw.pop()
logbook =[]
import socket
import numpy as np
import pyaudio
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
p = pyaudio.PyAudio()
import socket
import numpy as np
import matplotlib.pyplot as plt
CHUNK = 1000
NMAX = 20
x = range (CHUNK)
y = np.zeros(CHUNK)
xpnt = 0
n = 0
% python3 gqrxUdp.py > test.dat
% gnuplot
gnuplot> plot "test.dat" with line
import struct
UDP_IP = "127.0.0.1"
UDP_PORT = 7355 # 4379 for WSJT-X, 7355 for Gqrx
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((UDP_IP, UDP_PORT))
while True:
data, addr = sock.recvfrom(512)
ldata = len(data)
% python3 gqrxUdp.py
received message: b'V\xd9\xd6\xda\x84\xdc^\xdek...
received message: b'}0p)&!\xdd\x17\xde\rz\x03\x00\...
received message: b'\xc4\xfa\x15\xff;\x032\x07\xfb...
@amicuscertus
amicuscertus / gqrxUdp.py
Created June 3, 2018 08:39
receive UDO audio stream from Gqrx
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 7355 # 4379 for WSJT-X, 7355 for Gqrx
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((UDP_IP, UDP_PORT))
while True:
data, addr = sock.recvfrom(1024)