Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

convolution Problem

Status
Not open for further replies.

MrYu

New Member
evaluate y(n)= x(n) * h(n) where x(n) and h(n) are sequences show below

View attachment 66388

do i need to multiply the value of h(n) to x(n) and shift the h(n) to the right 1,2,3 and so on?
 
Hi,

Here's how the calculation goes. For each n you do this:

y[n]=sum[m= -inf to +inf] x[m]*h[n-m]

so this means you're doing a bunch of regular multiplications and summing the results for that n.
With finite sequences you can simplify the right hand side because any x or h amplitude that is zero results in a product that is zero so it doesnt affect the sum.
 
Last edited:
Because x(n) is a sequence of 1,1,1,1 then in the example you give, y(n)=h(n).
i.e you are sampling h(n) at a period of x(n) which at the sampling period is always 1.
More to do with sampling and multiplication than convolution.

Sampling is a multiplication process involving multiplying the incoming signal by either 1 or 0.
 
Because x(n) is a sequence of 1,1,1,1 then in the example you give, y(n)=h(n).
i.e you are sampling h(n) at a period of x(n) which at the sampling period is always 1.
More to do with sampling and multiplication than convolution.

Sampling is a multiplication process involving multiplying the incoming signal by either 1 or 0.


Hi WTP,

I think you should take another look at this. The result is certainly not y[n]=h[n]. That could only occur if x[n] was the sampling function:
x[0]=1
x[1]=0
x[2]=0
x[3]=0
etc.,
which shows only x[0] as being equal to 1 and all the rest from -inf to +inf are equal to zero. That is the so called "Sampling Function".
With more than one value for the x sequence we'll see an actual convolution where x must be convolved with h and that involves a sum which here results in various sums of a variable number of samples of h (see previous post).

Notice how close his h[n] resemble the impulse function for an RC network. You can liken this example to an RC network being driven by a voltage pulse and taking the result from across the cap. The output is definitely NOT the same as the impulse response. The only way to get that is to drive the network with an impulse, and note that the discrete equivalent is not an x with several values not equal to zero, but only one value not equal to zero.

So the resulting sequence will look like (but not exactly equal to) a sampled RC low pass filter driven by a pulse, which results in a waveform that looks sort of like an ocean wave just before it crashes into the shore: it will rise up as a concave downward curve, and fall downward as a concave upward curve if we were to connect the top of all the resulting samples with lines.
 
Last edited:
Hi WTP,

I think you should take another look at this. The result is certainly not y[n]=h[n]. That could only occur if x[n] was the sampling function:
x[0]=1
x[1]=0
x[2]=0
x[3]=0
etc.,
which shows only x[0] as being equal to 1 and all the rest from -inf to +inf are equal to zero. That is the so called "Sampling Function".
With more than one value for the x sequence we'll see an actual convolution where x must be convolved with h and that involves a sum which here results in various sums of a variable number of samples of h (see previous post).

Notice how close his h[n] resemble the impulse function for an RC network. You can liken this example to an RC network being driven by a voltage pulse and taking the result from across the cap. The output is definitely NOT the same as the impulse response. The only way to get that is to drive the network with an impulse, and note that the discrete equivalent is not an x with several values not equal to zero, but only one value not equal to zero.

So the resulting sequence will look like (but not exactly equal to) a sampled RC low pass filter driven by a pulse, which results in a waveform that looks sort of like an ocean wave just before it crashes into the shore: it will rise up as a concave downward curve, and fall downward as a concave upward curve if we were to connect the top of all the resulting samples with lines.

No. Outside the sampling period nothing is considered. That's why it's called sampling and in the real world is known as "Sample & Hold". During the hold period what happens is ignored.
x(n)=1 from period 1 to 3 given the information posted.
Where did you get
x[1]=0
x[2]=0
x[3]=0
Certainly not from what I see.
It does not matter what is the sampling function as the sampling is multiplication.
3 x 2 = 2 x 3.
x(n) * h(n) = h(n) * x(n)
 
No. Outside the sampling period nothing is considered. That's why it's called sampling and in the real world is known as "Sample & Hold". During the hold period what happens is ignored.
x(n)=1 from period 1 to 3 given the information posted.
Where did you get
x[1]=0
x[2]=0
x[3]=0
Certainly not from what I see.
It does not matter what is the sampling function as the sampling is multiplication.
3 x 2 = 2 x 3.
x(n) * h(n) = h(n) * x(n)


Hi,

Yeah you arent reading my post carefully enough otherwise you would know what was meant by making x[1] through x[3] equal to zero.

What you are stating is the result can only be obtained if x is the sampling function (look that up) and his x is NOT the sampling function. Certainly x has four values and even though they are the same there are still four values to consider and you havent dont that.

The correct answer looks like a pulse driving a low pass RC filter with a sampled output instead of continuous. It's not exactly the same but it is very close because his h is very close to the low pass filters impulse response. It is certainly not the same as y.

