Mathematica: Convolution between Lorentzian and Gaussian

In summary, Mathematica is a software program used for mathematical and scientific computations, data analysis, and visualization. It has a built-in function for performing convolution, which is a mathematical operation that combines two functions to produce a third function that expresses how the shape of one is modified by the other. A Lorentzian function, also known as the Cauchy distribution, is a type of probability distribution commonly used in physics and engineering, while a Gaussian function is a bell-shaped curve widely used in many fields. To perform convolution between these two functions in Mathematica, one can use the built-in function Convolve. The resulting function can have various applications in physics, engineering, and data analysis, such as in spectroscopy, signal processing,
  • #1
Niles
1,866
0
Hi

I have the following code:

Code:
lorentz[A_, Ox_, Oy_, FWHM_, x_] := 
  A (1/3.14) FWHM/((x - Ox)^2 + FWHM^2) + Oy;
gauss[A_, Ox_, Oy_, x_, C_] := A Exp[-(x - Ox)^2 C] + Oy;

Convolve[lorentz[1, 0, 0, 1, x], gauss[1, 0, 0, x, 1], x, y]

It takes extremely long time for this to finish -- is it just an example, where Mathematica is the wrong tool?Niles.
 
Physics news on Phys.org
  • #2
It only takes 15 seconds on my laptop, but the result probably is not what you want:

0.318471 Convolve[1/(1 + x^2), E^-x^2, x, y]

You may want to use ListConvolve and do it numerically.
 
Last edited:

1. What is Mathematica and how is it used for convolution?

Mathematica is a software program used for mathematical and scientific computations, data analysis, and visualization. It has a built-in function for performing convolution, which is a mathematical operation that combines two functions to produce a third function that expresses how the shape of one is modified by the other.

2. What is a Lorentzian function and how does it differ from a Gaussian function?

A Lorentzian function, also known as the Cauchy distribution, is a type of probability distribution that has a long tail and is commonly used to describe phenomena in physics and engineering. A Gaussian function, also known as the normal distribution, is a bell-shaped curve that is widely used to describe natural phenomena in many fields. The main difference between the two is the shape of their curves, with the Lorentzian having a longer tail than the Gaussian.

3. How do I perform convolution between a Lorentzian and Gaussian function in Mathematica?

To perform convolution in Mathematica, you can use the built-in function called Convolve and specify the two functions you want to convolve as arguments. For example, if you have a Lorentzian function f1 and a Gaussian function f2, you can use the syntax Convolve[f1, f2, x, y] to convolve them and get the resulting function y.

4. What are the applications of convolution between Lorentzian and Gaussian functions?

Convolution between Lorentzian and Gaussian functions has various applications in physics, engineering, and data analysis. It is commonly used in spectroscopy to analyze the spectral lines of a substance, in signal processing to filter and analyze signals, and in image processing to enhance and analyze images. It is also used in curve fitting and parameter estimation in statistics and data analysis.

5. Are there any other methods for convolving between Lorentzian and Gaussian functions in Mathematica?

Yes, there are other methods for convolving between Lorentzian and Gaussian functions in Mathematica, such as using the FourierTransform or Integrate functions. These methods may have different advantages and limitations depending on the specific functions and applications. It is recommended to consult the Mathematica documentation or seek assistance from experts for choosing the most appropriate method for your specific needs.

Similar threads

  • Programming and Computer Science
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
957
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
877
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Replies
2
Views
501
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top