1. ## Discrete convolution.

First of all sorry if this is in the wrong forum.

Yes I understand its will be a long answer so send me a pm if necessary.

2. Originally Posted by SanMiguel
First of all sorry if this is in the wrong forum.

Yes I understand its will be a long answer so send me a pm if necessary.
discrete convolution is much easier (as for math calculation) than another types (like convolution of analog signals), but when you have convolution of discrete signals it's just multiplication of two signals

now i assume that you know what is impulse signal ? do you know how to draw that you wrote up there (signals) ? we will start from there

3. Not really sure what your asking but, yes I know what an impulse signal is. Not really sure how to draw it.

4. okay
impulse signal is defined so it's one in n=0 and zero elsewhere so if you have convolution of any signal with impulse signal it will be that same signal but just in place of impulse signal

if let's say your impulse signal is shifted left or right... let's say to n=2 meaning that delta signal is $\displaystyle \delta [n-2]$ then convolution of any signal x[n] with that impulse signal is going to be that signal but in n=2 , meaning it will be $\displaystyle x[n-2]$... (i hope you can conclude how that works)

convolution can be done by putting one (usually more complex signal) at the spot, so you don't move that one nowhere , and another signal move from $\displaystyle -\infty$ to $\displaystyle +\infty$) and calculate when they overlap... no need to calculate where one of those two are zero

i see you have there formula for discrete convolution here are that impulse signal and response of filter on impulse signal, and of course x[n] for which you need to calculate convolution

