Rtg
Newbie level 4
I want to implement the following signal:
I(t) = 500*(sin(pi.t/0.3))^2, t belongs {0,Ts}
= 0, t belongs {Ts,T}
Here, T = 0.8 and Ts = 0.3
The code I tried:
The generated waveform deforms greatly, for example the generated waveform does not consist of uniformly spaced peaks.
Edit: Modified the code but still issues remain.
Mainly, instead of 1 peak for the 0.3s ON state, there are two peaks.
I(t) = 500*(sin(pi.t/0.3))^2, t belongs {0,Ts}
= 0, t belongs {Ts,T}
Here, T = 0.8 and Ts = 0.3
The code I tried:
Code:
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
The generated waveform deforms greatly, for example the generated waveform does not consist of uniformly spaced peaks.
Edit: Modified the code but still issues remain.
Code:
t = 0.01 * [0:3000]';
d = 0.8 * [0:1500]';
y = pulstran(t,d,'rectpuls',0.3);
ut = 500.*((sin(pi*(t-floor(t/0.8)*0.8)/0.3)).^2).*y;
plot(t,ut)
Mainly, instead of 1 peak for the 0.3s ON state, there are two peaks.
Last edited by a moderator: