Signal integration

Topics related to Spinach package
Post Reply
faq_user
Posts: 49
Joined: Tue Jul 13, 2021 8:33 am

Signal integration

Post by faq_user »

I started using your amazing program spinach for simulating PHIP spectra. Everything is working fine, but I got stuck at one point. I don’t know whether it is due to my lack of knowledge of Matlab or spinach itself. However, my aim is to determine the individual integrals or peak heights of the antiphase spectra. For that I would like to extract either the signal function or its FT in order to go on working with it.
kuprov
Posts: 201
Joined: Mon Mar 29, 2021 4:26 pm

Re: Signal integration

Post by kuprov »

To integrate the peaks, it is probably best to use Matlab’s built-in trapz() function – it calculates numerical integrals using the trapezium method. Plot your spectrum without the axis, i.e.

plot(real(spectrum))

This will make Matlab use point numbers as the axis. Find out what the integration interval is, for example from point A to point B, then call

trapz(real(spectrum(A:B)))

That would give you the integral.
Post Reply