フィルターのクリア

150Hz Sine wave in MATLAB simulink

29 ビュー (過去 30 日間)
Manuprabha Ravikumar
Manuprabha Ravikumar 2024 年 6 月 25 日 5:59
コメント済み: Manuprabha Ravikumar 2024 年 6 月 25 日 7:18
When I feed 150 Hz to a sine wave block with scope settings of 0.04 seconds of time span and 0.00166 as sample time, my output wave looks like a triangle wave rather than a sine wave. How do I make it appear as a sine wave?

採用された回答

Sam Chak
Sam Chak 2024 年 6 月 25 日 7:03
In short, your sinusoidal signal is undersampled. There are only 5 samples in one cycle.
ts = 1/600 % sample time
ts = 0.0017
t = 0:ts:0.04;
f = 150;
P = 1/150 % Period (1 cycle)
P = 0.0067
sam = P/ts + 1 % number of samples in 1 cycle
sam = 5
y = sin(2*pi*f*t);
plot(t, y), grid on, xlabel('t')
However, the curve looks smoother if you decrease the sample time by 100 times, as there are 401 samples (> 360 samples) in 1 cycle.
ts = ts/100 % sample time
ts = 1.6667e-05
sam = P/ts + 1 % number of samples in 1 cycle
sam = 401
t = 0:ts:0.04;
y = sin(2*pi*f*t);
plot(t, y), grid on, xlabel('t')

その他の回答 (1 件)

halleyhit
halleyhit 2024 年 6 月 25 日 6:18
Hi Manuprabha, please make sure you feed 150*2*pi to the block, because the unit is rad/s. Then, please use a smaller sample time, and you will have a wave more like sine.
  1 件のコメント
Manuprabha Ravikumar
Manuprabha Ravikumar 2024 年 6 月 25 日 7:18
Still the same...

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

カテゴリ

Help Center および File ExchangeSources についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by