Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Series
- a = {1,2,3,4,5,6}
- top=5
- What I need
- sum = 1*6 + 2*5 + 3*4
- ---
- Definition of discrete convolution
- (f*g)[n] = SUM[k=-inf..+inf] f(k)*g(k-n)
- So,
- (a*a)[top] = a(0)*(5) + a(1)*a(4) + a(2)*a(3) + a(3)*a(2) + a(4)*a(1) + a(5)*a(0)
- = 1*6 + 2*5 + 3*4 + 4*3 + 5*2 + 6*1
- Dividing by :2 gives the desired result
- (a*a)[top] / 2 = 1*6 + 2*5 + 3*4
Add Comment
Please, Sign In to add comment