Fourier Transform and Convolution

Click For Summary
The discussion centers on the convolution of two exponential functions, f(t) = e^(3t) and g(t) = e^(7t), which analytically results in f(t) * g(t) = (1/4)(e^(7t) - e^(3t)). The Convolution Theorem is referenced, indicating that the convolution can also be computed using Fourier Transforms, yet discrepancies arise when implementing this in MATLAB. Users report that the Fourier Transform and the built-in convolution function yield different results, particularly in terms of matrix size and graph accuracy. The conversation also touches on the definition of convolution and the necessity of limiting the functions to avoid divergence in calculations. The importance of adjusting the time step in continuous time signal calculations is also highlighted.
ecastro
Messages
249
Reaction score
8
Considering two functions of ##t##, ##f\left(t\right) = e^{3t}## and ##g\left(t\right) = e^{7t}##, which are to be convolved analytically will result to ##f\left(t\right) \ast g\left(t\right) = \frac{1}{4}\left(e^{7t} - e^{3t}\right)##.

According to a Convolution Theorem, the convolution of two functions can be solved by the use of Fourier Transforms. The theorem states that,

##f\left(t\right) \ast g\left(t\right) = \mathcal{F}^{-1} \left\{\mathcal{F}\left[f\left(t\right)\right] \cdot \mathcal{F}\left[g\left(t\right)\right]\right\}##.

Thus, if I were to transform ##f\left(t\right)## and ##g\left(t\right)##, multiply them per component and take the inverse transform, I should get the same function that was solved analytically. I tried doing this in MatLab, but they're two totally different functions. Also, I tried using MatLab's built-in function for convolution ##\texttt{conv}##, but the resulting size of the matrix is almost twice as large, and the graph is off by several units (although the graph from the Fourier Transform approach and the latter share the same shape). Did I miss anything on why this is so?

Here is my code:
Code:
clear; clc;

t = 0:0.01:1;
y = (1/4).*(exp(7.*t) - exp(3.*t));

f = exp(3.*t); g = exp(7.*t);
F = fft(f); G = fft(g);

FG = ifft(F.*G); FG2 = conv(f, g);
t2 = 0:0.005:1;

The variable ##\texttt{t2}## is for the drawing of the plot of the Fourier Transform approach and the ##\texttt{conv}## approach in the same graph.
 
Physics news on Phys.org
How do you get this
ecastro said:
##f\left(t\right) \ast g\left(t\right) = \frac{1}{4}\left(e^{7t} - e^{3t}\right)##.
?
 
blue_leaf77 said:
How do you get this
?

Replacing ##t## to ##x##, ##f\left(x\right) = e^{3x}## and ##g\left(x\right) = e^{7x}##. The definition of convolution is,

##\begin{eqnarray*}f\left(t\right) \ast g\left(t\right) &=& \int^t_0 f\left(x\right) g\left(t - x\right) dx \\
&=& \int^t_0 e^{3x} e^{7\left(t - x\right)} dx \\
&=& \int^t_0 e^{3x} e^{7t} e^{-7x} dx \\
&=& \int^t_0 e^{-4x} e^{7t} dx \\
&=& e^{7t} \int^t_0 e^{-4x} dx \\
&=& e^{7t} \cdot \left.-\frac{1}{4} e^{-4x}\right|^t_0 \\
&=& e^{7t} \left[-\frac{1}{4} e^{-4t} + \frac{1}{4} e^{-4\left(0\right)}\right] \\
&=& e^{7t} \left[-\frac{1}{4} e^{-4t} + \frac{1}{4}\right] \\
&=& -\frac{1}{4} e^{-4t} e^{7t} + \frac{1}{4} e^{7t} \\
&=& \frac{1}{4} \left(e^{7t} - e^{3t}\right) \end{eqnarray*}##
 
To be honest I have never known the definition of convolution you used there. What I know about a convolution between functions ##f(x)## and ##g(x)## is
$$
[f(x) \ast g(x)](t) = \int_{-\infty}^{\infty} f(x) g(t-x) dx
$$
 
I restricted my function to an extent so that I can compare it with a numerical solution, or this is not the way to compare an analytical and numerical solution?
 
The exponential functions such as those in your example cannot be calculated using computer to begin with. You can try analytically calculate the convolution using the standard definition I wrote in post #4, you will immediately find that the integral diverges at any ##t##.
 
blue_leaf77 said:
The exponential functions such as those in your example cannot be calculated using computer to begin with.

How about the ##\texttt{exp}## function?

blue_leaf77 said:
You can try analytically calculate the convolution using the standard definition I wrote in post #4, you will immediately find that the integral diverges at any ##t##.

Is my approach valid if I let my function ##f\left(t\right)## and ##g\left(t\right)## be equal to zero for ##t > 1## and for ##t < 0##?
 
In addition, I saw this video:


At the middle of the video, he multiplied the result of the convolution with the value of the time step. He mentioned that it is for the calculation of a continuous time signal result. I don't quite understand why it must be so.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 6 ·
Replies
6
Views
3K