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
Click For Summary
SUMMARY

The discussion focuses on using MATLAB to compute the convolution of two step functions, specifically f(t) = u(t) - u(t - 3) and g(t) = u(t) - u(t - 1). The user initially encounters confusion regarding the output of the convolution, which reaches a maximum value of 10 despite the individual functions having maximum values of 1. The resolution involves multiplying the convolution result by the step size (0.1), clarifying that this adjustment is necessary to approximate the integral representation of convolution accurately in MATLAB.

PREREQUISITES
  • Understanding of MATLAB programming and syntax
  • Familiarity with the Heaviside step function
  • Knowledge of convolution operations in signal processing
  • Basic concepts of numerical integration and approximation
NEXT STEPS
  • Explore MATLAB's 'conv' function and its parameters
  • Learn about numerical integration techniques in MATLAB
  • Study the properties of convolution in signal processing
  • Investigate the Heaviside function and its applications in engineering
USEFUL FOR

This discussion is beneficial for students and professionals in engineering, particularly those working with signal processing, MATLAB programming, and numerical methods.

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   Reactions: Les talons

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 11 ·
Replies
11
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 19 ·
Replies
19
Views
30K