import numpy as np
import matplotlib.pyplot as plt

x=np.linspace(0,4*np.pi,1000)
e = np.sin(x)+0.2*np.sin(10*x)

plt.plot(x,e)
plt.show()

fc=7
w0=2*np.pi*fc
dt = w0/(np.pi*1000)

s=np.empty_like(e)
s[0]=0

for n in range (1,len(e)):
    s[n]=s[n-1]*(1-w0*dt)+e[n]-e[n-1]
plt.plot(x,s)
plt.show()