discret convolution works!
x: h: Share Link
x | x<0 | 0 | x>0 | x<0 | 0 | 1 | 2 | 3 | 4 | 5 | x>0 | |
x[n] | 0 | 0 | 0 | h[n] | 0 | 1 | -1 | 0 | 0 | -1 | 1 | 0 |
This returns the convolution at each point of overlap, with an output shape of (N+M-1,). At the end-points of the convolution, the signals do not overlap completely, and boundary effects may be seen. x*h=sum(x[m]*h[n-m])
Mode ‘valid’ returns output of length max(M, N) - min(M, N) + 1. The convolution product is only given for points where the signals overlap completely. Values outside the signal boundary have no effect.
conv1([0] , [1,-1,0,0,-1,1])=[0,0,0,0,0,0]
y[0]=x[0]*h[0](0) =0
y[1]=x[0]*h[1](0) + x[1]*h[0](0) =0
y[2]=x[0]*h[2](0) + x[1]*h[1](0) + x[2]*h[0](0) =0
y[3]=x[0]*h[3](0) + x[1]*h[2](0) + x[2]*h[1](0) + x[3]*h[0](0) =0
y[4]=x[0]*h[4](0) + x[1]*h[3](0) + x[2]*h[2](0) + x[3]*h[1](0) + x[4]*h[0](0) =0
y[5]=x[0]*h[5](0) + x[1]*h[4](0) + x[2]*h[3](0) + x[3]*h[2](0) + x[4]*h[1](0) + x[5]*h[0](0) =0