sinusoidal signal with varying frequency

1 回表示 (過去 30 日間)
Neerparaj Rai
Neerparaj Rai 2018 年 5 月 8 日
回答済み: Sourabh 2025 年 4 月 23 日
I want to generate a variable frequency sinusoidal signal. I am changing the frequency from 0Hz to 30Hz, but the frequency sine output increases above 30Hz during first 1 second simulation and finally after 1 second the frequency settles down to 30Hz. Please suggest me why the frequency of the sine wave not following the frequency.

回答 (1 件)

Sourabh
Sourabh 2025 年 4 月 23 日
To generate a variable-frequency sine wave, you should integrate the frequency over time to get the phase:
Then compute:
Kindly follow the steps given below to fix the issue:
  • Replace the Clock block with an Integrator block.
  • Multiply 2π with the time-varying frequency input (f(t)).
  • Feed that result into the Integrator (which now accumulates phase).
  • Pass the Integrator output to the Sin block.
  • Connect the Sin block to the Scope
The final model looks like this:
The scope output is:
I hope this helps!

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by