Skip to content

Instantly share code, notes, and snippets.

import math
def squares_with_coordinates(d, b, w):
"""
Compute the coordinates of the center of each square inside a circular wafer.
Parameters:
d (float): Wafer diameter in mm
b (float): Border width in mm
w (float): Square size in mm
@davecampbell
davecampbell / waveform.py
Last active May 30, 2019 17:04
visualize audio signal from microphone
import sys
import pyaudio
import struct
import numpy as np
import matplotlib.pyplot as plt
%matplotlib tk
CHUNK = 1024 * 4
FORMAT = pyaudio.paInt16