# Discrete convolution.

Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last
• August 14th 2010, 02:00 PM
SanMiguel
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.
• August 14th 2010, 02:35 PM
yeKciM
Quote:

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 :D:D:D:D

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 :D
• August 15th 2010, 12:42 PM
SanMiguel
Not really sure what your asking but, yes I know what an impulse signal is. Not really sure how to draw it.
• August 15th 2010, 02:21 PM
yeKciM
okay :D
impulse signal is defined so it's one in n=0 and zero elsewhere :D so if you have convolution of any signal with impulse signal it will be that same signal but just in place of impulse signal :D

if let's say your impulse signal is shifted left or right... let's say to n=2 meaning that delta signal is $\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 $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 :D, and another signal move from $-\infty$ to $+\infty$) and calculate when they overlap... no need to calculate where one of those two are zero :D :D:D:D

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 :D

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

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 :D:D:D)

try :D

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

sorry fot that delta(t) , instead of every "t" on the drawing it should say "n" :D sorry again
• August 15th 2010, 03:49 PM
yeKciM
here is one quick example of periodical discrete convolution :D

let's say we have

$x_p[k]=k$ for $0

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

with $K_0=4$ which is basic period :D:D:D

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

this is calculating part :D

$\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 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 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 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 $x_p[m]\cdot h_p[2-m]$ and it should say $x_p[m]\cdot h_p[3-m]$ sorry :D

there's example of discrete convolution, but if you notice this example is periodical discrete convolution, something like problem that you have :D:D:D:D
• August 16th 2010, 08:04 AM
SanMiguel
$\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 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 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 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?
• August 16th 2010, 08:54 AM
yeKciM
Quote:

Originally Posted by SanMiguel
$\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 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 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 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 ) :D:D:D

your convolution have bigger period :D show what have you done there :D
• August 16th 2010, 02:37 PM
SanMiguel
Im afraid im still a bit lost with this
• August 16th 2010, 02:42 PM
yeKciM
Quote:

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 :D 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:D but i'm willing to help you understand it in your head :D:D:D:D
• August 17th 2010, 07:23 AM
SanMiguel
Maybe if you could do the first bit I could pick it up from there, hopefully.
• August 17th 2010, 01:25 PM
yeKciM
Quote:

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) :D:D:D

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

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

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

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

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

now after that said, let's do one :D (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 :D:D:D:D )

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

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

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

so we have convolution (discrete convolution) :

$\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 :D:D:D

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 $x[k]$ and $h[k]$ to $x[m]$ and $h[m]$ and sketch how they look like (yours have just values "1" and "-1" not like this one )

Attachment 18646

there you have how do they look :D

now we will decide which one will we move ? (doesn't matter which one you chose) I'll put $x[m]$ to be stationary and flip $h[m]$ to $h[-m]$ (meaning that any value for $h[2]$ will be now in the $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 $h[-m]$ and shifted $h[k-m]$ will look like this :D:D

Attachment 18645

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

Attachment 18644

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

now you have solution :

$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.$
• August 17th 2010, 02:31 PM
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.
• August 17th 2010, 11:40 PM
yeKciM
Quote:

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 :D:D:D:D

show what you have done....
• August 20th 2010, 05:13 AM
SanMiguel
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.
• August 20th 2010, 09:49 AM
yeKciM
yes your are going really good :D

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

your solutions will be in interval from $y[0]$ to $y[12]$ because from $y[0]$ to $y[6]$ your let's say "h" will be entering in "x" so at $y[6]$ he will be overlap totally :D but then he starts to exiting so you have six more :D:D:D:D
Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last