MATLAB Answers

Finding multiple x-intercepts for a dataset

조회 수: 6(최근 30일)
Jacob Hohsfield
Jacob Hohsfield 2021년 6월 28일
댓글: William Rose 2021년 6월 28일
I have a 2-D dataset that crosses the x-axis multiple times.
I would like help making a function that will return all the x values at which y = 0.
Any help for a day 1 newbie would be much appreciated!
Possibly helpful background: I'm analyzing sound spectra. I would like to find the peaks of the signal by finding where the 1st derivative crosses the x-axis.

채택된 답변

William Rose
William Rose 2021년 6월 28일
Matlab has a very nice peak finding function, findpeaks(), help here: It has nice options, including threshold, minimum peak prominence, minimum horizontal (i.e. time or frequency, in your case) separation, etc.
  댓글 수: 3
William Rose
William Rose 2021년 6월 28일
@Jacob Hohsfield, you;re welcome, and good luck on your work.

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

추가 답변(1개)

William Rose
William Rose 2021년 6월 28일
You said you have a 2D dataset. If you mean the spectrogram, the time dependent Fourier transform, then findpeaks() is not the right answer since it is for 1D signals.




Community Treasure Hunt

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

Start Hunting!

Translated by