Search code examples
matlabsimulink

Sawtooth with variable frequancy in simulink or matlab


Same as a VCO (gives a sin wave with a frequancy proportional to the voltage input) i need to build a similar simulink function that will create a sawtooth signal with a frequancy that varies from f-ini to f-max (example : 100Hz to 1000Hz) ruting a time given T (example : 0.5 sec).

EDIT :

After trying the solution proposed by Daniel, here is the Model : Model

Here is the solver configuration : Solver Configuration

But i still get a fixed frequency saw-tooth, here is the output : Signal

What do you suggest ?


Solution

  • Here is a simple implementation of a variable frequency variable amplitude sawtooth generator. It is basically a discrete integrator combined with a modulo to reset the sawtooth to zero. Note that the output slope is only "curved" because I used a variable frequency, for constant frequency it will generate a constant slope sawtooth.

    enter image description here