Remember that for *each n* we have to do a summation of products. So if you still dont agree then show your summation of products next and show how you can get the yn you are trying to say is the correct yn.
 
Last edited:
Where did you get that picture from?
h * 1 is h.
Where does the slow ramp of x * h come from and the slow decay of x * h when x=1?

"The correct answer looks like a pulse driving a low pass RC filter with a sampled output instead of continuous". But it isn't
 
Where did you get that picture from?
h * 1 is h.
Where does the slow ramp of x * h come from and the slow decay of x * h when x=1?

"The correct answer looks like a pulse driving a low pass RC filter with a sampled output instead of continuous". But it isn't


Hi again,


Well if you are going to insist that the output does not look like what i said it should, then i will have to insist that you show your work in it's entirety. What you are doing is using ONE value of the whole 'pulse' of x (x has four values, not just one even though the amplitudes are the same) and that kind of x is called the "Sampling Function" and that gives the result y[n]=h[n]. But when x has more than one value (this problem has 4 not 1) we have to do a full convolution which results in x sweeping across h and the sums are the areas that it sweeps out. So what happens is first we get a smallish area, then the area grows, but then as x starts to pass h that area becomes smaller and smaller, and looking at the whole process results in a wave that looks like an RC filter excited by a pulse, the pulse being x.
If the RC filter was excited by an impulse, then we would see the y[n]=h[n], but x is not an impulse (looking at it in the continuous time domain).

That picture was modified from Wikipedia...modified because the one on Wiki was too small to properly view and it used other variable names. Wikipedia does give a nice visual animated gif for convolution which shows a pulse exciting an RC low pass filter. The RC low pass filter impulse response looks almost like the ramp we are using in the problem at hand except the RC droops where the ramp doesnt, but we get similar results from both (although not exactly the same).
 
MrAl is correct. Modern mathematical packages often have convolution as a built-in function. For example, the attached image shows the convolution as performed by Mathematica.

As MrAl explains, x can be thought of as a signal, a square pulse in this case, and h can be thought of as the impulse response of some filter. Then the convolution is the result of applying the input pulse to the filter.

Another interpretation is that of a running average. In this case, h can be thought of as a time series, a set of data points. x is the list of weights and the result of the convolution is a running average of four equally weighted data points per average.
 

Attachments

  • Resp.png
    Resp.png
    8 KB · Views: 279
Hi,

I have also solved the problem and I got exactly the same as what "The Electrician" has in his post.

1 2 3 4 5 6

6
5+6
4+5+6
3+4+5+6
2+3+4+5
1+2+3+4
1+2+3
1+2
1

However, although I know how to solve this, I realize that our teacher failed to actually explain what the applications are in electronic systems. It would be more interesting and easy to grasp I think if students know those things. Kindly explain in a student level the applications please.

Thank you.
 
Hi,

I have also solved the problem and I got exactly the same as what "The Electrician" has in his post.

1 2 3 4 5 6

6
5+6
4+5+6
3+4+5+6
2+3+4+5
1+2+3+4
1+2+3
1+2
1

However, although I know how to solve this, I realize that our teacher failed to actually explain what the applications are in electronic systems. It would be more interesting and easy to grasp I think if students know those things. Kindly explain in a student level the applications please.

Thank you.

Hi,

The applications for this kind of thing are very far reaching. From DSP filtering in general to picture enhancement to things you might not think would benefit from a filter of some type like when copying files from one location to another on the PC. For example if you go to copy 10000 files you get a progress bar that shows how far the copying process is which gives a rough idea how much longer it will take, and even possibly a clock that counts down to indicate how long it will take to finish. But the files are seldom all the same size and disk idiosyncrasies make the timing impossible to predict with precision and this causes the remaining time readout to vary up and down quite wildly if it is not tamed with a low pass filter. This kind of low pass filter would be another form of a digital filter.
 
Download this

Hola MrYu

Google and download this book. The best teaching book ever The scientist and Engineer's guide to Digital Signal Processing

Take the time to read it in the pertinent section.

I read it in full. Made clear many points to me.
 
Hi again,


In a nutshell here it is:

[LATEX]

\displaystyle {y}_{n}=\[\sum_ {m=-\infty } ^{\infty } \ {x}_{m}\,{h}_{n-m}\]

[/LATEX]

and with finite sequences this simplifies a little to:

[LATEX]

\displaystyle {y}_{n}=\[\sum_{m=m1}^{m2}{x}_{m}\,{h}_{n-m}\]

[/LATEX]

where m1 and m2 are chosen outside of where any product is non zero.
 
Last edited:
Hi MrAl,

Somehow I got an idea on how convolution works.
I think teachers should make it a point to give us students at least an idea about the topics before jumping on to the mathematical computations.
It would build the foundation of INTEREST and things will come easy and then easier as we go on along with the discussions.

Thank you for the reply.

meowth08
 
Hi,

Yes it is nice to know what this can be used for as that provides a little more motivation for wanting to learn it. It's pretty cool the way it works too once you get to know it. Same with continuous convolution which i believe is taught first these days.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top