import matplotlib.pyplot as plt
import numpy as np
import sk_dsp_comm.sigsys as ss
tx = np.arange(-5,10,.01)
x = ss.rect(tx-2,4) # pulse starts at t = 0
y,ty = ss.conv_integral(x,tx,x,tx)
plt.plot(ty,y) # expect a triangle on [0,8]
plt.show()
#
# Now, consider a pulse convolved with an exponential.
#
h = 4*np.exp(-4*tx)*ss.step(tx)
y,ty = ss.conv_integral(x,tx,h,tx,extent=('f','r')) # note extents set
plt.plot(ty,y) # expect a pulse charge and discharge waveform
