1
votes

I'm trying to generate a sine wave without using any standard blocks available in Simulink. Right now I'm using constants for phase angle and frequency but eventually I want to vary this and hence not using the standard blocks. Here is the Simulink model

enter image description here

Here is the scope output

enter image description here

The output is not a sinusoidal wave. What am I screwing up here? I'm using a fixed step auto solver.

1
I'm guessing that you are using a too low sampling rate -- hence the distorted waveform. You need to shorten the length of a fixed-length time step in Simulink.mikkola

1 Answers

0
votes

As I'm currently not in the possession of Matlab/Simulink so I can't construct a working example. But I think the best solution for your problem is using a Simulink function block. In this block you can define a Matlab function of your own design and it will allow you to generate any signal you want. Mathworks example