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

조회 수: 2 (최근 30일)
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 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