Not getting desired signal when I multiply sine wave and pulse generator in Simulink

5 visualizaciones (últimos 30 días)
In Simulink, I am using the following model to multiply sine wave and pulse generator. And I am getting a triangular waveform enveloped in sine wave at the output.
Sine wave block parameters:
Sine type:Time based
Time(t): Use simulation time
Amplitude:5
Bias:0
Frequency (rad/sec): 2*pi*500
Phase (rad): pi/2
Sample time: 0
Pulse generator block parameters:
Pulse type: Time based
Time(t): Use simulation time
Amplitude:1
Period (secs): 0.0001
Pulse width (% of period): 50
Phase delay (secs): 0
The ouputs of Sine Wave Scope, Pulse Generator Scope and Product Scope are as follows:
Sine Wave Scope:
Pulse Generator Scope:
Product Scope:
Why the product output is triangular waveform enveloped in the sine wave?

Respuestas (1)

Paul
Paul el 26 de Oct. de 2024
Editada: Paul el 27 de Oct. de 2024
Hi Deepankar,
If the question shows the full model, then we can see it has no continuous states. The solver will be VariableStepDiscrete (even if it's set to one of the ODE solvers, it stll reverts to discrete as far as I can tell, at least in 2024a). If the max step size for the solver is set to auto, it ends up with a constant step size of 5e-5, which is the pulse width. So the output of the pulse generator is 1-0-1-0-1-0 ... at the simulation step times, which results in the triangular shape in the scope. Set the max step size in the solver to be 1/10 or 1/100 of the pulse generator period, and you'll see the curvature of the sine wave in the time frames when the pulse is non-zero.

Productos


Versión

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by