필터 지우기
필터 지우기

how to superimpose peak intensities

조회 수: 3 (최근 30일)
Kun Yan
Kun Yan 2021년 3월 18일
편집: Drishan Poovaya 2021년 3월 23일
How to superimpose the peak intensities of multiple peaks in the spectrum to obtain an envelope?

답변 (1개)

Drishan Poovaya
Drishan Poovaya 2021년 3월 23일
편집: Drishan Poovaya 2021년 3월 23일
I understand that you want to find an envelope for all the peak values of different curves. Looking at the image you shared, I assume each curve only has one peak value.
First, you can obtain the location and height of all your peaks and store them in an array.
For example:
[peakYCoords(1),peakXCoords(1)] = findpeaks(y,x);
Say all your peak values are in vector peakYCoords and their corresponding locations are in vector peakXCoords, you can use polyfit and polyval functions to fit a curve to these points, which would act as an envelope
Choose the value of n depending on the number of curves. See the documentation for polyfit for more details.
p = polyfit(peakXCoords, peakYCoords, n);
v = polyval(p, t);
plot(t, v)
Another alternative is to use the envelope function

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by