do you have idea how to start ? (it's better to understand it, no use if i put all calculation )

Hint: maybe you know maybe you don't but when shifting one signal, it's shifted for integer (that's one thing which is easier with discrete convolution, you have here sum of products, but in convolution of analog signals you have to solve a lot of integrals )

try

P.S. you don't need to draw this but i did it so you can see what that convolution actually do
that what you have there is periodical discrete convolution

sorry fot that delta(t) , instead of every "t" on the drawing it should say "n" sorry again

5. here is one quick example of periodical discrete convolution

let's say we have

$\displaystyle x_p[k]=k$ for $\displaystyle 0<k<3$

$\displaystyle h_p[k]=1$ for $\displaystyle k=0,1$
$\displaystyle h_p[k]=-1$ for $\displaystyle k=2,3$

with $\displaystyle K_0=4$ which is basic period

first look at the sequences $\displaystyle x_p[m]$ we will put stationary. $\displaystyle h_p[m]$ we will be moving so we need to draw $\displaystyle h_p[-m]$ and then move that sequence from left to right and at the end you see result as $\displaystyle y[m]$ and $\displaystyle y_p[m]$

this is calculating part

$\displaystyle \displaystyle y[0]=\sum_{m=0} ^3 x[m]h \cdot [-m]=x[0] \cdot h[1]+x[1] \cdot h[-1]+x[2] \cdot h[-1] +x[3] \cdot h[1]=0$

$\displaystyle \displaystyle y[1]=\sum_{m=0} ^3 x[m]h \cdot [1-m]=x[0] \cdot h[1]+x[1] \cdot h[1]+x[2] \cdot h[-1] +x[3] \cdot h[-1]=-4$

$\displaystyle \displaystyle y[2]=\sum_{m=0} ^3 x[m]h \cdot [2-m]=x[0] \cdot h[-1]+x[1] \cdot h[1]+x[2] \cdot h[1] +x[3] \cdot h[-1]=0$

$\displaystyle \displaystyle y[3]=\sum_{m=0} ^3 x[m]h \cdot [3-m]=x[0] \cdot h[-1]+x[1] \cdot h[-1]+x[2] \cdot h[1] +x[3] \cdot h[1]=4$

sorry for graph 7 it says $\displaystyle x_p[m]\cdot h_p[2-m]$ and it should say $\displaystyle x_p[m]\cdot h_p[3-m]$ sorry

there's example of discrete convolution, but if you notice this example is periodical discrete convolution, something like problem that you have

6. $\displaystyle \displaystyle y[0]=\sum_{m=0} ^3 x[m]h \cdot [-m]=x[0] \cdot h[1]+x[1] \cdot h[-1]+x[2] \cdot h[-1] +x[3] \cdot h[1]=0$

$\displaystyle \displaystyle y[1]=\sum_{m=0} ^3 x[m]h \cdot [1-m]=x[0] \cdot h[1]+x[1] \cdot h[1]+x[2] \cdot h[-1] +x[3] \cdot h[-1]=-4$

$\displaystyle \displaystyle y[2]=\sum_{m=0} ^3 x[m]h \cdot [2-m]=x[0] \cdot h[-1]+x[1] \cdot h[1]+x[2] \cdot h[1] +x[3] \cdot h[-1]=0$

$\displaystyle \displaystyle y[3]=\sum_{m=0} ^3 x[m]h \cdot [3-m]=x[0] \cdot h[-1]+x[1] \cdot h[-1]+x[2] \cdot h[1] +x[3] \cdot h[1]=4$

So is this the answer then? Should there not be y4 and y5 etc?

7. Originally Posted by SanMiguel
$\displaystyle \displaystyle y[0]=\sum_{m=0} ^3 x[m]h \cdot [-m]=x[0] \cdot h[1]+x[1] \cdot h[-1]+x[2] \cdot h[-1] +x[3] \cdot h[1]=0$

$\displaystyle \displaystyle y[1]=\sum_{m=0} ^3 x[m]h \cdot [1-m]=x[0] \cdot h[1]+x[1] \cdot h[1]+x[2] \cdot h[-1] +x[3] \cdot h[-1]=-4$

$\displaystyle \displaystyle y[2]=\sum_{m=0} ^3 x[m]h \cdot [2-m]=x[0] \cdot h[-1]+x[1] \cdot h[1]+x[2] \cdot h[1] +x[3] \cdot h[-1]=0$

$\displaystyle \displaystyle y[3]=\sum_{m=0} ^3 x[m]h \cdot [3-m]=x[0] \cdot h[-1]+x[1] \cdot h[-1]+x[2] \cdot h[1] +x[3] \cdot h[1]=4$

So is this the answer then? Should there not be y4 and y5 etc?

that is for my example that i give there and no there is no need for calculating for y4,y5 ... because your basic period is 4... and as any periodical function, it repeat it self afterwards for any mK (where m is any positive integer,and K basic period )

your convolution have bigger period show what have you done there

8. Im afraid im still a bit lost with this

9. Originally Posted by SanMiguel
Im afraid im still a bit lost with this
that there what i have done calculating is just example (not based on your values) so you can do yours and post it, and say (if there is) where is the problem that you have where do you get lost ?

P.S. i can do one more example more similar to your problem (of convolution two sequences that are not periodical ) i'm not going to do yours but i'm willing to help you understand it in your head

10. Maybe if you could do the first bit I could pick it up from there, hopefully.

11. Originally Posted by SanMiguel
Maybe if you could do the first bit I could pick it up from there, hopefully.
first of all you must know something about discrete convolution (convolution sum)

$\displaystyle x[k]*h[k]=h[k]*x[k]$

$\displaystyle x[k]*(h_1[k]+h_2[k])=x[k]h_1[k]+x[k]h_2[k]$

$\displaystyle x[k]*(h_1[k]*h_2[k])=(x[k]*h_1[k])*h_2[k]$

$\displaystyle x[k]*h[k]=y[k] \Rightarrowx[k-m]*h[k-n]=y[k-m-n]$

$\displaystyle x[k]*\delta [k] = x[k] \Rightarrow x[k]*\delta [k-m] = x[k-m]$

now after that said, let's do one (not that which you have to do, but it's the same as that one, just smaller and you can pick up from there... yours can be done at the same way but that will you do and we will see did you get it right )

we have two sequences (finite) and we have to calculate convolution of those two sequences... sequences are :

$\displaystyle x[k]=\left\{\begin{matrix} 2 &,\; 0\le k \le 2\\ 0 &,\; elsewhere \end{matrix}\right.$

$\displaystyle h[k]=\left\{\begin{matrix} k+1&,\; 0\le k \le 4\\ 0&,\; elsewhere \end{matrix}\right.$

so we have convolution (discrete convolution) :

$\displaystyle \displaystayle y[n]= \sum _{k=0} ^{N-1} h_k x_{n-k} = \sum _{k=0} ^{N-1} x_k h_{n-k}$

as you see it's the same. never mind which one you will move

first step (i'll again do it like that one before so you can see what and why is that like it is) you will change $\displaystyle x[k]$ and $\displaystyle h[k]$ to $\displaystyle x[m]$ and $\displaystyle h[m]$ and sketch how they look like (yours have just values "1" and "-1" not like this one )

there you have how do they look

now we will decide which one will we move ? (doesn't matter which one you chose) I'll put $\displaystyle x[m]$ to be stationary and flip $\displaystyle h[m]$ to $\displaystyle h[-m]$ (meaning that any value for $\displaystyle h[2]$ will be now in the $\displaystyle h[-2]$ and so on... ) now we will move that sequence for chosen value of "k". in this case it's k=3... (that's something you must know from theoretical knowledge )after doing that $\displaystyle h[-m]$ and shifted $\displaystyle h[k-m]$ will look like this

third step is represents multiplying sequences $\displaystyle x[m]h[k-m]$ and calculating sum $\displaystyle \displaystayle \sum _{m= -\infty} ^{+\infty} x[m] h[k-m]$ product of that is given on the next image

- overlapping sequences $\displaystyle x[m]$ and $\displaystyle h[k-m]$, will be different for different values of $\displaystyle k$.
- sequences will not overlap for $\displaystyle k<0$
- all products for $\displaystyle k<0$ will be zero. overlap begins for $\displaystyle k=2$, and for $\displaystyle 0\le k \le 2$ we have partially overlapping of sequences.

for $\displaystyle 0\le k \le 2$ convolution sum is :

$\displaystyle y[k]=\displaystyle \sum_{m=0} ^k x[m]h[k-m] = \sum_{m=0} ^k 2\cdot h[k-m+1]$
$\displaystyle \displaystayle =2(k+1) \sum_{m=0} ^k 1 - 2\sum_{m=0} ^k m$

$\displaystyle \displaystayle = 2(k+1)^2 - 2\sum_{m=0} ^k m$

$\displaystyle \displaystayle = 2(k+1)^2 - 2 \frac {k(k+1)}{2}$

$\displaystyle \displaystayle =k^2+3k+2$

if we now increase "k" so $\displaystyle 2\le k \le 4$ and we have

$\displaystyle y[k]=\displaystyle \sum_{m=0} ^2 x[m]h[k-m] =\sum_{m=0} ^2 2(k-m+1)$

$\displaystyle \displaystayle = 2(k+1) \sum_{m=0} ^2 1 - 2 \sum_{m=0} ^2 m$

$\displaystyle \displaystayle = 6(k+1)-6 = 6k$

more increasing of "k" we will have $\displaystyle 5\le k \le 6$

$\displaystyle \displaystayle y[k] = \sum_{m=k-4} ^2 x[m]h[k-m] =\sum_{m=k-4} ^2 2(k-m+1)$

$\displaystyle \displaystayle =2(k+1) \sum_{m=k-4} ^2 1 -2\sum_{m=k-4} ^2 m$

$\displaystyle \displaystayle =2(k+1)(7-k) -(7-k)(k-2) = -k^2 +3k+28$

for $\displaystyle k>6$ there is no overlapping so $\displaystyle y[k]=0$

now you have solution :

$\displaystyle y[k] = \left\{\begin{matrix} 0 &, \;\; k<0\\ k^2+3k+2&, \;\; 0\le k \le 2\\ 6k&, \;\; 2\le k \le 4\\ -k^2+3k+17& , \;\; 5\le k \le 6 \\ 0 & , \;\; k>6 \end{matrix}\right.$

12. Yes I have an example similar to yours with the answer. The main problem is how I use my numbers (+1, -1 ect) in it. So if I was to know the first line, I would propably be able to do it.

13. Originally Posted by SanMiguel
Yes I have an example similar to yours with the answer. The main problem is how I use my numbers (+1, -1 ect) in it. So if I was to know the first line, I would propably be able to do it.
hm... how does it's "main problem" is using "your" numbers (+1 and -1 ) ?!?!?!?!?!
On two examples i showed to you principles of how do you do discrete convolution. I don't see how can it be any (much) different, yes it's different your problem is much easier

show what you have done....

14. ok, Ive had a go. I did it on a word document and cant get it on here so I will just put the basics so you can understand them.

y0=h0x0

y0=1

________

y1=h0x1+h1x0

y1= (+1*+1) + (+1*-1)

y1=0

________

y2= h0x2+h1x1+h2x2

y2= (+1*-1) + (+1*+1)+(+1*-1)

y2= -1

________

k 0 1 2 3 4 5 6
hk +1 +1 +1 -1 -1 +1 -1
xk -1 +1 -1 -1 +1 +1 +1

Got my values from the table I made above

only done the first 3 values of y as I wasnt sure I was doing it right. Am I?

If it makes it easier I could email you the word document?

I couldn't get on this website yesterday for some reason.

Ps. I really need the answer to this by Sunday at the latest.

15. yes your are going really good

$\displaystyle y[0] = -1$
$\displaystyle y[1] = 0$
$\displaystyle y[2]= -1$
$\displaystyle y[3] = 0$
$\displaystyle y[4] = -1$
$\displaystyle y[5] = 0$
............

your solutions will be in interval from $\displaystyle y[0]$ to $\displaystyle y[12]$ because from $\displaystyle y[0]$ to $\displaystyle y[6]$ your let's say "h" will be entering in "x" so at $\displaystyle y[6]$ he will be overlap totally but then he starts to exiting so you have six more

Page 1 of 2 12 Last