MATLAB Convolution: Finding the Convolution of Two Functions with Step Inputs

  • Thread starter Thread starter Les talons
  • Start date Start date
  • Tags Tags
    Convolution Matlab
Les talons
Messages
28
Reaction score
0

Homework Statement


Use MATLAB to find the convolution between
a) ##f(t) = u(t) -u(t -3)## and ##g(t) = u(t) -u(t -1)##

Homework Equations



The Attempt at a Solution


t = -10: 0.1: 10;
f = heavisde(t) -heaviside(t -3);
g = heaviside(t) -heaviside(t -1);
t = -20: 0.1: 20;
c = conv(f, g);
plot(t, c)

The graph of the convolution has values from 0 to 10. I don't get how the convolution can get to 10 if the functions being convolved only have maximum values of 1. I changed the line to
c = 0.1*conv(f, g);
and this produced the right output. Why do I need to multiply by the step size?
 
Physics news on Phys.org
Convolution is a sum over element-wise products. To turn this into the equivalent approximation for the integral, you have to multiply by the step size. Think about the rectangular area. Matlab applies the linear algebra definition of convolution.
 
  • Like
Likes Les talons
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...

Similar threads

Replies
12
Views
2K
Replies
11
Views
7K
Replies
23
Views
3K
Replies
2
Views
1K
Replies
5
Views
980
Replies
3
Views
5K
Replies
19
Views
29K
Back
Top