How do I generate the described pulse signal?

1 vue (au cours des 30 derniers jours)
Rtg500
Rtg500 le 23 Août 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.

Réponses (1)

Image Analyst
Image Analyst le 27 Août 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?

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by