フィルターのクリア

Fixed-step size: why doesn't the Nyquist-Shannon sampling theorem work?

8 ビュー (過去 30 日間)
Zahara
Zahara 2024 年 3 月 27 日
コメント済み: Zahara 2024 年 3 月 30 日
Hello,
My problem concerns the choice of fixed-step size (Model Settings > Solver details).
I have a sinusoidal signal of amplitude 3 and frequency 5Hz.
According to Shanon's theorem, I should choose a fixed-step size of 5Hz*2 = 10Hz. So I assigned 0.1 to fixed-step size. I chose "auto" solver.
But as you can see, I get a flat curve:
I have a much more better curve if I choose, for example, 0.01 as fixed-step size:
Thank you in advance for your help. I've been struggling this problem for a few hours now.

採用された回答

David Goodmanson
David Goodmanson 2024 年 3 月 27 日
編集済み: David Goodmanson 2024 年 3 月 27 日
Hello Zahara,
The Nyquist theorem gives you the bare minimum number of points to describe the oscillation. More points are better, as you are finding out. Taking your case of 5 Hz, Nyquist frequency 10 Hz, then
t = 0:.1:1;
cos(2*pi*5*t)
ans = 1 -1 1 -1 1 -1 1 -1 1 -1
showing that there is a steady oscillation, but at just two points per oscillation, you can't see the shape of the cosine waveform at all
And
sin(2*pi*5*t)
1.0e-14 * [0 0.0122 -0.0245 -0.1409 -0.0490 0.0612 0.2818 -0.2695 -0.0980 0.1102]
which is essentially 0 since the time points match up with the zeros of the sine function. In practical terms, the Nyquist criterion is no help at all here. This may or may not be why you are obtaining the flat line.
  1 件のコメント
Zahara
Zahara 2024 年 3 月 30 日
Thank you for your quick answer. I had a doubt about the explanation, it's solved now!

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

その他の回答 (0 件)

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by