How to correct cumtrapz integration constant
3 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I'm trying to find the spectrum of EPR data (eletron paramagnetic resonance) and to do so I have to integrate the data.
The problem is that, when integrating the curb from the left, I would expect to have a peak with two flat border on 0. Whereas, as you can see in the right part of the image, there is a sort of step.
I think this step is due to an integration constant problem, but I couldn't find anywhere a method to correct it. The only way I though is to do minus 4.9 for the right part of the graph, but I'm afraid it would wrong the integration, and that would be bad (because I need to integrate again the spectrum to find the area under the peak of the spectrum).
Could you please help me? Thank you so much for reading it already!
PS: The part of the code where I integrate and plot these images. intensity_c corresponds to the original data with their baseline corrected (so it is all flat and alined in 0, like in the left graph of the image)
figure
plot(field,intensity_c)
grid on
xlabel('field')
ylabel('intensity')
title('Derivated Spectrum')
int_intensity = cumtrapz(field, intensity_c);
figure
plot(field,int_intensity)
xlabel('field')
ylabel('intensity')
grid on
title('Spectrum')
4 件のコメント
Bjorn Gustavsson
2022 年 3 月 29 日
If that is the function of the derivative you can take Torsten's idea in a slightly different direction by fliping the array around the symmetry-point and plot the negative of that just to visually compare the positive and negative peaks to possibly see how "not symmetric" it is.
回答 (1 件)
Elise C
2022 年 3 月 29 日
1 件のコメント
Bjorn Gustavsson
2022 年 3 月 29 日
Good that you solved your problem.
Just 5 mnutes ago I had to explain that in most situations when I have problems I feel a bit stupid, but when I finally solve them I feel some small tingle of achievment, but in computing and computing only I feel stupider and stupider the longer we look for our errors, and then when I solve them I feel really stupid (because the problem was too obvious and the solution to simple). Now I've gotten used to this sequence of events, and my forehead has become strong.
参考
カテゴリ
Help Center および File Exchange で Time Series Events についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!