Skip to content

Instantly share code, notes, and snippets.

View peter-grajcar's full-sized avatar
🐶
Haf haf

Peter Grajcar /ˈpɛtɛr ˈɡrajʦar/ peter-grajcar

🐶
Haf haf
View GitHub Profile
@peter-grajcar
peter-grajcar / snr.py
Last active March 23, 2025 13:59 — forked from johnmeade/snr.py
WADA SNR Estimation of Speech Signals in Python
#!/usr/bin/env python3
import numpy as np
# next 2 lines define a fancy curve derived from a gamma distribution -- see paper
db_vals = np.arange(-20, 101)
g_vals = np.array([0.40974774, 0.40986926, 0.40998566, 0.40969089, 0.40986186, 0.40999006, 0.41027138, 0.41052627, 0.41101024, 0.41143264, 0.41231718, 0.41337272, 0.41526426, 0.4178192 , 0.42077252, 0.42452799, 0.42918886, 0.43510373, 0.44234195, 0.45161485, 0.46221153, 0.47491647, 0.48883809, 0.50509236, 0.52353709, 0.54372088, 0.56532427, 0.58847532, 0.61346212, 0.63954496, 0.66750818, 0.69583724, 0.72454762, 0.75414799, 0.78323148, 0.81240985, 0.84219775, 0.87166406, 0.90030504, 0.92880418, 0.95655449, 0.9835349 , 1.01047155, 1.0362095 , 1.06136425, 1.08579312, 1.1094819 , 1.13277995, 1.15472826, 1.17627308, 1.19703503, 1.21671694, 1.23535898, 1.25364313, 1.27103891, 1.28718029, 1.30302865, 1.31839527, 1.33294817, 1.34700935, 1.3605727 , 1.37345513, 1.38577122, 1.39733504, 1.40856397, 1.41959619, 1.42983624, 1.43958467, 1.44902176, 1.45804831, 1.4666956
#!/usr/bin/env python3
from PIL import Image, ImageDraw, ImageChops
import numpy as np
import colorsys
def distinct_colours(n):
return [colorsys.hsv_to_rgb(i / (n - 1), 1, 1) for i in range(n)]
def in_bounds(point, bounds):
x, y = point
@peter-grajcar
peter-grajcar / NOTES.md
Last active February 5, 2021 15:45
Linux Admin

Linux Administration

RAUTR

quemu start script

#!/bin/bash

qemu-system-x86_64 \
#!/usr/bin/env python3
import numpy as np
from PIL import Image, ImageDraw
import plotly.graph_objects as go
def molleweide_to_equirectagular():
"""
converts Mollweide projection image to equirectangular projection
"""