Skip to content

Instantly share code, notes, and snippets.

@justinhou95
Created March 1, 2022 15:52
Show Gist options
  • Save justinhou95/b1cc7fe52ce0b3a963f7e1fcf59dfa11 to your computer and use it in GitHub Desktop.
Save justinhou95/b1cc7fe52ce0b3a963f7e1fcf59dfa11 to your computer and use it in GitHub Desktop.
import numpy as np
from scipy.interpolate import BPoly
import matplotlib.pyplot as plt
def ber_approx(f,N):
x_grid = np.linspace(0,1,N+1)
y_grid = f(x_grid)
bp = BPoly(y_grid[:,None], [0, 1])
return bp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment