creating sine wave with variable frequency depending on variable

7 次查看(过去 30 天)
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');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by