Skip to content

Instantly share code, notes, and snippets.

View tspspi's full-sized avatar

tspspi

View GitHub Profile
@tspspi
tspspi / characterizs.py
Created March 2, 2023 13:17
Fitting function for QUAK/ESR bias amplifiers
import matplotlib.pyplot as plt
import numpy as np
import sys
from time import sleep
from pymso5000.mso5000 import MSO5000
from pyka3005p.ka3005pserial import KA3005PSerial
scanchannel = 2
@tspspi
tspspi / serdeshelper.h
Last active February 1, 2023 05:01
Floats in C: Simple binary serialization and deserialization of IEEE754 floats independent of architecture
#ifndef __is_included__F0CBD5F3_AC0B_4F2F_9137_1D3A922083A7
#define __is_included__F0CBD5F3_AC0B_4F2F_9137_1D3A922083A7 1
/*
Requires stdint.h and math.h
*/
/*
IEEE 754 Floats (Single):
All Bits 1+r+p 32 Bit
@tspspi
tspspi / udpmcasttest.py
Created November 6, 2022 01:30
UDP communications and multicast in Python (simple blocking sample)
# The same exampel as udptest.py but transmitting
# and receiving from a multicast group
UDP_IP = "239.0.0.16"
UDP_PORT = 1234
if len(sys.argv) < 2:
print("Missing mode")
sys.exit(1)
@tspspi
tspspi / Thermal noise.ipynb
Created June 15, 2022 14:01
Thermal noise calculation for QUAK/ESR
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tspspi
tspspi / simpleoaallan.py
Created June 14, 2022 14:06
Simple Allan deviation in time domain
# Simple and direct overlapping Allan deviation
# for stability analysis in time domain (i.e. "phase" samples)
def overlappingAlanDeviationTimeDomain(timestamps, samples, overlapWindowSize = 2):
oadev = []
taus = []
tau0 = (timestamps[len(timestamps)-1] - timestamps[0]) / (len(timestamps))
for nLimit in range(2*overlapWindowSize, len(timestamps)):
tau = tau0 * nLimit
@tspspi
tspspi / README.md
Created November 7, 2019 18:36
Fetch or pull all own github repositories

What is this

This is a short script that uses a personal access token from a github account (created via Profile > Settings > Developer Settings > Personal Access Tokens) that fetches a list of all repositories owned by a given user and either clones them into the current directory - or if they exist performs a pull.

The script puts all repositories in directories relative

@tspspi
tspspi / krylovlinear01.ipynb
Last active March 21, 2022 10:56
Steepest descent, Conjugate gradinet and Generalized minimal residual
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tspspi
tspspi / qrdecomposition.ipynb
Created March 12, 2022 21:03
Basics-QR decomposition using Givens rotations
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tspspi
tspspi / leastsquares.ipynb
Last active March 21, 2022 10:55
Basics-Least squares using QR decomposition
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.