I cannot get Spectrogram to highlight a single frequency signal

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 日

0 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeTime-Frequency Analysis についてさらに検索

製品

リリース

R2019b

タグ

質問済み:

2020 年 6 月 15 日

回答済み:

2020 年 6 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by