How do I generate the described pulse signal?

1 visualización (últimos 30 días)
Rtg500
Rtg500 el 23 de Ag. de 2016
Respondida: Image Analyst el 27 de Ag. de 2016
I want to implement the following signal:
I(t) = 500*(sin(pi.t/0.3))^2, % if t belongs {0,Ts}
= 0, % if t belongs {Ts,T}
Here, T = 0.8 and Ts = 0.3
The code I tried:
t = 0 : 0.001 : 25;
d = 0 : 0.8 : 25;
y = pulstran(t,d,'rectpuls',0.3);
ut = 500.*((sin(pi*t/0.3)).^2).*y;
plot(t,ut)
xlabel 'Time (s)', ylabel Waveform
Expected input waveform:
The waveform generated by my code is showing several aberrations, such as multiple peaks.

Respuestas (1)

Image Analyst
Image Analyst el 27 de Ag. de 2016
Your t goes from 0 to 25, and your sine wave period is 0.3/2 = 0.15, so of course there will be multiple peaks - around 25/.15 = 166 of them. Why do you think there should not be multiple peaks?

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by