# How to take the linear convolution of these two signals?

How do I perform the linear convolution of the following two signals? I am having trouble relating $x[n]$ to a series of points, like was given by $h[n]$ below.

$$x[n] = e^{j\pi n}\left\{{u[n]}-u[n-8]\right\}\quad\text{and}\quad h[n] = (-1)^{n}\left\{{u[n]}-u[n-4]\right\}$$

$x[n]$ is a finite-length sinewave of length $L=8$, and $h[n]$ is a causal filter of length $M=4$, expressed as $h[n]=\{1,-1,1,-1\}$.

The solution is: $y[n]=\{1,-2,3,-4,4,-4,4,-4,3,-2,1\}$

For $n = 1\ldots 8$ $$x[n] = e^{j\pi n}\{{u[n]}-u[n-8]\} = (-1)^{n}$$ and for $n = 0\ldots 3$ $$h[n] = (-1)^n$$ Else, if $n > 8$ or $n < 1$, then $x[n] = 0$. Similarly, if $n < 0$ and $n > 3$ then $h[n] = 0$. Using the definition of convolution, $$y[k] =(h * x)[k] = \sum\limits_{m = 0}^3 h[m]x[k-m]$$ For $k = 1$ $$y[1] =(h * x)[1] = h[0]x[1] = 1$$

For $k = 2$ $$y[2] =(h * x)[2] = h[0]x[2] + h[1]x[1] = -1 -1 = -2$$ $\vdots$

For $k = 5$ $$y[5] =(h * x)[5] = h[0]x[5] + h[1]x[4] + h[2]x[3] + h[3]x[4]= 1 +1 + 1 +1 = 4$$ $\vdots$

For $k = 8$ $$y[8] =(h * x)[8] = h[0]x[8] + h[1]x[7] + h[2]x[6] + h[3]x[5]= -1 -1 - 1 -1 = -4$$

$\vdots$

For $k = 11$ $$y[11] =(h * x)[11] = h[0]x[11] + h[1]x[10] + h[2]x[9] + h[3]x[8]= 0 + 0 + 0 + 1 = 1$$

• P.S: This is the easy way. Another possible way is to make use of the convolutions of shifted versions of the step function $u[n]$. – Ahmad Bazzi Nov 21 '16 at 20:36