Use numerical integration on specific areas of graph

조회 수: 1 (최근 30일)
Greg
Greg 2022년 8월 7일
댓글: Greg 2022년 8월 9일
Hello
I'm doing some double pulse testing, and I'm trying to post process the results. I can get the rise and fall times of the signal relatively easily from the signal processing add-on, but I am struggling to understand how to calculate the switching losses easily. The graph I end up with for the power loss (voltage*current) is looking like this:
and I would like to integrate the power versus time only in the spots the spikes appear. For example in this region while zooming in :
Right now, I am brushing and exporting data, which I'm sure is inefficient. Does someone know a fast way to achieve these calculations?
Many thanks in advance.
  댓글 수: 7
Walter Roberson
Walter Roberson 2022년 8월 8일
You could take the peak location and search for the first point to the left and right that are <= 0 . But if you have phase on your peaks then it is common for the pulse to go below 0.
If you
outside = find(data <= 0);
before = interp1(outside, outside, PEAK_LOCATIONS, 'prev');
after = interp1(outside, outside, PEAK_LOCATIONS, 'next');
then you can code the searching in a small number of lines.
Greg
Greg 2022년 8월 9일
Thank you @Walter Roberson, This has now been fixed according to your suggestions.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by