필터 지우기
필터 지우기

Finding local minima for a signal

조회 수: 95 (최근 30일)
neamah al-naffakh
neamah al-naffakh 2016년 8월 8일
댓글: Med Aymane Ahajjam 2019년 1월 27일
I have used the (findpeaks) function in Matlab in order to find the locations and the value of the peaks ( Local Maxima ) in the signal.
please, Is there any function to extract the local minimums of the following graph?

채택된 답변

Walter Roberson
Walter Roberson 2016년 8월 8일
If you have a routine that can find local maxima, then to find local minima, apply the local maxima routine to the negative of the data. Like
findpeaks(-X_Segments{nn},'MinPeakDistance', 20)
  댓글 수: 2
neamah al-naffakh
neamah al-naffakh 2016년 8월 8일
thank you so much mate
Med Aymane Ahajjam
Med Aymane Ahajjam 2019년 1월 27일
Thanks!

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

추가 답변 (3개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 8일
Use
findpeaks(-your_signal)
  댓글 수: 2
neamah al-naffakh
neamah al-naffakh 2016년 8월 8일
thank you so much mate
Med Aymane Ahajjam
Med Aymane Ahajjam 2019년 1월 27일
Thanks!

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


Image Analyst
Image Analyst 2016년 8월 9일
You're probably okay with your data, but beware of findpeaks() if your max or min spikes have flat tops or bottoms. It will give only the first index. In that case you want to use the imregionalmin() function from the Image Processing Toolbox. Just look at this example with a min that has a flat bottom:
data = [ 1 3 4 2 2 2 4 4 5 6] % Flat bottom with value of 2 from indexex 4-6
[peakValues, indexesOfPeaks] = findpeaks(-data)
peakValues = -peakValues
minIndexes = imregionalmin(data)
data =
1 3 4 2 2 2 4 4 5 6
peakValues =
-2
indexesOfPeaks =
4
peakValues =
2
minIndexes =
1 0 0 1 1 1 0 0 0 0
  댓글 수: 2
neamah al-naffakh
neamah al-naffakh 2016년 8월 9일
hi mate, thanks for your effort i will check your solution and reply back , but do you mind have a look to this question please?
Image Analyst
Image Analyst 2016년 8월 9일
I don't know how to answer that question.

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


shima tavakoli
shima tavakoli 2018년 2월 13일
my signal is asymmetric and its negative parts are different. how to deal with negative parts peaks then? cant negative the signal in this case!
  댓글 수: 1
Image Analyst
Image Analyst 2018년 2월 13일
Who knows? You forgot to read this and forgot to attach your signal and a screenshot of it, so there's not much I can say, other than to write custom code to deal with it.

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

카테고리

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