creating sine wave with variable frequency depending on variable

11 views (last 30 days)
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?

Accepted Answer

Mathieu NOE
Mathieu NOE on 11 Oct 2021
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');

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!