Component convolution#

This example illustrates the convolution steps in the implementation of convolution in model fitting.

import hyperspy.api as hs
import numpy as np

from hyperspy.misc.axis_tools import calculate_convolution1D_axis

Create a signal containing a Lorentzian peak:

Signal

Create a second signal, for example a detector response:

Signal

Create the “convolution axis” which adds the necessary padding:

Extend the data over the full range of the “convolution axis” and take the convolution with g_signal:

Display the comparison of both signals:

model convolution steps
<Axes: xlabel='<undefined> (<undefined>)', ylabel='Intensity'>

Total running time of the script: (0 minutes 0.701 seconds)

Gallery generated by Sphinx-Gallery