How do I generate the described pulse signal?
1 回表示 (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
Image Analyst
2016 年 8 月 27 日
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?
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!