how to determine the highest peak and its frequency for a real time sound signal

6 ビュー (過去 30 日間)
Taieb Cheikh
Taieb Cheikh 2017 年 11 月 13 日
回答済み: Taieb Cheikh 2017 年 11 月 16 日
how to determine the highest peak and its frequency for a real time sound signal

回答 (5 件)

Taieb Cheikh
Taieb Cheikh 2017 年 11 月 13 日
here is my program :
SamplesPerFrame = 3073;
Microphone = dsp.AudioRecorder('SamplesPerFrame', SamplesPerFrame,...
'OutputDataType','double');
Fs = Microphone.SampleRate;
Spectra = dsp.SpectrumAnalyzer('SampleRate',Fs,'PlotAsTwoSidedSpectrum',false,...
'SpectralAverages',20,'FrequencyScale','Log');
tic;
while toc < 100000
audioIn= step(Microphone);
step(Spectra,audioIn);
audio=audioIn(:,1);
[pk1,lc1] = findpeaks(audio,'SortStr','descend','NPeaks',3);
end
release(Microphone);
release(Spectra);
what should I do to get the frequency of the highest peak ???

Chris Loizou
Chris Loizou 2017 年 11 月 13 日
Hi Taieb, well it would be nice if you could be more specific about the frequency of the signal you want to process. Do you need the frequency of the highest peak? Because a signal is actually made from multiple sine waves so to say that you need only one frequency would be a mistake. if you need to know the frequency of the highest peak that's another thing. In order ot find the highest peak you can check the function findpeaks on matlab ( https://www.mathworks.com/help/signal/ref/findpeaks.html) or just search for the max value in your data.

Taieb Cheikh
Taieb Cheikh 2017 年 11 月 13 日
thank you for your reply indeed , I need to know the frequency of the highest peak
  1 件のコメント
Christakis Loizou
Christakis Loizou 2017 年 11 月 13 日
well if you need to know the frequency of the highest peak do the fft. Or if you know the time(seconds) differnce between two max peaks then the frequency=1/time.

サインインしてコメントする。


Taieb Cheikh
Taieb Cheikh 2017 年 11 月 14 日
so , as I mentioned before , it is a real time signal processing , which I need to get the highest peak every second ( see my code above )

Taieb Cheikh
Taieb Cheikh 2017 年 11 月 16 日
any help please ?

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by