cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Convolution of two Spectra.

KhemAcharya
1-Newbie

Convolution of two Spectra.

I want to convolute two absorption spectra (x, y data). Do anyone have any idea ? I would be grateful.

Thanks, Khem

3 REPLIES 3
RichardJ
19-Tanzanite
(To:KhemAcharya)

If you have the signal processing pack (help, E-books) look for the convol function.

In an attachment an example taken from "Signal Processing" (section "SECTION 1 - SIGNALS AND SYSTEMS. Convolution and Correlation") extension pack for Mathcad.

Pic_1.png

The Fourier transform of a convolution of two functions is the product of their individual Fourier Transforms. So, one can calculate the convolution by two FFT calls and one Inverse FFT call of a vector whose elements are the products of the corresponding elements of the FFT of the first vector and the FFT of the second.

Some things to watch for. You want to use a vectorized product of the vector (or use a range variable to do each element). If you simply take the product of the two vectors you will get the scaler product, which you don't want.

The discrete FFT that Mathcad does implicitly assumes that the functions are periodic with a period equal to the lenght of the vectors, so the convolution could have specious "wrap around" contributions near the ends.

The method requires that the two vectors have the same number of elements.

It is way more efficient (and thus faster) if you have vectors of 2^N elements

For years I used this method to calculate Voigt Profiles (convoluton of Gaussian and Lorentzian) until Mathcad allowed you to use complex arguments of the error function.

Announcements

Top Tags