I cannot get Spectrogram to highlight a single frequency signal

조회 수: 2 (최근 30일)
John Hunt
John Hunt 2020년 6월 15일
답변: John Hunt 2020년 6월 16일
I want to use the spectrogram function in matlab, before I do I wanted to make sure I understand it. So I did a small example with a sin wave with 440 Hz as the frequency. However, when I run the spectrogram function its shows that the strongest frequency is around 70 Hz. I would love some clarification.
x = 1:.001:5;
y = sin(440*x);
figure(1); plot(x,y)
figure(2); spectrogram(y, 1000, 500, [], 1000, 'yaxis');
Thanks
  댓글 수: 2
dpb
dpb 2020년 6월 15일
sin() is in radians -- 440/2pi ==> 70.03
John Hunt
John Hunt 2020년 6월 16일
Well, that would make the difference. Thank you for pointing that out to me.

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

채택된 답변

John Hunt
John Hunt 2020년 6월 16일
dpb answered this question in the comments sin() uses radians and the conversion from radians to hertz is 1/(2pi) and 440/(2pi) is 70.03.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by