creating sine wave with variable frequency depending on variable

11 ビュー (過去 30 日間)
Kai Falkenhain
Kai Falkenhain 2021 年 10 月 9 日
コメント済み: Mathieu NOE 2021 年 10 月 12 日
So I need a sine wave that has a variable frequency. The freuqency is depending on a variable. If the variable increases, the frequency should also increase, but if the variable stays constant, the frequency should also be constant. So the variable looks like that.
And with this setup
where Omega is the variable I got it to work, but of course over time the frequency still increases because of the clock. But without the clock the sine wave changes to a constant value if the vairable gets constant.
Maybe the sine wave block can help but I didn't find any way how I can integrate a variable into the block.
Does somebody know how to create the described sine wave?

採用された回答

Mathieu NOE
Mathieu NOE 2021 年 10 月 11 日
hello
this is my suggestion - see attachement (R2020b)
code for initialization :
Fs = 1000;
dt = 1/Fs;
% angular table
n = 360; % one degree resolution
angl = (0:(n-1))*2*pi/n;
tabl_sin = sin(angl);
open('sine_vco.slx');
  2 件のコメント
Kai Falkenhain
Kai Falkenhain 2021 年 10 月 12 日
Thank you very much, it works perfectly.
Mathieu NOE
Mathieu NOE 2021 年 10 月 12 日
My pleasure !

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by