-
Notifications
You must be signed in to change notification settings - Fork 181
Description
The parameter description says (defined in Blocks.Interfaces.SignalSource):
parameter SI.Time startTime=0 "Output y = offset for time < startTime";
Yes the output is equal to offset for time before starTime,
but this parameter causes an additional phase shift:
The implementation is wrong:
I used a frequency of 10 Hz and a startTime of 0.025 s (i.e. a quarter of the period).
The sine actually is shifted to a minus cosine, and the cosine is shifted to a minus sine.
I know that it is not easy to change that behaviour (an addtional correction by parameter phase is needed - very confusing)
but to correct the misleading parameter description, and offer additional blocks with the correct implementation:
y = offset + (if time < startTime then 0 else amplitude*sin(2*pi*f*time+ phase));
instead of
y = offset + (if time < startTime then 0 else amplitude*sin(2*pi*f*(time - startTime) + phase));
Bear in mind that this effects Electrial.Analog.Sources and Electrical.Polyphase.Sources!

