How do I call the dsp toolbox "peak finder" from code?

2 次查看(过去 30 天)
Hi all,
In dsp toolbox, I created a "SpectrumAnalyzer" system object to monitor the frequency spectrum of my microphone input in real-time. Although I can detect the peak frequencies by "tool menu -> peak finder", I want to use a code to return the peak frequencies directly in the script or command window for further process. Is it possible to do that?
Many thanks, T
  3 个评论
Tianqi Xu
Tianqi Xu 2016-11-15
Thank you for your reply! Actually, I have already checked that page before posting the question, but have trouble implementing it to my case. How do I convert the signal in the time domain (audio streaming from the microphone) into the frequency domain in real-time? Doing a FFT is one way, but it is too much computation for real-time audio processing. I hope I can make use of the built-in peak finder so that no extra computation is needed.
Tianqi Xu
Tianqi Xu 2016-11-15
Thank you for your help! After trial and error, I think I still need to go with the findpeak() function. For future references, this page may also be helpful to d the FFT to the signal in time domain. https://www.mathworks.com/help/matlab/examples/fft-for-spectral-analysis.html

请先登录,再进行评论。

回答(1 个)

Puneet Rana
Puneet Rana 2017-2-23
Hi Tianqi,
You can run findpeaks on the result of dsp.SpectrumEstimator .

类别

Help CenterFile Exchange 中查找有关 Spectral Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by