Skip to content

Instantly share code, notes, and snippets.

View musteresel's full-sized avatar

Daniel Jour musteresel

View GitHub Profile
@jeanminet
jeanminet / pulse_density_modulation.py
Created September 27, 2016 19:03
Simple simulation of pulse density modulator
import numpy as np
import matplotlib.pyplot as plt
def pdm(x):
n = len(x)
y = np.zeros(n)
error = np.zeros(n+1)
for i in range(n):
y[i] = 1 if x[i] >= error[i] else 0
error[i+1] = y[i] - x[i] + error[i]
self: super:
{
# Install overlay:
# $ mkdir -p ~/.config/nixpkgs/overlays
# $ curl https://gist.githubusercontent.com/LnL7/570349866bb69467d0caf5cb175faa74/raw/3f3d53fe8e8713ee321ee894ecf76edbcb0b3711/lnl-overlay.nix -o ~/.config/nixpkgs/overlays/lnl.nix
userPackages = super.userPackages or {} // {
# Example:
hello = self.hello;