Find the frequency at maximum value in pwelch function

조회 수: 5 (최근 30일)
no nitro
no nitro 2018년 9월 16일
답변: Aquatris 2018년 9월 17일
I plotted my pwelch, and I want the frequency at which the graph shows the highest value. In this particular case its around .25. I tried using findpeaks but it gives me some weird answer.
  댓글 수: 1
dpb
dpb 2018년 9월 16일
"... findpeaks but it gives me some weird answer"
Show your work; findpeaks should have no problem with that input signal with suitable inputs...

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

답변 (1개)

Aquatris
Aquatris 2018년 9월 17일
You can obtain the frequency and power vectors from pwelch function. Example;
fs = 1e3;
t = 0:1/fs:1-1/fs;
x = sin(2*pi*100*t);
[pxx,f] = pwelch(x,500,300,500,fs);
plot(f,20*log10(pxx))
then, you can simple do the following to find the frequency corresponding to max peak;
index = find(pxx == max(pxx));
freq_max = f(index); % frequency at which pxx is maximum

카테고리

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